MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / execute_round

Method execute_round

codeclash/arenas/scml/scml.py:79–107  ·  view source on GitHub ↗
(self, agents: list[Player])

Source from the content-addressed store, hash-verified

77 return True, None
78
79 def execute_round(self, agents: list[Player]) -> None:
80 agent_args = []
81 for agent in agents:
82 agent_args.extend(["--agent", f"{agent.name}=/{agent.name}/{self.submission}"])
83
84 cmd = [
85 "python",
86 "run_scml.py",
87 "--sims",
88 str(self._game_arg("sims_per_round")),
89 "--steps",
90 str(self._game_arg("n_steps")),
91 "--lines",
92 str(self._game_arg("n_lines")),
93 "--decision-timeout",
94 str(self._game_arg("decision_timeout")),
95 "--max-policy-errors",
96 str(self._game_arg("max_policy_errors")),
97 "--output",
98 str(self.log_env / RESULTS_JSON),
99 *agent_args,
100 ]
101 full_cmd = " ".join(shlex.quote(part) for part in cmd)
102 self.logger.info(f"Running game: {full_cmd}")
103 try:
104 response = self.environment.execute(full_cmd, timeout=int(self._game_arg("timeout")))
105 except subprocess.TimeoutExpired as exc:
106 raise RuntimeError("SCML round timed out") from exc
107 assert_zero_exit_code(response, logger=self.logger)
108
109 def get_results(self, agents: list[Player], round_num: int, stats: RoundStats):
110 result_file = self.log_round(round_num) / RESULTS_JSON

Callers

nothing calls this directly

Calls 3

_game_argMethod · 0.95
assert_zero_exit_codeFunction · 0.90
executeMethod · 0.45

Tested by

no test coverage detected