pub struct LibVecEnv { /* private fields */ }Expand description
Vector environments of a Library, with the operations of
CompiledVecEnv.
Implementations§
Source§impl LibVecEnv
impl LibVecEnv
Sourcepub fn num_actions(&self) -> usize
pub fn num_actions(&self) -> usize
The number of discrete actions (0 for continuous actions).
Sourcepub fn action_space(&self) -> &ActionSpace
pub fn action_space(&self) -> &ActionSpace
The actions.
Sourcepub fn num_threads(&self) -> usize
pub fn num_threads(&self) -> usize
The number of threads that step the environments.
Sourcepub fn set_num_threads(&mut self, threads: usize)
pub fn set_num_threads(&mut self, threads: usize)
Changes the number of threads.
Sourcepub fn reset(&mut self, seed: Option<i64>)
pub fn reset(&mut self, seed: Option<i64>)
Starts new episodes (see CompiledVecEnv::reset).
Sourcepub fn step_into(&mut self, actions: Actions<'_>, out: StepBuffers<'_>)
pub fn step_into(&mut self, actions: Actions<'_>, out: StepBuffers<'_>)
Steps every environment (see CompiledVecEnv::step_into_actions).
§Panics
Panics if a buffer has the wrong length.
Sourcepub fn step_into_without_final(
&mut self,
actions: Actions<'_>,
obs: &mut [f32],
reward: &mut [f32],
terminated: &mut [bool],
truncated: &mut [bool],
)
pub fn step_into_without_final( &mut self, actions: Actions<'_>, obs: &mut [f32], reward: &mut [f32], terminated: &mut [bool], truncated: &mut [bool], )
Steps every environment without the final observations (see
CompiledVecEnv::step_into_without_final).
§Panics
Panics if the number or kind of actions is wrong, or a buffer has the wrong length.
Sourcepub fn legal_action_masks_into(&self, out: &mut [bool]) -> bool
pub fn legal_action_masks_into(&self, out: &mut [bool]) -> bool
Writes the legal action masks and returns true, or returns false
if the environment has none.
§Panics
Panics if out does not hold num_envs masks over the joint actions.
Trait Implementations§
impl Send for LibVecEnv
impl Sync for LibVecEnv
Auto Trait Implementations§
impl Freeze for LibVecEnv
impl RefUnwindSafe for LibVecEnv
impl Unpin for LibVecEnv
impl UnsafeUnpin for LibVecEnv
impl UnwindSafe for LibVecEnv
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more