pub struct Model<StateId: IndexLike, MessageId: IndexLike, InvalidId: IndexLike, ConfigurationId: IndexLike, Payload: DataLike, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> { /* private fields */ }
Expand description
A complete model.
Implementations§
Source§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>
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>
Source§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>
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>
Sourcepub fn add_condition(
&mut self,
name: &'static str,
condition: <Self as MetaModel>::Condition,
help: &'static str,
)
pub fn add_condition( &mut self, name: &'static str, condition: <Self as MetaModel>::Condition, help: &'static str, )
Add a named condition for defining paths through the configuration space.
Sourcepub fn agents_count(&self) -> usize
pub fn agents_count(&self) -> usize
Return the total number of agents.
Sourcepub fn agent_label_index(&self, agent_label: &str) -> Option<usize>
pub fn agent_label_index(&self, agent_label: &str) -> Option<usize>
Return the index of the agent with the specified label.
Sourcepub fn agent_instance(&self, agent_index: usize) -> usize
pub fn agent_instance(&self, agent_index: usize) -> usize
Return the index of the agent instance within its type.
Sourcepub fn agent_label(&self, agent_index: usize) -> &str
pub fn agent_label(&self, agent_index: usize) -> &str
Return the label (short name) of an agent.
Sourcepub fn get_configuration(
&self,
configuration_id: ConfigurationId,
) -> <Self as MetaModel>::Configuration
pub fn get_configuration( &self, configuration_id: ConfigurationId, ) -> <Self as MetaModel>::Configuration
Access a configuration by its identifier.
Sourcepub fn get_message(&self, message_id: MessageId) -> <Self as MetaModel>::Message
pub fn get_message(&self, message_id: MessageId) -> <Self as MetaModel>::Message
Access a message by its identifier.
Source§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>
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>
Sourcepub fn display_message_id(&self, message_id: MessageId) -> &str
pub fn display_message_id(&self, message_id: MessageId) -> &str
Display a message by its identifier.
Sourcepub fn display_message(&self, message: &<Self as MetaModel>::Message) -> String
pub fn display_message(&self, message: &<Self as MetaModel>::Message) -> String
Display a message.
Sourcepub fn display_configuration_id(
&self,
configuration_id: ConfigurationId,
) -> String
pub fn display_configuration_id( &self, configuration_id: ConfigurationId, ) -> String
Display a configuration by its identifier.
Trait Implementations§
Source§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>
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>
Source§fn do_compute(&mut self, arg_matches: &ArgMatches<'_>)
fn do_compute(&mut self, arg_matches: &ArgMatches<'_>)
Compute the model.
Source§fn do_clap_agents(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write,
) -> bool
fn do_clap_agents( &mut self, arg_matches: &ArgMatches<'_>, stdout: &mut dyn Write, ) -> bool
Execute the
agents
clap subcommand, if requested to. Read moreSource§fn do_clap_conditions(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write,
) -> bool
fn do_clap_conditions( &mut self, arg_matches: &ArgMatches<'_>, stdout: &mut dyn Write, ) -> bool
Execute the
conditions
clap subcommand, if requested to. Read moreSource§fn do_clap_compute(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write,
) -> bool
fn do_clap_compute( &mut self, arg_matches: &ArgMatches<'_>, stdout: &mut dyn Write, ) -> bool
Only compute the model (no output).
Source§fn do_clap_configurations(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write,
) -> bool
fn do_clap_configurations( &mut self, arg_matches: &ArgMatches<'_>, stdout: &mut dyn Write, ) -> bool
Execute the
configurations
clap subcommand, if requested to. Read moreSource§fn do_clap_transitions(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write,
) -> bool
fn do_clap_transitions( &mut self, arg_matches: &ArgMatches<'_>, stdout: &mut dyn Write, ) -> bool
Execute the
transitions
clap subcommand, if requested to. Read moreSource§fn do_clap_path(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write,
) -> bool
fn do_clap_path( &mut self, arg_matches: &ArgMatches<'_>, stdout: &mut dyn Write, ) -> bool
Execute the
path
clap subcommand, if requested to.Source§fn do_clap_sequence(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write,
) -> bool
fn do_clap_sequence( &mut self, arg_matches: &ArgMatches<'_>, stdout: &mut dyn Write, ) -> bool
Execute the
sequence
clap subcommand, if requested to.Source§fn do_clap_states(
&mut self,
arg_matches: &ArgMatches<'_>,
stdout: &mut dyn Write,
) -> bool
fn do_clap_states( &mut self, arg_matches: &ArgMatches<'_>, stdout: &mut dyn Write, ) -> bool
Execute the
states
clap subcommand, if requested to.Source§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>
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>
Source§const MAX_AGENTS: usize = MAX_AGENTS
const MAX_AGENTS: usize = MAX_AGENTS
The maximal number of agents.
Source§const MAX_MESSAGES: usize = MAX_MESSAGES
const MAX_MESSAGES: usize = MAX_MESSAGES
The maximal number of in-flight messages.
Source§type ConfigurationId = ConfigurationId
type ConfigurationId = ConfigurationId
The type of configuration identifiers.
Source§type AgentTypeRc = Rc<dyn AgentType<StateId, Payload>>
type AgentTypeRc = Rc<dyn AgentType<StateId, Payload>>
The type of boxed agent type.
Source§type Configuration = Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>
type Configuration = Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>
The type of the included configurations.
Source§type ConfigurationHashEntry = (Configuration<StateId, MessageId, InvalidId, MAX_AGENTS, MAX_MESSAGES>, ConfigurationId)
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).
Auto Trait Implementations§
impl<StateId, MessageId, InvalidId, ConfigurationId, Payload, const MAX_AGENTS: usize, const MAX_MESSAGES: usize> !Freeze 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> !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>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more