Skip to content

simulo.RewardComponent

One term of a task’s reward.

Per-step reward contributions from every component are summed into the task reward. Structural mirror of simulo.core.rewards.RewardComponent.

RewardComponent.initialize(robot: RobotProtocol, device: str, num_envs: int) -> None

One-time setup: cache the robot handle and size buffers for num_envs on device.

RewardComponent.compute(
prev_actions: TensorLike,
terminated: Optional[TensorLike],
) -> TensorLike

Return this component’s reward contribution, shape (num_envs,).

prev_actions is the last applied action batch (for action-penalty terms); terminated marks environments ending this step (for terminal bonuses/penalties) and may be None when termination info is not available.


Declared as:

@runtime_checkable
class RewardComponentProtocol(Protocol)