pub trait DynVecEnv: Send + Sync {
// Required methods
fn describe(&self) -> Value;
fn num_envs(&self) -> usize;
fn num_threads(&self) -> usize;
fn set_num_threads(&mut self, threads: usize);
fn reset(&mut self, seed: Option<i64>);
fn obs_into(&self, out: &mut [f32]);
fn step_into(&mut self, actions: Actions<'_>, out: StepBuffers<'_>);
fn legal_action_masks(&self, out: &mut [bool]) -> bool;
fn step_without_final(
&mut self,
actions: Actions<'_>,
obs: &mut [f32],
reward: &mut [f32],
terminated: &mut [bool],
truncated: &mut [bool],
);
}Expand description
A compiled vector environment behind a trait object, as the library side keeps it.
Required Methods§
Sourcefn num_threads(&self) -> usize
fn num_threads(&self) -> usize
The number of threads.
Sourcefn set_num_threads(&mut self, threads: usize)
fn set_num_threads(&mut self, threads: usize)
Changes the number of threads.
Sourcefn step_into(&mut self, actions: Actions<'_>, out: StepBuffers<'_>)
fn step_into(&mut self, actions: Actions<'_>, out: StepBuffers<'_>)
Steps every environment.
Sourcefn legal_action_masks(&self, out: &mut [bool]) -> bool
fn legal_action_masks(&self, out: &mut [bool]) -> bool
Writes the legal action masks, if any.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".