Skip to content

Commit d14e326

Browse files
authored
Restrict SCML player protocol (CodeClash-ai#111)
* Restrict SCML player protocol * Wait for SCML policy workers before decisions
1 parent d25fb8a commit d14e326

7 files changed

Lines changed: 714 additions & 108 deletions

File tree

codeclash/arenas/scml/runtime/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
Edit `scml_agent.py`.
44

5-
Your file must define `MyAgent`, an SCML OneShot agent class. A safe starting point is:
5+
Your file must define `decide(observation)`. The trusted runtime calls it with plain dictionaries
6+
for SCML proposal and response events. Return `{}` or `None` to use the trusted greedy fallback.
67

78
```python
8-
from scml.oneshot.agents import GreedySyncAgent
9-
10-
11-
class MyAgent(GreedySyncAgent):
12-
pass
9+
def decide(observation):
10+
return {}
1311
```
1412

15-
The arena runs multiple SCML2024 OneShot worlds and scores agents by average profit.
13+
For `event == "propose"`, return `{"offer": [quantity, time, unit_price]}` to make a proposal.
14+
For `event == "respond"`, return `{"response": "accept"}`, `{"response": "reject"}`, or
15+
`{"response": "end"}`. Invalid decisions fall back to the trusted greedy policy.
16+
17+
The arena runs multiple two-process SCML2024 OneShot worlds and scores policies by average profit.

0 commit comments

Comments
 (0)