Trait GlobalDomain

Source
pub trait GlobalDomain: Domain {
    type GlobalState: Debug + Sized + 'static;

    // Required methods
    fn derive_local_state(
        global_state: &Self::GlobalState,
        agent: AgentId,
    ) -> Self::State;
    fn apply(
        global_state: &mut Self::GlobalState,
        local_state: &Self::State,
        diff: &Self::Diff,
    );
}
Expand description

A domain that provides a global state, out of which a local state for the planning can be derived.

Required Associated Types§

Source

type GlobalState: Debug + Sized + 'static

Global state: all data that can change in the course of the simulation.

Required Methods§

Source

fn derive_local_state( global_state: &Self::GlobalState, agent: AgentId, ) -> Self::State

Derives a new local state for the given agent from the given global state.

Source

fn apply( global_state: &mut Self::GlobalState, local_state: &Self::State, diff: &Self::Diff, )

Applies a diff from a local state to the global state.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§