Construct version 5.3.9
An agent based modeling framework
KnowledgeTrust Class Reference

Model that updates the trust in peices of knowledge. More...

Inheritance diagram for KnowledgeTrust:
Collaboration diagram for KnowledgeTrust:

Public Member Functions

 KnowledgeTrust (const dynet::ParameterMap &parameters, Construct *construct)
 Loads the networks and parses parameters. More...
 
void initialize (void)
 Moves the model to the front of the model list to ensure this model's communicate function is called first. More...
 
void update (void)
 Add knowledge trust to knowledge items in messages if they do not already include them. More...
 
void communicate (InteractionMessageQueue::iterator msg)
 Parses a message for knowledge trust and adds them to the relevant agent's transactive memory. More...
 
void cleanup (void)
 Updates each agent's knowledge trust based on the agent's transactive memory. 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

float rr
 The rate at which trusts can change.
 
const Graph< bool > & knowledge_net = graph_manager->load_required(graph_names::knowledge, nodeset_names::agents, nodeset_names::knowledge)
 Pointer to the graph with name "knowledge network".
 
Graph< float > & knowledge_trust_net
 Pointer to the graph with name "knowledge trust network". More...
 
Graph< std::map< unsigned int, float > > & kttm
 Pointer to the graph with name "knowledge trust transactive memory network". More...
 
- 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

Model that updates the trust in peices of knowledge.

Constructor & Destructor Documentation

◆ KnowledgeTrust()

KnowledgeTrust::KnowledgeTrust ( const dynet::ParameterMap parameters,
Construct construct 
)

Loads the networks and parses parameters.

If the trust and/or kttm networks were already loaded, for every element in the knowledge network that is false, the associated elements in the knowledge trust network are set to 0.5 and in the knowledge trust transactive memory network are removed.

Additionally, this model checks that the "agent" nodeset has attributes "can send knowledge trust" and "can receiver knowledge trust".

Here is the call graph for this function:

Member Function Documentation

◆ cleanup()

void KnowledgeTrust::cleanup ( void  )
virtual

Updates each agent's knowledge trust based on the agent's transactive memory.

Reimplemented from Model.

Here is the call graph for this function:

◆ communicate()

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

Parses a message for knowledge trust and adds them to the relevant agent's transactive memory.

Reimplemented from Model.

Here is the call graph for this function:

◆ initialize()

void KnowledgeTrust::initialize ( void  )
virtual

Moves the model to the front of the model list to ensure this model's communicate function is called first.

Reimplemented from Model.

Here is the call graph for this function:

◆ update()

void KnowledgeTrust::update ( void  )
virtual

Add knowledge trust to knowledge items in messages if they do not already include them.

Reimplemented from Model.

Here is the call graph for this function:

Member Data Documentation

◆ knowledge_trust_net

Graph<float>& KnowledgeTrust::knowledge_trust_net
Initial value:
= graph_manager->load_optional(graph_names::k_trust, 0.5f,
nodeset_names::agents, knowledge_net.row_dense, nodeset_names::knowledge, knowledge_net.col_dense)
const bool col_dense
True if the column representation is dense, false if the representation is sparse.
Definition: Graph.h:1095
const bool row_dense
True if the row representation is dense, false if the representation is sparse.
Definition: Graph.h:1101
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
const Graph< bool > & knowledge_net
Pointer to the graph with name "knowledge network".
Definition: KnowledgeTrust.h:24

Pointer to the graph with name "knowledge trust network".

◆ kttm

Graph<std::map<unsigned int, float> >& KnowledgeTrust::kttm
Initial value:
= graph_manager->load_optional(graph_names::kttm, std::map<unsigned int, float>(),
nodeset_names::agents, dense, nodeset_names::agents, sparse, nodeset_names::knowledge)

Pointer to the graph with name "knowledge trust transactive memory network".