feat(SNNBot): add bullet economy test against WallsBot

Add --max-speed flag to TestBattleRunner (sets defaultTurnsPerSecond=-1 for unlimited TPS).
Add SNNBot_garage/tests/test_bullet_economy.nim: 10-round vs WallsBot, prints per-round and summary stats for tuning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-16 08:41:25 +02:00
parent 94eb805d04
commit ffa277e31d
2 changed files with 57 additions and 1 deletions
+8 -1
View File
@@ -19,6 +19,7 @@ public class TestBattleRunner {
String serverUrl = null;
int rounds = 1;
boolean maxSpeed = false;
List<String> botDirs = List.of();
for (int i = 0; i < args.length; i++) {
@@ -26,6 +27,7 @@ public class TestBattleRunner {
case "--server-url" -> serverUrl = args[++i];
case "--rounds" -> rounds = Integer.parseInt(args[++i]);
case "--bot-dirs" -> botDirs = Arrays.asList(args[++i].split(","));
case "--max-speed" -> maxSpeed = true;
default -> { System.err.println("Unknown arg: " + args[i]); System.exit(1); }
}
}
@@ -36,7 +38,12 @@ public class TestBattleRunner {
final String url = serverUrl;
final List<BotEntry> bots = botDirs.stream().map(BotEntry::of).collect(Collectors.toList());
final int numRounds = rounds;
final var setup = BattleSetup.classic(s -> s.setNumberOfRounds(numRounds));
final boolean runMaxSpeed = maxSpeed;
// -1 = max TPS (no speed limit); see ServerCli.kt: "where -1 means maximum TPS"
final var setup = BattleSetup.classic(s -> {
s.setNumberOfRounds(numRounds);
if (runMaxSpeed) s.setDefaultTurnsPerSecond(-1);
});
// Debug: check what JSON files the runner will find for each bot dir
for (String dir : botDirs) {