Construct version 5.4.4
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) override
 
void think (void) override
 
void cleanup (void) override
 
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)
 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.
 

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)
 
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
Constructconstruct
 
GraphManagergraph_manager
 
NodesetManagerns_manager
 
Randomrandom
 
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.

Constructor & Destructor Documentation

◆ Location()

Location::Location ( Construct construct)

summary>

Here is the call graph for this function:

Member Function Documentation

◆ cleanup()

void Location::cleanup ( void  )
overridevirtual

summary>

Reimplemented from Model.

Here is the call graph for this function:

◆ get_expertise()

float Location::get_expertise ( unsigned int  agent,
unsigned int  location 
)
virtual

summary>

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

void Location::initialize ( void  )
overridevirtual

summary>

Reimplemented from Model.

Here is the call graph for this function:

◆ think()

void Location::think ( void  )
overridevirtual

summary>

Reimplemented from Model.

Here is the call graph for this function:

Member Data Documentation

◆ _current_agent_locations

std::vector<unsigned int> Location::_current_agent_locations

summary>

◆ active

const Graph<bool>& Location::active = graph_manager.load_optional(graph_names::active, true, agents, sparse, ns_manager.get_nodeset(nodeset_names::time), sparse)

summary>

◆ agent_location_learning_rate_net

const Graph<float>& Location::agent_location_learning_rate_net = graph_manager.load_optional(graph_names::loc_learning_rate, 1.0f, agents, sparse, locations, sparse)

summary>

◆ agents

const Nodeset& Location::agents = ns_manager.get_nodeset(nodeset_names::agents)

summary>

◆ comm_access

const Graph<bool>& Location::comm_access = graph_manager.load_optional(graph_names::comm_access, true, agents, sparse, ns_manager.get_nodeset(nodeset_names::comm), sparse)

summary>

◆ communication_mediums

std::vector<CommunicationMedium> Location::communication_mediums

summary>

◆ current_loc

Graph<bool>& Location::current_loc = graph_manager.load_required(graph_names::current_loc, agents, locations)

summary>

◆ knowledge

const Nodeset& Location::knowledge = ns_manager.get_nodeset(nodeset_names::knowledge)

summary>

◆ knowledge_expertise

const Graph<float>& Location::knowledge_expertise = graph_manager.load_optional(graph_names::k_exp_wgt, 1.0f, agents, sparse, ns_manager.get_nodeset(nodeset_names::time), sparse)

summary>

◆ knowledge_importance

const Graph<float>& Location::knowledge_importance = graph_manager.load_optional(graph_names::interact_k_wgt, 1.0f, agents, sparse, knowledge, sparse)

summary>

◆ knowledge_net

Graph<bool>& Location::knowledge_net = graph_manager.load_required(graph_names::knowledge, agents, knowledge)

summary>

◆ knowledge_priority_network

const Graph<float>& Location::knowledge_priority_network = graph_manager.load_optional(graph_names::k_priority, 1.0f, agents, sparse, knowledge, sparse)

summary>

◆ loc_adj

const Graph<bool>& Location::loc_adj = graph_manager.load_optional(graph_names::location_network, true, locations, sparse, locations, sparse)

summary>

◆ loc_limit

const Graph<unsigned int>& Location::loc_limit = graph_manager.load_optional(graph_names::loc_learning_limit, 1u, agents, sparse, locations, sparse)

summary>

◆ location_knowledge_net

const Graph<bool>& Location::location_knowledge_net = graph_manager.load_optional(graph_names::loc_knowledge, true, locations, sparse, knowledge, sparse)

summary>

◆ location_medium_access

const Graph<bool>& Location::location_medium_access = graph_manager.load_optional(graph_names::loc_medium_access, true, locations, sparse, ns_manager.get_nodeset(nodeset_names::comm), sparse)

summary>

◆ location_preference

const Graph<float>& Location::location_preference = graph_manager.load_optional(graph_names::loc_preference, 1.0f, agents, sparse, locations, sparse)

summary>

◆ locations

const Nodeset& Location::locations = ns_manager.get_nodeset(nodeset_names::loc)

summary>

◆ tasks

Tasks* Location::tasks = 0

summary>