Construct version 5.3.9
An agent based modeling framework
Template Class Reference

Template for building new Construct models. More...

Inheritance diagram for Template:
Collaboration diagram for Template:

Public Member Functions

 Template (dynet::ParameterMap parameters, Construct *construct)
 
void initialize (void)
 Function called once before any simulation cycles begin. More...
 
void think (void)
 First function called in a simulation cycle. More...
 
void update (void)
 Function called after the think functions in a simulation cycle. More...
 
void communicate (InteractionMessageQueue::iterator msg)
 Function called after the update functions in a simulation cycle. More...
 
void cleanup (void)
 Function called after the Model::communicate functions in a simulation cycle. More...
 
- Public Member Functions inherited from Model
 Model (Construct *_construct, const std::string &name)
 Constructor for all models in Construct. More...
 
 Model (const std::string &name)
 Constructor for the PlaceHolder model. 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 void communicate (InteractionMessageQueue::iterator 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...
 

Additional Inherited Members

- Public Attributes inherited from Model
Construct *const construct
 
GraphManager *const graph_manager
 
NodesetManager *const ns_manager
 
Random *const random
 
const std::string name
 Name of the model. Set by the Model constructor.
 
bool valid
 If member is false, the model's functions are not called.
 

Detailed Description

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.

Member Function Documentation

◆ cleanup()

void Template::cleanup ( void  )
virtual

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.

◆ communicate()

void Template::communicate ( InteractionMessageQueue::iterator  msg)
virtual

Function called after the update functions in a simulation cycle.

Messages are typically parsed in this function.

Reimplemented from Model.

◆ initialize()

void Template::initialize ( void  )
virtual

Function called once before any simulation cycles begin.

Reimplemented from Model.

◆ think()

void Template::think ( void  )
virtual

First function called in a simulation cycle.

Messages are typically created in this function.

Reimplemented from Model.

◆ update()

void Template::update ( void  )
virtual

Function called after the think functions in a simulation cycle.

Messages are typically amended and/or removed in this function.

Reimplemented from Model.