BatchSteppable

Trait BatchSteppable 

Source
pub trait BatchSteppable: Send {
    // Required methods
    fn step_batch(
        &mut self,
        actions: &[Action],
    ) -> Result<BatchTransition, RloxError>;
    fn reset_batch(
        &mut self,
        seed: Option<u64>,
    ) -> Result<Vec<Observation>, RloxError>;
    fn num_envs(&self) -> usize;
    fn action_space(&self) -> &ActionSpace;
    fn obs_space(&self) -> &ObsSpace;
}
Expand description

Trait for anything that can step a batch of environments.

Separates the parallelism strategy from step logic, so that both Rust-native VecEnv (Rayon) and future Python-backed GymVecEnv can share a common interface for rollout collectors and training loops.

The Send bound enables use from async / threaded contexts.

Required Methods§

Source

fn step_batch( &mut self, actions: &[Action], ) -> Result<BatchTransition, RloxError>

Step all environments with the given actions (one per env).

Source

fn reset_batch( &mut self, seed: Option<u64>, ) -> Result<Vec<Observation>, RloxError>

Reset all environments, optionally seeding them deterministically.

Source

fn num_envs(&self) -> usize

Number of sub-environments in this batch.

Source

fn action_space(&self) -> &ActionSpace

The shared action space (all sub-environments must have the same space).

Source

fn obs_space(&self) -> &ObsSpace

The shared observation space.

Implementors§