Trait total_space::AgentState[][src]

pub trait AgentState<State: DataLike, Payload: DataLike> {
    fn reaction(
        &self,
        instance: usize,
        payload: &Payload
    ) -> Reaction<State, Payload>; fn activity(&self, _instance: usize) -> Activity<Payload> { ... }
fn is_deferring(&self, _instance: usize) -> bool { ... }
fn invalid_because(&self, _instance: usize) -> Option<&'static str> { ... }
fn max_in_flight_messages(&self, _instance: usize) -> Option<usize> { ... } }

A trait for a single agent state.

Required methods

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

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

Loading content...

Provided methods

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

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

fn is_deferring(&self, _instance: usize) -> bool[src]

Whether any agent in this state is deferring messages.

fn invalid_because(&self, _instance: usize) -> Option<&'static str>[src]

If this object is invalid, return why.

fn max_in_flight_messages(&self, _instance: usize) -> Option<usize>[src]

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

Loading content...

Implementors

Loading content...