Skip to content

simulo.TerminationSet

Helper to compose multiple termination conditions.

Names each condition so callers can combine or inspect them without losing the reason an episode ended.

Example: term_set = simulo.TerminationSet([ simulo.term.HeightBelow(0.8, name=“robot fell”), simulo.term.TiltExceeds(60, name=“robot tipped over”), ]) term_set.initialize(robot, device, num_envs)

terminated = term_set.check()

simulo.TerminationSet(conditions: List[TerminationCondition])
TerminationSet.initialize(robot: RobotProtocol, device: str, num_envs: int) -> None

Initialize all conditions.

Must be called in on_start() before using check().

Args:

  • robot — Robot instance
  • device — Torch device string
  • num_envs — Number of parallel environments
TerminationSet.check() -> dict[str, torch.Tensor]

Check all conditions and retain their names.

Returns:

Mapping from each explicit condition name, or its class name as a fallback, to a boolean tensor of shape (num_envs,).

TerminationSet.check_breakdown() -> dict[str, torch.Tensor]

Check all conditions with per-condition breakdown.

Useful for debugging which conditions are triggering termination.

Returns:

Dict mapping condition names to their boolean tensors