SCML
Supply-chain negotiation arena based on the ANAC Supply Chain Management League OneShot track.
Overview
SCML simulates a supply chain in which autonomous factory-manager agents negotiate contracts to buy and sell goods. The CodeClash arena uses the SCML2024 OneShot world because it focuses on negotiation and profit without requiring long-term production scheduling.
Each CodeClash player edits an SCML OneShot agent. A round runs multiple independent SCML worlds and scores each player by average profit.
Resources
Implementation
codeclash.arenas.scml.scml.SCMLOneShotArena
SCMLOneShotArena(config: dict, *, tournament_id: str, local_output_dir: Path, keep_containers: bool = False)
Bases: CodeArena
Source code in codeclash/arenas/arena.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
name
class-attribute
instance-attribute
name: str = 'SCML'
submission
class-attribute
instance-attribute
submission: str = 'scml_agent.py'
description
class-attribute
instance-attribute
description: str = 'SCML OneShot is a supply-chain negotiation simulator based on the ANAC Supply Chain Management League.\n\nYour bot is a Python file named `scml_agent.py` that defines a class named `MyAgent`.\n`MyAgent` should inherit from an SCML OneShot agent class, for example:\n\n from scml.oneshot.agents import GreedySyncAgent\n\n class MyAgent(GreedySyncAgent):\n ...\n\nEach round runs several SCML2024 OneShot worlds. Your agent negotiates with the other submitted\nagents to buy or sell goods in a simulated supply chain. The objective is to maximize profit. The\narena score is your average SCML score across all worlds in the round.\n'
default_args
class-attribute
instance-attribute
default_args: dict = {'sims_per_round': 3, 'n_steps': 10, 'n_lines': 2, 'timeout': 180}
validate_code
validate_code(agent: Player) -> tuple[bool, str | None]
Source code in codeclash/arenas/scml/scml.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
execute_round
execute_round(agents: list[Player]) -> None
Source code in codeclash/arenas/scml/scml.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
get_results
get_results(agents: list[Player], round_num: int, stats: RoundStats)
Source code in codeclash/arenas/scml/scml.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
Agent Interface
Your bot must be a Python file named scml_agent.py that defines MyAgent.
MyAgent must inherit from an SCML OneShot agent class. A valid starting point is:
from scml.oneshot.agents import GreedySyncAgent
class MyAgent(GreedySyncAgent):
pass
Agents can use the normal SCML OneShot APIs exposed by the upstream scml package. The package is
installed in the SCML arena Docker image, not in CodeClash's core Python environment.
Configuration Example
tournament:
rounds: 1
game:
name: SCML
sims_per_round: 2
n_steps: 5
n_lines: 2
players:
- agent: dummy
name: alpha
- agent: dummy
name: beta
Scoring
The arena runs sims_per_round independent SCML2024 OneShot worlds. For each world, it maps SCML
agent scores back to CodeClash player names. The final CodeClash score is the average SCML score
across those worlds.
The runner rotates player ordering across simulations to reduce positional bias from factory assignment.