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.
initialize()
Section titled “initialize()”RewardComponent.initialize(robot: RobotProtocol, device: str, num_envs: int) -> NoneOne-time setup: cache the robot handle and size buffers for num_envs on device.
compute()
Section titled “compute()”RewardComponent.compute( prev_actions: TensorLike, terminated: Optional[TensorLike],) -> TensorLikeReturn 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_checkableclass RewardComponentProtocol(Protocol)