Struct Step

Source
pub struct Step<E: Env> {
    pub act: E::Act,
    pub obs: E::Obs,
    pub reward: Vec<f32>,
    pub is_terminated: Vec<i8>,
    pub is_truncated: Vec<i8>,
    pub info: E::Info,
    pub init_obs: E::Obs,
}
Expand description

Represents an action, observation and reward tuple (a_t, o_t+1, r_t) with some additional information.

An environment emits Step object at every interaction steps. This object might be used to create transitions (o_t, a_t, o_t+1, r_t).

Fields§

§act: E::Act

Action.

§obs: E::Obs

Observation.

§reward: Vec<f32>

Reward.

§is_terminated: Vec<i8>

Flag denoting if episode is terminated.

§is_truncated: Vec<i8>

Flag denoting if episode is truncated.

§info: E::Info

Information defined by user.

§init_obs: E::Obs

Initial observation. If is_done[i] == 0, the corresponding element will not be used.

Implementations§

Source§

impl<E: Env> Step<E>

Source

pub fn new( obs: E::Obs, act: E::Act, reward: Vec<f32>, is_terminated: Vec<i8>, is_truncated: Vec<i8>, info: E::Info, init_obs: E::Obs, ) -> Self

Constructs a Step object.

Source

pub fn is_done(&self) -> bool

Terminated or truncated.

Auto Trait Implementations§

§

impl<E> Freeze for Step<E>
where <E as Env>::Act: Freeze, <E as Env>::Obs: Freeze, <E as Env>::Info: Freeze,

§

impl<E> RefUnwindSafe for Step<E>
where <E as Env>::Act: RefUnwindSafe, <E as Env>::Obs: RefUnwindSafe, <E as Env>::Info: RefUnwindSafe,

§

impl<E> Send for Step<E>
where <E as Env>::Act: Send, <E as Env>::Obs: Send, <E as Env>::Info: Send,

§

impl<E> Sync for Step<E>
where <E as Env>::Act: Sync, <E as Env>::Obs: Sync, <E as Env>::Info: Sync,

§

impl<E> Unpin for Step<E>
where <E as Env>::Act: Unpin, <E as Env>::Obs: Unpin, <E as Env>::Info: Unpin,

§

impl<E> UnwindSafe for Step<E>
where <E as Env>::Act: UnwindSafe, <E as Env>::Obs: UnwindSafe, <E as Env>::Info: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V