Construct version 5.4.4
An agent based modeling framework
|
The API class that coordinates the transfer of information between classes. More...
Public Member Functions | |
Construct () | |
Distributes pointers, prints the version number, records starting time, and sets dynet::end_early::stop = false. | |
void | load_from_xml (const std::string &fname) |
Imports information from a Construct input xml file in to Construct More... | |
bool | run () |
Runs the simulation. More... | |
bool | contains_parser (const std::string &name) |
Returns true if the named parser is contained in Construct::message_parsers, false otherwise. | |
void | addMessage (const InteractionMessage &msg) noexcept |
If the message is valid, its added to the front of the interaction_message_queue. | |
void | addMessage (InteractionMessage &&msg) noexcept |
If the message is valid, its added to the front of the interaction_message_queue. More... | |
bool | intercept (InteractionItem &item, unsigned int sender, unsigned int receiver, const CommunicationMedium *medium) |
Public Attributes | |
time_t | begTim = 0 |
Time set at construction. | |
time_t | loadtime = 0 |
time_t | simulation_start = 0 |
time_t | cycle_start = 0 |
time_t | cycle_end = 0 |
time_t | simulation_end = 0 |
Random | random |
The manager that produces random variables and ensures exact reproduction of results given a random seed. | |
NodesetManager | ns_manager |
The manager that holds all nodesets. | |
GraphManager | graph_manager |
The manager that holds all graphs/networks. | |
ModelManager | model_manager |
The manager that holds all the models and executes all of their various functions. | |
OutputManager | output_manager |
The manager that holds all outputs. | |
std::set< InteractionMessageParser * > | message_parsers |
Holds all parsers that parse messages before models. | |
std::list< InteractionMessage > | interaction_message_queue |
Messages in this queue are dispersed to the Model::communicate function and are cleared at the very end of a simulation cycle. | |
std::string | working_directory = "" |
Directory for output. | |
std::string | custom_library = "" |
File containing custom model and output library | |
unsigned int | current_time = 0 |
The current time period | |
unsigned int | time_count = 1 |
The size of the time nodeset and total number of time periods. Defaults to 1 when no time nodeset is found. | |
bool | verbose_initialization = false |
Set to true if a verbose initialization is requested. More... | |
bool | verbose_runtime = false |
Set to true if a verbose runtime is requested. More... | |
Static Public Attributes | |
static constexpr const char * | version = "5.4.4" |
static std::function< void(Construct &)> | constructor_output |
static std::function< void(Construct &)> | loading_complete_output |
static std::function< void(Construct &)> | simulation_start_output |
static std::function< void(Construct &)> | cycle_end_output |
static std::function< void(Construct &)> | simulation_complete_output |
The API class that coordinates the transfer of information between classes.
This class primarily deals with 5 class managers and runs the main sequence of the program execution. Through this class the managers can communicate and request information, typically pointers to data structures. This class also executes the main loop that progresses the simulation over time.
|
inlinenoexcept |
If the message is valid, its added to the front of the interaction_message_queue.
summary> Calls and ands each return from each loaded model's Model::intercept.
void Construct::load_from_xml | ( | const std::string & | fname | ) |
Imports information from a Construct input xml file in to Construct
fname | The filename with either an absolute or relative path. |
bool Construct::run | ( | ) |
Runs the simulation.
Begins the simulation cycle starting with initilaizing all models. All the contents of the simulation is contained in try catch statement. If any exceptions are raised, they are printed and this function will return false. Otherwise if the simulation completes, true is returned.
Exception Safety
This function can only be called once. An assertion is raised if the function is called a second time on the same Construct instance.
|
static |
|
static |
|
static |
|
static |
time_t Construct::simulation_end = 0 |
summary>
|
static |
bool Construct::verbose_initialization = false |
Set to true if a verbose initialization is requested.
In general a verbose initialization increases the amount of information the end user receives when initializing the simulation.
bool Construct::verbose_runtime = false |
Set to true if a verbose runtime is requested.
In general a verbose runtime increases the amount of information the end user receives when during run time. This includes readouts when the simulation executes model functions such as think and cleanup.