## Re-baseline the DrussGT bridge battle on the selected server. ## ## ModularBot (Nim) vs the real DrussGT running through tools/robocode_shim. ## DrussGT is a prebuilt Java bot dir (only .json/.sh), so the framework's ## compileBots() cannot be used for it; we drive the runner directly. ## ## BRIDGE_ROUNDS=5 TR_SERVER_JAR= \ ## nim c -r --path:common_libs common_libs/tests/measure_bridge_battle.nim import std/[os, strformat, strutils] import test_framework/server_manager import test_framework/bot_compiler import test_framework/runner_process import test_framework/battle_result const repoRoot = currentSourcePath().parentDir.parentDir.parentDir modularBotDir = repoRoot / "ModularBot_garage" let drussDir = getEnv("DRUSSGT_BOTDIR", "/tmp/tr_bots/DrussGT") let rounds = parseInt(getEnv("BRIDGE_ROUNDS", "5")) if not fileExists(drussDir / "DrussGT.sh"): echo "SKIP: DrussGT bridge bot dir not found at ", drussDir quit(0) ensureServer() discard compileBots(@[modularBotDir]) echo "server jar : ", getEnv("TR_SERVER_JAR", DefaultServerJar) echo "drussgt dir: ", drussDir let raw = runBattleRunner(getServerUrl(), @[modularBotDir, drussDir], rounds, 900_000, true) let r = parseServerOutput(raw) for b in r.results: echo fmt" {b.name:<12} totalScore={b.totalScore} rank={b.rank} firstPlaces={b.firstPlaces} survival={b.survivalCount}" echo "rounds played: ", r.rounds.len for rr in r.rounds: var line = " round " & $rr.round & ":" for b in rr.results: let st = if b.survived: "surv" else: "dead" line &= fmt" {b.name}={b.score}({st})" echo line