pub struct TrajectoryBuffer<T: R2lTensor> { /* private fields */ }Expand description
Owned, structure-of-arrays storage for one environment trajectory.
Implementations§
Source§impl<T: R2lTensor> TrajectoryBuffer<T>
impl<T: R2lTensor> TrajectoryBuffer<T>
Sourcepub fn replace_last_next_state(&mut self, next_state: T)
pub fn replace_last_next_state(&mut self, next_state: T)
Replaces the most recently stored next state, if one exists.
Sourcepub fn terminated(&self) -> &[bool]
pub fn terminated(&self) -> &[bool]
Returns terminal-state flags.
Sourcepub fn rewards_mut(&mut self) -> &mut [f32]
pub fn rewards_mut(&mut self) -> &mut [f32]
Returns mutable access to the stored rewards.
Sourcepub fn to_trajectory_view(&self) -> TrajectoryView<'_, T>
pub fn to_trajectory_view(&self) -> TrajectoryView<'_, T>
Borrows the buffer as aligned trajectory slices.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TrajectoryBuffer<T>
impl<T> RefUnwindSafe for TrajectoryBuffer<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for TrajectoryBuffer<T>
impl<T> Sync for TrajectoryBuffer<T>
impl<T> Unpin for TrajectoryBuffer<T>
impl<T> UnsafeUnpin for TrajectoryBuffer<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for TrajectoryBuffer<T>where
Vec<T>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more