diff --git a/BNNBot_garage/BNNBot b/BNNBot_garage/BNNBot index 30cb43d..88a0d87 100755 Binary files a/BNNBot_garage/BNNBot and b/BNNBot_garage/BNNBot differ diff --git a/BNNBot_garage/src/BNNBot.nim b/BNNBot_garage/src/BNNBot.nim index 8cd3794..bd571d0 100644 --- a/BNNBot_garage/src/BNNBot.nim +++ b/BNNBot_garage/src/BNNBot.nim @@ -20,6 +20,8 @@ type heading: float # enemy heading (degrees) distance: float tick: int + prevVec: BinaryVector + hasPrev: bool method onScannedBot*(bot: BNNBot, e: ScannedBotEvent) = let bx = getX(); let by = getY() @@ -41,7 +43,10 @@ method onScannedBot*(bot: BNNBot, e: ScannedBotEvent) = heading: bot.heading, ) let vec = encode(scan) - echo $bot.tick, " ", formatBinary(vec) + let distance = if bot.hasPrev: hammingDistance(bot.prevVec, vec) else: 0 + echo $bot.tick, " ", formatBinary(vec), " ", distance + bot.prevVec = vec + bot.hasPrev = true method onRoundStarted*(bot: BNNBot, e: RoundStartedEvent) = setAdjustGunForBodyTurn(true) @@ -51,6 +56,7 @@ method onRoundStarted*(bot: BNNBot, e: RoundStartedEvent) = bot.hasContact = false bot.hasLastPos = false bot.tick = 0 + bot.hasPrev = false setTargetSpeed(0.0) setTurnRate(0.0)