feat(BNNBot): add wall distances for both bots to binary encoding (100 bits total)

8 new fields in ScanData (myWallN/S/E/W, enemyWallN/S/E/W), 7 bits each via Gray code,
appended after existing 44 bits. TOTAL_BITS 44 → 100.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-17 23:17:26 +02:00
parent f82a74731d
commit 938c259260
2 changed files with 40 additions and 5 deletions
+16 -4
View File
@@ -36,11 +36,23 @@ method onScannedBot*(bot: BNNBot, e: ScannedBotEvent) =
bot.hasLastPos = true
bot.hasContact = true
let arenaW = getArenaWidth().float
let arenaH = getArenaHeight().float
let enemyX = e.x
let enemyY = e.y
let scan = ScanData(
bearing: bot.enemyBearing,
distance: bot.distance,
velocity: bot.velocity,
heading: bot.heading,
bearing: bot.enemyBearing,
distance: bot.distance,
velocity: bot.velocity,
heading: bot.heading,
myWallN: arenaH - by,
myWallS: by,
myWallE: arenaW - bx,
myWallW: bx,
enemyWallN: arenaH - enemyY,
enemyWallS: enemyY,
enemyWallE: arenaW - enemyX,
enemyWallW: enemyX,
)
let vec = encode(scan)
let hamming = if bot.hasPrev: hammingDistance(bot.prevVec, vec) else: 0