Trait total_space::AgentType[][src]

pub trait AgentType<StateId: IndexLike, Payload: DataLike>: AgentInstances<StateId, Payload> {
    fn reaction(
        &self,
        instance: usize,
        state_ids: &[StateId],
        payload: &Payload
    ) -> Reaction<StateId, Payload>;
fn activity(
        &self,
        instance: usize,
        state_ids: &[StateId]
    ) -> Activity<Payload>;
fn state_is_deferring(&self, instance: usize, state_ids: &[StateId]) -> bool;
fn state_invalid_because(
        &self,
        instance: usize,
        state_ids: &[StateId]
    ) -> Option<&'static str>;
fn state_max_in_flight_messages(
        &self,
        instance: usize,
        state_ids: &[StateId]
    ) -> Option<usize>;
fn states_count(&self) -> usize;
fn compute_terse(&self); }

A trait fully describing some agent instances of the same type.

Required methods

fn reaction(
    &self,
    instance: usize,
    state_ids: &[StateId],
    payload: &Payload
) -> Reaction<StateId, Payload>
[src]

Return the actions that may be taken by an agent instance with some state when receiving a payload.

fn activity(&self, instance: usize, state_ids: &[StateId]) -> Activity<Payload>[src]

Return the actions that may be taken by an agent with some state when time passes.

fn state_is_deferring(&self, instance: usize, state_ids: &[StateId]) -> bool[src]

Whether any agent in the state is deferring messages.

fn state_invalid_because(
    &self,
    instance: usize,
    state_ids: &[StateId]
) -> Option<&'static str>
[src]

Return a reason that a state is invalid (unless it is valid).

fn state_max_in_flight_messages(
    &self,
    instance: usize,
    state_ids: &[StateId]
) -> Option<usize>
[src]

The maximal number of messages sent by an agent which may be in-flight when it is in the state.

fn states_count(&self) -> usize[src]

The total number of states seen so far.

fn compute_terse(&self)[src]

Compute mapping from full states to terse states (name only).

Loading content...

Implementors

impl<State: DataLike + AgentState<State, Payload>, StateId: IndexLike, Payload: DataLike> AgentType<StateId, Payload> for AgentTypeData<State, StateId, Payload>[src]

impl<State: DataLike + ContainerOf1State<State, Part, Payload>, Part: DataLike + AgentState<Part, Payload>, StateId: IndexLike, Payload: DataLike, const MAX_PARTS: usize> AgentType<StateId, Payload> for ContainerOf1TypeData<State, Part, StateId, Payload, MAX_PARTS>[src]

impl<State: DataLike + ContainerOf2State<State, Part1, Part2, Payload>, Part1: DataLike + AgentState<Part1, Payload>, Part2: DataLike + AgentState<Part2, Payload>, StateId: IndexLike, Payload: DataLike, const MAX_PARTS: usize> AgentType<StateId, Payload> for ContainerOf2TypeData<State, Part1, Part2, StateId, Payload, MAX_PARTS>[src]

Loading content...