Switch the controlled side¶
By default the controlled side is Side.GUARD. Train the bandit
instead with one dataclasses.replace:
Recipe¶
import dataclasses
from orbitalgym import Side, make_lady_bandit_guard
cfg = make_lady_bandit_guard()
cfg = dataclasses.replace(cfg, controlled_side=Side.BANDIT)
Now cfg.guard_policy drives the guard, and the adapter's
action / observation are the bandit's.
Effect on adapters¶
- Gymnasium — observation and action space switch to the bandit's.
- PettingZoo — multi-agent, both sides controlled;
controlled_sideis ignored. - POMDP — per-side dispatch,
controlled_sideis ignored; passsideexplicitly toreward/observation.
See also¶
- Use the Gymnasium adapter.
- Extending → Controlled-side policy cookbook for patterns once you've switched.