Skip to content

Commit cbeaf1f

Browse files
committed
Ref/simplify: Add empty patch for round 0
1 parent 548b6b4 commit cbeaf1f

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

codeclash/agents/abstract.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def __init__(
3636
self._metadata = {
3737
"name": self.name,
3838
"player_unique_id": self._player_unique_id,
39-
"diff": {}, # mapping round -> diff
40-
"incremental_diff": {}, # mapping round -> diff
39+
"diff": {0: ""}, # mapping round -> diff
40+
"incremental_diff": {0: ""}, # mapping round -> diff
4141
}
4242

4343
# --- Main methods ---

codeclash/tournaments/single_player_training.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,8 @@ def run_main_agent(self, round_num: int):
8080

8181
def set_mirror_state_to_round(self, round_num: int):
8282
"""Update mirror agent's codebase with the main agent's changes."""
83-
if round_num == 0:
84-
full_diff = ""
85-
else:
86-
full_diff = self.agent.get_metadata()["diff"][round_num]
87-
full_diff = filter_git_diff(full_diff)
88-
83+
full_diff = self.agent.get_metadata()["diff"][round_num]
84+
full_diff = filter_git_diff(full_diff)
8985
self.mirror_agent.reset_and_apply_patch(full_diff)
9086

9187
def cleanup(self):

0 commit comments

Comments
 (0)