Construct version 5.3.9
An agent based modeling framework
Location Class Reference

A model which allows agents to learn information based on their current location. More...

Inheritance diagram for Location:
Collaboration diagram for Location:

Public Member Functions

 Location (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 cleanup (void)
 Function called after the Model::communicate functions in a simulation cycle. More...
 
virtual float get_expertise (unsigned int agent, unsigned int location)
 
virtual const CommunicationMediumget_medium (unsigned int agent)
 
- 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 Nodesetagents = ns_manager->get_nodeset(nodeset_names::agents)
 
const Nodesetknowledge = ns_manager->get_nodeset(nodeset_names::knowledge)
 
const Nodesetlocations = ns_manager->get_nodeset(nodeset_names::loc)
 
const Graph< bool > & loc_adj = graph_manager->load_optional(graph_names::location_network, true, locations, sparse, locations, sparse)
 
Graph< bool > & current_loc = graph_manager->load_required(graph_names::current_loc, agents, locations)
 
const Graph< bool > & location_knowledge_net = graph_manager->load_optional(graph_names::loc_knowledge, true, locations, sparse, knowledge, sparse)
 
const Graph< float > & agent_location_learning_rate_net = graph_manager->load_optional(graph_names::loc_learning_rate, 1.0f, agents, sparse, locations, sparse)
 
const Graph< float > & knowledge_expertise = graph_manager->load_optional(graph_names::k_exp_wgt, 1.0f, agents, sparse, ns_manager->get_nodeset(nodeset_names::time), sparse)
 
const Graph< float > & location_preference = graph_manager->load_optional(graph_names::loc_preference, 1.0f, agents, sparse, locations, sparse)
 
const Graph< bool > & location_medium_access = graph_manager->load_optional(graph_names::loc_medium_access, true, locations, sparse, ns_manager->get_nodeset(nodeset_names::comm), sparse)
 
const Graph< bool > & knowledge_net = graph_manager->load_required(graph_names::knowledge, agents, knowledge)
 
const Graph< float > & knowledge_importance = graph_manager->load_optional(graph_names::interact_k_wgt, 1.0f, agents, sparse, knowledge, sparse)
 
const Graph< unsigned int > & loc_limit = graph_manager->load_optional(graph_names::loc_learning_limit, 1u, agents, sparse, locations, sparse)
 
const Graph< bool > & active = graph_manager->load_optional(graph_names::active, true, agents, sparse, ns_manager->get_nodeset(nodeset_names::time), sparse)
 
const Graph< float > & knowledge_priority_network = graph_manager->load_optional(graph_names::k_priority, 1.0f, agents, sparse, knowledge, sparse)
 
const Graph< bool > & comm_access = graph_manager->load_optional(graph_names::comm_access, true, agents, sparse, ns_manager->get_nodeset(nodeset_names::comm), sparse)
 
const Graph< float > & comm_medium_prefs = graph_manager->load_optional(graph_names::comm_pref, 1.0f, agents, sparse, ns_manager->get_nodeset(nodeset_names::comm), sparse)
 
std::vector< unsigned int > _current_agent_locations
 
std::vector< CommunicationMediumcommunication_mediums
 
Taskstasks = 0
 
- 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 model which allows agents to learn information based on their current location.

Member Function Documentation

◆ cleanup()

void Location::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:

◆ initialize()

void Location::initialize ( void  )
virtual

Function called once before any simulation cycles begin.

Reimplemented from Model.

Here is the call graph for this function:

◆ think()

void Location::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: