pub struct Step<B: Backend, S, O> {
pub obs: O,
pub state: S,
pub reward: F32<B>,
pub terminated: Bool<B>,
pub truncated: Bool<B>,
pub final_observation: O,
pub discount: F32<B>,
}Expand description
The result of Environment::step, with automatic reset (gymnax’s
(obs, state, reward, terminated, truncated, info)).
Fields§
§obs: OThe next observation: after a reset if the episode ended.
state: SThe next state: a fresh one if the episode ended.
reward: F32<B>The reward of the step.
terminated: Bool<B>Whether the episode ended in a terminal state.
truncated: Bool<B>Whether the episode reached its time limit.
final_observation: OThe observation reached by the step, before any reset.
discount: F32<B>0 if the step reached a terminal state, 1 otherwise.
Trait Implementations§
Source§impl<B: Backend, S: Tree<B>, O: Tree<B>> Tree<B> for Step<B, S, O>
impl<B: Backend, S: Tree<B>, O: Tree<B>> Tree<B> for Step<B, S, O>
Source§type On<C: Backend> = Step<C, <S as Tree<B>>::On<C>, <O as Tree<B>>::On<C>>
type On<C: Backend> = Step<C, <S as Tree<B>>::On<C>, <O as Tree<B>>::On<C>>
The same structure on backend
C.Source§fn unflatten_like(&self, leaves: &mut dyn Iterator<Item = B::Leaf>) -> Self
fn unflatten_like(&self, leaves: &mut dyn Iterator<Item = B::Leaf>) -> Self
Builds a value of the same structure from leaves.
Auto Trait Implementations§
impl<B, S, O> Freeze for Step<B, S, O>
impl<B, S, O> RefUnwindSafe for Step<B, S, O>where
O: RefUnwindSafe,
S: RefUnwindSafe,
<B as Backend>::Scalar<f32>: RefUnwindSafe,
<B as Backend>::Scalar<bool>: RefUnwindSafe,
impl<B, S, O> Send for Step<B, S, O>
impl<B, S, O> Sync for Step<B, S, O>
impl<B, S, O> Unpin for Step<B, S, O>
impl<B, S, O> UnsafeUnpin for Step<B, S, O>where
O: UnsafeUnpin,
S: UnsafeUnpin,
<B as Backend>::Scalar<f32>: UnsafeUnpin,
<B as Backend>::Scalar<bool>: UnsafeUnpin,
impl<B, S, O> UnwindSafe for Step<B, S, O>where
O: UnwindSafe,
S: UnwindSafe,
<B as Backend>::Scalar<f32>: UnwindSafe,
<B as Backend>::Scalar<bool>: 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