Construct version 5.3.9
An agent based modeling framework
Subscription Struct Reference

A modification model that forwards messages that are made public to subscribers. More...

Inheritance diagram for Subscription:
Collaboration diagram for Subscription:

Public Member Functions

 Subscription (Construct *_construct)
 
void think ()
 First function called in a simulation cycle. More...
 
void communicate (InteractionMessageQueue::iterator msg)
 Function called after the update functions in a simulation cycle. More...
 
void cleanup ()
 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...
 

Public Attributes

const Graph< float > & public_propensity
 
Graph< bool > & subscriptions
 
const Graph< float > & sub_prob
 
InteractionMessageQueue public_queue
 
- 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

A modification model that forwards messages that are made public to subscribers.

Member Function Documentation

◆ cleanup()

void Subscription::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.

Here is the call graph for this function:

◆ communicate()

void Subscription::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.

Here is the call graph for this function:

◆ think()

void Subscription::think ( void  )
virtual

First function called in a simulation cycle.

Messages are typically created in this function.

Reimplemented from Model.

Here is the call graph for this function:

Member Data Documentation

◆ public_propensity

const Graph<float>& Subscription::public_propensity
Initial value:
= graph_manager->load_optional(graph_names::propensity,
0.01f, nodeset_names::agents, sparse, nodeset_names::comm, sparse)
Graph_Intermediary load_optional(const std::string &name, const Nodeset *src, const Nodeset *trg, const Nodeset *slc=nullptr) const
Finds a Graph if its loaded and returns it via a proxy class.
Definition: GraphManager.cpp:896

◆ sub_prob

const Graph<float>& Subscription::sub_prob
Initial value:
= graph_manager->load_optional(graph_names::sub_probability,
0.01f, nodeset_names::agents, sparse, nodeset_names::agents, sparse)

◆ subscriptions

Graph<bool>& Subscription::subscriptions
Initial value:
= graph_manager->load_optional(graph_names::subs,
false, nodeset_names::agents, sparse, nodeset_names::agents, sparse)