Skip to content

simulo.LearningEnv

The vectorized environment contract — a gym-style env over many parallel instances.

A learning env wraps a task and steps num_envs copies of it in lockstep on one device; every tensor that crosses this interface is batched on its first dimension. Structural mirror of simulo.core.env.LearningEnv.

LearningEnv.num_envs: int

Number of parallel environment instances stepped together.

LearningEnv.task: TaskProtocol

The task defining the learning objective this env steps.

LearningEnv.device: str

property

Compute device the batch tensors live on (e.g. "cuda:0").

LearningEnv.dt: float

property

Simulated seconds advanced per step() call (physics_dt * physics_steps_per_action).

LearningEnv.physics_dt: float

property

Length of a single physics step, in simulated seconds.

LearningEnv.physics_steps_per_action: int

property

Number of physics steps run per step() call.

LearningEnv.max_episode_length: int

property

Maximum episode length in environment steps, derived from the task’s episode length in seconds and dt.

LearningEnv.scene: SceneProtocol

property

The scene the task built — everything that exists in the simulation.

LearningEnv.reset(
seed: Optional[int] = ...,
options: Optional[Dict[str, Any]] = ...,
) -> Tuple[TensorLike, Dict[str, Any]]

Reset every environment; return (observations, info).

observations has shape (num_envs, observation_dim); seed makes the episode starts reproducible.

LearningEnv.step(
actions: TensorLike,
) -> Tuple[TensorLike, TensorLike, TensorLike, TensorLike, Dict[str, Any]]

Advance one step with actions (num_envs, action_dim).

Returns (observations, rewards, terminated, truncated, info) — the gym-style 5-tuple, each tensor batched over num_envs. Environments that finish are auto-reset by the implementation.

LearningEnv.close() -> None

Shut the simulation down and release its resources.


Declared as:

@runtime_checkable
class LearningEnvProtocol(Protocol)