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.
num_envs
Section titled “num_envs”LearningEnv.num_envs: intNumber of parallel environment instances stepped together.
LearningEnv.task: TaskProtocolThe task defining the learning objective this env steps.
device
Section titled “device”LearningEnv.device: strproperty
Compute device the batch tensors live on (e.g. "cuda:0").
LearningEnv.dt: floatproperty
Simulated seconds advanced per step() call
(physics_dt * physics_steps_per_action).
physics_dt
Section titled “physics_dt”LearningEnv.physics_dt: floatproperty
Length of a single physics step, in simulated seconds.
physics_steps_per_action
Section titled “physics_steps_per_action”LearningEnv.physics_steps_per_action: intproperty
Number of physics steps run per step() call.
max_episode_length
Section titled “max_episode_length”LearningEnv.max_episode_length: intproperty
Maximum episode length in environment steps, derived from the
task’s episode length in seconds and dt.
LearningEnv.scene: SceneProtocolproperty
The scene the task built — everything that exists in the simulation.
reset()
Section titled “reset()”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.
step()
Section titled “step()”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.
close()
Section titled “close()”LearningEnv.close() -> NoneShut the simulation down and release its resources.
Declared as:
@runtime_checkableclass LearningEnvProtocol(Protocol)