Skip to content

Commit 73f64f2

Browse files
committed
Change: Move round setting to tournament section of config
1 parent 7f4cbb4 commit 73f64f2

11 files changed

Lines changed: 21 additions & 12 deletions

codeclash/agents/minisweagent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def run(self):
105105
traj_path,
106106
exit_status=exit_status,
107107
result=result,
108+
print_fct=self.logger.debug,
108109
)
109110
copy_file_to_container(
110111
self.environment,

codeclash/tournaments/pvp_training.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(
3232

3333
@property
3434
def rounds(self) -> int:
35-
return self.config["game"]["rounds"]
35+
return self.config["tournament"]["rounds"]
3636

3737
def get_agent(self, agent_config: dict, prompts: dict) -> Player:
3838
"""Create an agent with environment and game context."""

codeclash/tournaments/single_player_training.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ def __init__(self, config: dict, cleanup: bool = False):
2929
mirror_agent_config = copy.deepcopy(self.config["player"])
3030
mirror_agent_config["name"] = "mirror"
3131
self.mirror_agent: Player = self.get_agent(mirror_agent_config, round=0)
32-
self.logger = get_logger(self.game.name)
3332
self.scoreboard: list[tuple[int, str]] = []
3433

3534
@property
3635
def rounds(self) -> int:
37-
return self.config["game"]["rounds"]
36+
return self.config["tournament"]["rounds"]
3837

3938
def get_game_context(self, agent_config: dict, *, round: int) -> GameContext:
4039
"""Create a game context for an agent."""
@@ -71,7 +70,8 @@ def run(self):
7170
try:
7271
for round_num in range(1, self.rounds + 1):
7372
self.run_training_round(round_num)
74-
self.evaluate()
73+
if self.config["tournament"]["evaluate_matrix"]:
74+
self.evaluate()
7575
finally:
7676
self.cleanup()
7777

configs/battlecode.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
game:
22
name: BattleCode
3-
rounds: 2
43
args:
54
maps: quack
5+
tournament:
6+
rounds: 2
67
players:
78
- agent: dummy
89
name: p1

configs/battlesnake.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
game:
22
name: BattleSnake
3-
rounds: 2
43
args:
54
width: 11
65
height: 11
76
browser: false
7+
tournament:
8+
rounds: 2
89
players:
910
- agent: mini
1011
name: p1
1112
config: configs/mini/default.yaml
12-
model: claude-sonnet-4-20250514
13+
model: openai/gpt-5-mini
1314
- agent: dummy
1415
name: p2
1516
prompts:

configs/battlesnake_dummy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
game:
22
name: BattleSnake
3-
rounds: 2
43
args:
54
width: 11
65
height: 11
76
browser: false
7+
tournament:
8+
rounds: 2
89
players:
910
- agent: dummy
1011
name: p1

configs/battlesnake_single_player.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
game:
22
name: BattleSnake
3-
rounds: 1
43
args:
54
width: 11
65
height: 11
76
browser: false
7+
tournament:
8+
rounds: 1
9+
evaluate_matrix: true
810
player:
911
agent: mini
1012
config: configs/mini/default.yaml

configs/corewar.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
game:
22
name: CoreWar
3-
rounds: 3
43
args:
54
r: 100
5+
tournament:
6+
rounds: 3
67
players:
78
- agent: dummy
89
name: p1

configs/robocode.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
game:
22
name: RoboCode
3-
rounds: 3
43
battle:
54
battle:
65
numRounds: 10
@@ -14,6 +13,8 @@ game:
1413
args:
1514
nodisplay: true
1615
nosound: true
16+
tournament:
17+
rounds: 3
1718
players:
1819
- agent: dummy
1920
name: p1

configs/robotrumble.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
game:
22
name: RobotRumble
3+
tournament:
34
rounds: 3
45
players:
56
- agent: dummy

0 commit comments

Comments
 (0)