Trait stateright::Chooser

source ·
pub trait Chooser<M: Model>: Send + Clone + 'static {
    type State;

    // Required methods
    fn new_state(&self, seed: u64) -> Self::State;
    fn choose_initial_state(
        &self,
        state: &mut Self::State,
        initial_states: &[M::State]
    ) -> usize;
    fn choose_action(
        &self,
        state: &mut Self::State,
        current_state: &M::State,
        actions: &[M::Action]
    ) -> usize;
}
Expand description

Choose transitions in the model.

Created once for each thread.

Required Associated Types§

source

type State

State of the chooser during a run.

Required Methods§

source

fn new_state(&self, seed: u64) -> Self::State

Create a new chooser state from this seed for the run.

source

fn choose_initial_state( &self, state: &mut Self::State, initial_states: &[M::State] ) -> usize

Choose the initial state for this simulation run.

source

fn choose_action( &self, state: &mut Self::State, current_state: &M::State, actions: &[M::Action] ) -> usize

Choose the next action to take from the current state.

Implementors§

source§

impl<M> Chooser<M> for UniformChooserwhere M: Model,

§

type State = UniformChooserState