Skip to content

simulo.Player

The playback contract — roll a trained policy through an environment.

A player loads a policy output and drives it for a bounded number of episodes or steps, optionally in real time and optionally capturing video. Structural mirror of simulo.core.player.Player.

Player.play(
num_episodes: Optional[int] = ...,
num_steps: Optional[int] = ...,
real_time: bool = ...,
video_path: Optional[str] = ...,
video_length: int = ...,
deterministic: bool = ...,
) -> Dict[str, Any]

Run the policy and return playback metrics (e.g. mean episode return).

Bound the run with num_episodes or num_steps. real_time paces stepping to the sim clock (for watching live); video_path captures up to video_length frames to a file; deterministic disables action sampling and takes the policy’s mean action.

Player.load(path: str) -> None

Load the policy output (e.g. a checkpoint or exported policy) from path.

Player.close() -> None

Release the player’s resources. Idempotent; call before closing the env.


Declared as:

@runtime_checkable
class PlayerProtocol(Protocol)