Skip to main content

ExecutorState

Trait ExecutorState 

Source
pub trait ExecutorState<D: Domain> {
    // Provided methods
    fn create_state_value_estimator(
        &self,
    ) -> Box<dyn StateValueEstimator<D> + Send> { ... }
    fn post_action_execute_hook(
        &mut self,
        _state: &D::State,
        _diff: &D::Diff,
        _active_task: &ActiveTask<D>,
        _queue: &mut ActiveTasks<D>,
    ) { ... }
    fn post_mcts_run_hook(
        &mut self,
        _mcts: &MCTS<D>,
        _last_active_task: &ActiveTask<D>,
    ) { ... }
}
Expand description

User-defined methods for the executor.

If you have no special need, you can just implement this trait on an empty struct:

struct MyExecutorState;
impl ExecutorState<MyDomain> for MyExecutorState {}

Provided Methods§

Source

fn create_state_value_estimator(&self) -> Box<dyn StateValueEstimator<D> + Send>

Creates the state value estimator (by default uses rollout-based simulation).

Source

fn post_action_execute_hook( &mut self, _state: &D::State, _diff: &D::Diff, _active_task: &ActiveTask<D>, _queue: &mut ActiveTasks<D>, )

Method called after action execution, to perform tasks such as visual updates and checking for newly-created agents (by default does nothing).

Source

fn post_mcts_run_hook( &mut self, _mcts: &MCTS<D>, _last_active_task: &ActiveTask<D>, )

Method called after MCTS has run, to perform tasks such as printing the search tree (by default does nothing).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§