Struct total_space::Model [−][src]
A complete model.
Implementations
impl<StateId: IndexLike, MessageId: IndexLike, InvalidId: IndexLike, ConfigurationId: IndexLike, Payload: DataLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES>
[src]
pub fn with_validator(
size: usize,
last_agent_type: Rc<dyn AgentType<StateId, Payload>>,
validator: Self::Validator
) -> Self
[src]
size: usize,
last_agent_type: Rc<dyn AgentType<StateId, Payload>>,
validator: Self::Validator
) -> Self
Create a new model, without computing anything yet, with a validation function.
pub fn new(
size: usize,
last_agent_type: Rc<dyn AgentType<StateId, Payload>>
) -> Self
[src]
size: usize,
last_agent_type: Rc<dyn AgentType<StateId, Payload>>
) -> Self
Create a new model, without a validation function.
This allows querying the model for the agent_index
of all the agents to use the results as
a target for messages.
impl<StateId: IndexLike, MessageId: IndexLike, InvalidId: IndexLike, ConfigurationId: IndexLike, Payload: DataLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES>
[src]
pub fn add_condition(
&mut self,
name: &'static str,
condition: Self::Condition,
help: &'static str
)
[src]
&mut self,
name: &'static str,
condition: Self::Condition,
help: &'static str
)
Add a named condition for defining paths through the configuration space.
pub fn agents_count(&self) -> usize
[src]
Return the total number of agents.
pub fn agent_label_index(&self, agent_label: &str) -> Option<usize>
[src]
Return the index of the agent with the specified label.
pub fn agent_instance(&self, agent_index: usize) -> usize
[src]
Return the index of the agent instance within its type.
pub fn agent_label(&self, agent_index: usize) -> &str
[src]
Return the label (short name) of an agent.
pub fn is_valid(&self) -> bool
[src]
Return whether all the reachable configurations are valid.
pub fn get_configuration(
&self,
configuration_id: ConfigurationId
) -> Self::Configuration
[src]
&self,
configuration_id: ConfigurationId
) -> Self::Configuration
Access a configuration by its identifier.
pub fn get_message(&self, message_id: MessageId) -> Self::Message
[src]
Access a message by its identifier.
impl<StateId: IndexLike, MessageId: IndexLike, InvalidId: IndexLike, ConfigurationId: IndexLike, Payload: DataLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES>
[src]
pub fn display_message_id(&self, message_id: MessageId) -> &str
[src]
Display a message by its identifier.
pub fn display_message(&self, message: &Self::Message) -> String
[src]
Display a message.
pub fn display_configuration_id(
&self,
configuration_id: ConfigurationId
) -> String
[src]
&self,
configuration_id: ConfigurationId
) -> String
Display a configuration by its identifier.
Trait Implementations
impl<StateId: IndexLike, MessageId: IndexLike, InvalidId: IndexLike, ConfigurationId: IndexLike, Payload: DataLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> ClapModel for Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES>
[src]
fn do_compute(&mut self, arg_matches: &ArgMatches<'_>)
[src]
fn do_clap_agents(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
[src]
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
fn do_clap_conditions(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
[src]
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
fn do_clap_compute(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
[src]
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
fn do_clap_configurations(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
[src]
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
fn do_clap_transitions(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
[src]
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
fn do_clap_path(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
[src]
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
fn do_clap_sequence(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
[src]
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
fn do_clap_states(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
[src]
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write
) -> bool
fn do_clap(&mut self, arg_matches: &ArgMatches<'_>, stdout: &mut dyn Write)
[src]
impl<StateId: IndexLike, MessageId: IndexLike, InvalidId: IndexLike, ConfigurationId: IndexLike, Payload: DataLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> MetaModel for Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES>
[src]
type StateId = StateId
The type of state identifiers.
type MessageId = MessageId
The type of message identifiers.
type InvalidId = InvalidId
The type of invalid condition identifiers.
type ConfigurationId = ConfigurationId
The type of configuration identifiers.
type Payload = Payload
The type of message payloads.
const MAX_AGENTS: usize
[src]
const MAX_MESSAGES: usize
[src]
type AgentTypeRc = Rc<dyn AgentType<StateId, Payload>>
The type of boxed agent type.
type Message = Message<Payload>
The type of in-flight messages.
type Reaction = Reaction<StateId, Payload>
The type of a event handling by an agent.
type Action = Action<StateId, Payload>
The type of an action from an agent.
type Emit = Emit<Payload>
The type of an emitted messages.
type Invalid = Invalid<MessageId>
The type of invalid conditions.
type Configuration = Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>
The type of the included configurations.
type ConfigurationHashEntry = (Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>, ConfigurationId)
The type of a hash table entry for the configurations (should be cache-friendly).
type Validator = fn(_: &Self, _: &Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>) -> Option<&'static str>
The type of a configuration validation function.
type Condition = fn(_: &Self, _: &Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>) -> bool
A condition on model configurations.
Auto Trait Implementations
impl<StateId, MessageId, InvalidId, ConfigurationId, Payload, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> !RefUnwindSafe for Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES>
impl<StateId, MessageId, InvalidId, ConfigurationId, Payload, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> !Send for Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES>
impl<StateId, MessageId, InvalidId, ConfigurationId, Payload, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> !Sync for Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES>
impl<StateId, MessageId, InvalidId, ConfigurationId, Payload, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> Unpin for Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES> where
ConfigurationId: Unpin,
InvalidId: Unpin,
MessageId: Unpin,
Payload: Unpin,
StateId: Unpin,
ConfigurationId: Unpin,
InvalidId: Unpin,
MessageId: Unpin,
Payload: Unpin,
StateId: Unpin,
impl<StateId, MessageId, InvalidId, ConfigurationId, Payload, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> !UnwindSafe for Model<StateId, MessageId, InvalidId, ConfigurationId, Payload, MAX_AGENTS, MAX_MESSAGES>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,