[][src]Struct rsrl_domains::Transition

pub struct Transition<S, A> {
    pub from: Observation<S>,
    pub action: A,
    pub reward: Reward,
    pub to: Observation<S>,
}

Container class for data associated with a domain transition.

Fields

from: Observation<S>

State transitioned from, s.

action: A

Action taken to initiate the transition (control tasks).

reward: Reward

Reward obtained from the transition.

to: Observation<S>

State transitioned to, s'.

Implementations

impl<S, A> Transition<S, A>[src]

pub fn states(&self) -> (&S, &S)[src]

Return references to the from and to states associated with this transition.

pub fn borrowed(&self) -> Transition<&S, &A>[src]

pub fn map_states<O>(self, f: impl Fn(&S) -> O) -> Transition<O, A>[src]

Apply a closure to the from and to states associated with this transition.

pub fn terminated(&self) -> bool[src]

Returns true if the transition ends in a terminal state.

pub fn replace_action<T>(self, action: T) -> Transition<S, T>[src]

Replace the action associated with this transition and return a new instance.

pub fn drop_action(self) -> Transition<S, ()>[src]

Drop the action associated with this transition and return a new instance.

pub fn negate_reward(self) -> Transition<S, A>[src]

Trait Implementations

impl<S: Clone, A: Clone> Clone for Transition<S, A>[src]

impl<S: Copy, A: Copy> Copy for Transition<S, A>[src]

impl<S: Debug, A: Debug> Debug for Transition<S, A>[src]

impl<'s, 'a, S, A> FromIterator<Transition<&'s S, &'a A>> for Vec<Transition<S, A>>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, u8>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, u16>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, f32>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, f64>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, u32>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, u64>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, usize>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, i8>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, i16>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, i32>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, i64>[src]

impl<S> Into<Transition<S, ()>> for Transition<S, isize>[src]

Auto Trait Implementations

impl<S, A> RefUnwindSafe for Transition<S, A> where
    A: RefUnwindSafe,
    S: RefUnwindSafe

impl<S, A> Send for Transition<S, A> where
    A: Send,
    S: Send

impl<S, A> Sync for Transition<S, A> where
    A: Sync,
    S: Sync

impl<S, A> Unpin for Transition<S, A> where
    A: Unpin,
    S: Unpin

impl<S, A> UnwindSafe for Transition<S, A> where
    A: UnwindSafe,
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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