Struct border_core::Step

source ·
pub struct Step<E: Env> {
    pub act: E::Act,
    pub obs: E::Obs,
    pub reward: Vec<f32>,
    pub is_done: 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).

Old versions of the library support veectorized environments, which requires elements in Step to be able to handle multiple values. This is why reward and is_done are vector.

Fields§

§act: E::Act

Action.

§obs: E::Obs

Observation.

§reward: Vec<f32>

Reward.

§is_done: Vec<i8>

Flag denoting if episode is done.

§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_done: Vec<i8>, info: E::Info, init_obs: E::Obs ) -> Self

Constructs a Step object.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V