Trait total_space::AgentInstances[][src]

pub trait AgentInstances<StateId: IndexLike, Payload: DataLike>: Name {
    fn prev_agent_type(&self) -> Option<Rc<dyn AgentType<StateId, Payload>>>;
fn first_index(&self) -> usize;
fn next_index(&self) -> usize;
fn is_singleton(&self) -> bool;
fn instances_count(&self) -> usize;
fn instance_order(&self, instance: usize) -> usize;
fn display_state(&self, state_id: StateId) -> Rc<String>;
fn terse_id(&self, state_id: StateId) -> StateId;
fn display_terse(&self, name_id: StateId) -> String; }

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

Required methods

fn prev_agent_type(&self) -> Option<Rc<dyn AgentType<StateId, Payload>>>[src]

Return the previous agent type in the chain, if any.

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

The index of the first agent of this type.

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

The next index after the last agent of this type.

fn is_singleton(&self) -> bool[src]

Whether this type only has a single instance.

If true, the count will always be 1.

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

The number of agents of this type that will be used in the system.

fn instance_order(&self, instance: usize) -> usize[src]

The order of the agent (for sequence diagrams).

fn display_state(&self, state_id: StateId) -> Rc<String>[src]

Display the state.

The format of the display must be either <state-name> if the state is a simple enum, or <state-name>(<state-data>) if the state contains additional data. The Debug of the state might be acceptable as-is, but typically it is better to get rid or shorten the explicit field names, and/or format their values in a more compact form.

fn terse_id(&self, state_id: StateId) -> StateId[src]

Convert the full state identifier to the terse state identifier.

fn display_terse(&self, name_id: StateId) -> String[src]

Return the name of the terse state (just the state name).

Loading content...

Implementors

impl<State: DataLike + ContainerOf1State<State, Part, Payload>, Part: DataLike + AgentState<Part, Payload>, StateId: IndexLike, Payload: DataLike, const MAX_PARTS: usize> AgentInstances<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> AgentInstances<StateId, Payload> for ContainerOf2TypeData<State, Part1, Part2, StateId, Payload, MAX_PARTS>[src]

impl<State: DataLike, StateId: IndexLike, Payload: DataLike> AgentInstances<StateId, Payload> for AgentTypeData<State, StateId, Payload>[src]

Loading content...