pub trait Simulator {
// Required methods
fn simulate(&self, state: &State, action: Action) -> (State, GameVars);
fn simulator_type(&self) -> SimulatorType;
fn get_initial_state(&self, state: State) -> State;
}
Expand description
Minimal interface for pluggable simulators used by MCTS.
Required Methods§
Sourcefn simulate(&self, state: &State, action: Action) -> (State, GameVars)
fn simulate(&self, state: &State, action: Action) -> (State, GameVars)
Simulate one step from state
with action
, returning the next state and game vars.
Sourcefn simulator_type(&self) -> SimulatorType
fn simulator_type(&self) -> SimulatorType
Whether this simulator works at the ground or abstract level.
Sourcefn get_initial_state(&self, state: State) -> State
fn get_initial_state(&self, state: State) -> State
Transform a ground state into the appropriate simulator’s initial state.
Trait Implementations§
Source§impl Simulator for Box<dyn Simulator>
impl Simulator for Box<dyn Simulator>
Source§fn simulate(&self, state: &State, action: Action) -> (State, GameVars)
fn simulate(&self, state: &State, action: Action) -> (State, GameVars)
Simulate one step from
state
with action
, returning the next state and game vars.Source§fn simulator_type(&self) -> SimulatorType
fn simulator_type(&self) -> SimulatorType
Whether this simulator works at the ground or abstract level.
Source§fn get_initial_state(&self, state: State) -> State
fn get_initial_state(&self, state: State) -> State
Transform a ground state into the appropriate simulator’s initial state.