feat(BNNBot): add similarity and overlap metrics to output

Output format: <tick> <44 bits> <hamming> <similarity> <overlap>
- Similarity: bits that are the same (TOTAL_BITS - hamming)
- Overlap: bits that are 1 in both vectors (popcount of bitwise AND)
- First tick: all metrics printed as 0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-17 23:13:06 +02:00
parent 16c3e068fd
commit f82a74731d
3 changed files with 8 additions and 2 deletions
+4
View File
@@ -71,3 +71,7 @@ proc popcount*(vec: BinaryVector): int =
proc hammingDistance*(a, b: BinaryVector): int =
for i in 0..<TOTAL_BITS:
result += int(a[i] xor b[i])
proc bitwiseAnd*(a, b: BinaryVector): BinaryVector =
for i in 0..<TOTAL_BITS:
result[i] = a[i] and b[i]