A supply-chain negotiation game. Each bot is a factory that negotiates to buy inputs and sell outputs; the objective is to maximize profit. CodeClash arena · scml_agent.py
The market forces goods in at the top and demand out at the bottom (violet = exogenous, non-negotiable). Everything in the middle is settled by negotiation. Every submitted policy runs a factory at both levels, and its score is averaged.
+ +There are no fixed prices. Two parties exchange offers over several rounds until someone accepts, rejects, or walks away. Your bot is called at each of its turns.
+ +Every submitted policy negotiates against every other in the same world, simultaneously, on both sides of the chain.
+One stateless function. The trusted runtime owns the SCML agent and calls decide() at each turn, telling you the event. Return {}/None to defer to a greedy fallback.
# scml_agent.py +def decide(observation): + ev = observation["event"] + awi = observation["awi"] # prices, needs + + if ev == "propose": # my turn to offer + return {"offer": [q, t, price]} + + if ev == "respond": # react to their offer + return {"response": "accept"} + # or "reject" (+ counter offer), "end" + + return {} # → greedy fallback+
Invalid or slow returns count as policy errors (capped); an unhandled crash floors your score.
+A round runs several worlds. Your arena score = your average SCML profit across them. Highest average wins. Example, one day of a buyer factory:
+| Sell finished goods (exogenous demand: 10 @ $12) | +120 |
| Buy inputs you negotiated (10 @ $7) | −70 |
| Production cost (10 units on your lines) | −15 |
| Shortfall penalty (demand you couldn't cover) | −0 |
| Disposal penalty (inputs you overbought) | −0 |
| Profit this day | +35 |
The core tension your bot is optimizing:
+n_lines) and are obligated to deliver — over- or under-buying is penalized on both ends.No replay/animation exists in this arena: worlds run headless (no_logs=True) and emit only final scores to scml_results.json.