Trait ExecutorStateLocal

Source
pub trait ExecutorStateLocal<D: Domain> {
    // Required methods
    fn create_initial_state(&self) -> D::State;
    fn init_task_queue(&self, state: &D::State) -> ActiveTasks<D>;

    // Provided method
    fn keep_agent(&self, _tick: u64, _state: &D::State, _agent: AgentId) -> bool { ... }
}
Expand description

User-defined methods for the executor, where world and planner states are similar.

This trait is used with the SimpleExecutor. You must implement at least create_initial_state and init_task_queue, to create the initial state and build the initial list of tasks from it.

Required Methods§

Source

fn create_initial_state(&self) -> D::State

Creates the initial world state.

Source

fn init_task_queue(&self, state: &D::State) -> ActiveTasks<D>

Fills the initial queue of tasks.

Provided Methods§

Source

fn keep_agent(&self, _tick: u64, _state: &D::State, _agent: AgentId) -> bool

Returns whether an agent should be kept in a given state (to remove dead agents) (by default returns true).

Implementors§