versus
¶
Checked changes to versus mode for SensAI. Every compared trial's data is loaded, so how many a message may add is capped.
VersusChange
¶
Bases: BaseModel
A change's new state, how many trials it added, and how many pins it left out for want of room.
-
Reference
mujoco_mojoutilslayersdojosensaiversuschange_versus
VersusError
¶
Bases: ValueError
A change that cannot be made, worded for the agent so it can correct itself.
compared_trials
¶
compared_trials(
state: VersusState, known: Collection[int] | None
) -> set[int]
The trial numbers the state compares, the range's and the pinned ones, limited to known (the job's trials) when given.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/versus.py
change_versus
¶
change_versus(
state: VersusState,
*,
room: int,
known: Collection[int] | None = None,
enabled: bool | None = None,
trial_range: Sequence[int] | None = None,
no_range: bool = False,
pin: Iterable[int] = (),
unpin: Iterable[int] = (),
clear_pins: bool = False,
) -> VersusChange
Applies a change to state: unpins and clears, sets the range, then adds pins lowest first while room trials remain.
Pinning or setting a range turns versus mode on unless enabled says otherwise. A range that would add more than room is refused, since cutting it short picks a range nobody asked for; pins are cut short and the number left out is reported.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/versus.py
describe_versus
¶
describe_versus(
state: VersusState, known: Collection[int] | None = None
) -> str
The state in words: on or off, its range and pins, and how many trials that compares.