Construct version 5.4.4
An agent based modeling framework
|
Template for building new Construct models. More...
Public Member Functions | |
Template (dynet::ParameterMap parameters, Construct &construct) | |
void | initialize (void) override |
Function called once before any simulation cycles begin. More... | |
void | think (void) override |
First function called in a simulation cycle. More... | |
void | update (void) override |
Function called after the think functions in a simulation cycle. More... | |
void | communicate (const InteractionMessage &msg) override |
Function called after the update functions in a simulation cycle. More... | |
void | cleanup (void) override |
Function called after the Model::communicate functions in a simulation cycle. More... | |
Public Member Functions inherited from Model | |
Model (Construct &_construct) | |
Constructor for all models in Construct. More... | |
virtual | ~Model (void) |
Virtual Deconstructor. More... | |
virtual void | initialize (void) |
Function called once before any simulation cycles begin. More... | |
virtual void | think (void) |
First function called in a simulation cycle. More... | |
virtual void | update (void) |
Function called after the think functions in a simulation cycle. More... | |
virtual bool | intercept (InteractionItem &item, unsigned int sender, unsigned int receiver, const CommunicationMedium *medium) |
Allows for models to effect change to items created by other models. More... | |
virtual void | communicate (const InteractionMessage &msg) |
Function called after the update functions in a simulation cycle. More... | |
virtual void | cleanup (void) |
Function called after the Model::communicate functions in a simulation cycle. More... | |
void | add_base_model_to_model_manager (const std::string &base_model_name) |
Adds a derived model under the name of the base model and disables the model manager from calling its functions. | |
Additional Inherited Members | |
Public Attributes inherited from Model | |
Construct & | construct |
GraphManager & | graph_manager |
NodesetManager & | ns_manager |
Random & | random |
bool | valid |
If member is false, the model's functions are not called. | |
Template for building new Construct models.
This model provides the bare bones necessities for building a new model. Simply copy and rename this header and cpp file, rename the flag TEMPLATE_MODEL_HH_H at the top of the header file, and rename the class. Additionally be sure to change the string being passed to the Model constructor to your model's name.
|
overridevirtual |
Function called after the Model::communicate functions in a simulation cycle.
End of cycle calculations are done during this function. Model::cleanup is called after GraphManager::push_deltas is called.
Reimplemented from Model.
|
overridevirtual |
|
overridevirtual |
Function called once before any simulation cycles begin.
Reimplemented from Model.
|
overridevirtual |
First function called in a simulation cycle.
Messages are typically created in this function.
Reimplemented from Model.