Construct version 5.4.3
An agent based modeling framework
Construct Class Reference

The API class that coordinates the transfer of information between classes. More...

Collaboration diagram for Construct:

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.
 

Public Attributes

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.
 
InteractionMessageQueue 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.2"
 

Detailed Description

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.

Member Function Documentation

◆ load_from_xml()

void Construct::load_from_xml ( const std::string &  fname)

Imports information from a Construct input xml file in to Construct

Parameters
fnameThe filename with either an absolute or relative path.

◆ run()

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.

Returns
True if the simulation was completed, false otherwise.

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.

Here is the call graph for this function:

Member Data Documentation

◆ verbose_initialization

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.

◆ verbose_runtime

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.