pub struct TrajectoryView<'a, T: R2lTensor> {
pub states: &'a [T],
pub next_states: &'a [T],
pub actions: &'a [T],
pub rewards: &'a [f32],
pub terminated: &'a [bool],
pub truncated: &'a [bool],
}Expand description
Borrowed view over the aligned fields of a TrajectoryBuffer.
Fields§
§states: &'a [T]Observations before each action.
next_states: &'a [T]Observations after each action.
actions: &'a [T]Actions selected at each step.
rewards: &'a [f32]Rewards produced at each step.
terminated: &'a [bool]Terminal-state flags for each step.
truncated: &'a [bool]Truncation flags for each step.
Implementations§
Trait Implementations§
Source§impl<T: R2lTensor> TrajectoryBatch<T> for TrajectoryView<'_, T>
impl<T: R2lTensor> TrajectoryBatch<T> for TrajectoryView<'_, T>
Source§fn next_states(&self) -> &[T]
fn next_states(&self) -> &[T]
Returns observations after each action.
Source§fn terminated(&self) -> &[bool]
fn terminated(&self) -> &[bool]
Returns terminal-state flags for each step.
Auto Trait Implementations§
impl<'a, T> Freeze for TrajectoryView<'a, T>
impl<'a, T> RefUnwindSafe for TrajectoryView<'a, T>where
&'a [T]: RefUnwindSafe,
impl<'a, T> Send for TrajectoryView<'a, T>
impl<'a, T> Sync for TrajectoryView<'a, T>
impl<'a, T> Unpin for TrajectoryView<'a, T>
impl<'a, T> UnsafeUnpin for TrajectoryView<'a, T>where
&'a [T]: UnsafeUnpin,
impl<'a, T> UnwindSafe for TrajectoryView<'a, T>where
&'a [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
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