Skip to main content

ForwardModel

Trait ForwardModel 

Source
pub trait ForwardModel {
    type State: Clone;
    type Action: Clone;

    // Required method
    fn step<R: Rng + ?Sized>(
        &mut self,
        state: &Self::State,
        action: &Self::Action,
        rng: &mut R,
    ) -> Step<Self::State>;
}
Expand description

A forward model: what happens when an action is taken in a state.

Stochastic models draw from rng; Config::rollouts averages several samples.

Required Associated Types§

Source

type State: Clone

The world state.

Source

type Action: Clone

An action.

Required Methods§

Source

fn step<R: Rng + ?Sized>( &mut self, state: &Self::State, action: &Self::Action, rng: &mut R, ) -> Step<Self::State>

Simulates one step from state under action.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§