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§
Sourcefn step_batch(
&mut self,
actions: &[Action],
) -> Result<BatchTransition, RloxError>
fn step_batch( &mut self, actions: &[Action], ) -> Result<BatchTransition, RloxError>
Step all environments with the given actions (one per env).
Sourcefn reset_batch(
&mut self,
seed: Option<u64>,
) -> Result<Vec<Observation>, RloxError>
fn reset_batch( &mut self, seed: Option<u64>, ) -> Result<Vec<Observation>, RloxError>
Reset all environments, optionally seeding them deterministically.
Sourcefn action_space(&self) -> &ActionSpace
fn action_space(&self) -> &ActionSpace
The shared action space (all sub-environments must have the same space).