Construct version 5.4.3
An agent based modeling framework
Trust Struct Reference

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

Inheritance diagram for Trust:
Collaboration diagram for Trust:

Public Member Functions

 Trust (const dynet::ParameterMap &parameters, Construct &construct)
 Requires the knowledge network be already loaded, and requires various agent node attributes. More...
 
void initialize (void) override
 Moves the model to the front of the model list to ensure this model's communicate function is called first. More...
 
void update (void) override
 Add knowledge trust to knowledge items in messages if they do not already include them. More...
 
void communicate (const InteractionMessage &msg) override
 Parses a message for knowledge trust and adds them to the relevant agent's transactive memory and updates the reader's trust in the sender. More...
 
void cleanup (void) override
 Updates each agent's knowledge trust based on the agent's transactive memory and their trust of their alters. More...
 
- 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 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 Graph< bool > & knowledge_net = graph_manager.load_required(graph_names::knowledge, nodeset_names::agents, nodeset_names::knowledge)
 Graph with name "knowledge network" that contains the knowledge bits that each agent knows.
 
Graph< float > & knowledge_trust_net
 Graph with name "knowledge trust network" that contains the true trust an agent has for a peice of knowledge being true. More...
 
Graph< std::map< unsigned int, float > > & kttm
 Graph with name "knowledge trust transactive memory network" that contains what each agent thinks another's knowledge trust is. More...
 
Graph< float > & agent_trust_net
 Graph with name "agent trust network" that contains how much each agents trusts each other agent. More...
 
const Graph< float > & knowledge_trust_resistance
 Graph with name "knowledge trust resistance network" that contains how quickly agents change their trust on a knowledge bit. More...
 
std::vector< float > agent_trust_resistance
 Converted float values from the agent node attribute "agent trust resistance".
 
std::vector< float > alter_trust_weight
 Converted float values from the agent node attribute "agent trust weight"
 
- 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

Model that updates the trust in peices of knowledge.

Constructor & Destructor Documentation

◆ Trust()

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

Requires the knowledge network be already loaded, and requires various agent node attributes.

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 for the following agent node attributes and that their values fall in the required range.

  • "can send knowledge trust" ∈ {true,false}
  • "can receive knowledge trust" ∈ {true,false}
  • "agent trust resistance" ∈ [0,∞)
  • "alter trust weight" ∈ [0,∞)
Here is the call graph for this function:

Member Function Documentation

◆ cleanup()

void Trust::cleanup ( void  )
overridevirtual

Updates each agent's knowledge trust based on the agent's transactive memory and their trust of their alters.

Reimplemented from Model.

Here is the call graph for this function:

◆ communicate()

void Trust::communicate ( const InteractionMessage msg)
overridevirtual

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

Reimplemented from Model.

Here is the call graph for this function:

◆ initialize()

void Trust::initialize ( void  )
overridevirtual

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 Trust::update ( void  )
overridevirtual

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

◆ agent_trust_net

Graph<float>& Trust::agent_trust_net
Initial value:
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:907
const std::string agent_trust
Definition: GraphManager.h:45
const std::string agents
Definition: NodesetManager.h:14
GraphManager & graph_manager
Definition: Model.h:75

Graph with name "agent trust network" that contains how much each agents trusts each other agent.

◆ knowledge_trust_net

Graph<float>& Trust::knowledge_trust_net
Initial value:
const bool col_dense
Definition: Graph.h:138
const bool row_dense
True if the row representation is dense, false if the representation is sparse.
Definition: Graph.h:144
const std::string k_trust
Definition: GraphManager.h:109
const std::string knowledge
Definition: NodesetManager.h:16
const Graph< bool > & knowledge_net
Graph with name "knowledge network" that contains the knowledge bits that each agent knows.
Definition: KnowledgeTrust.h:39

Graph with name "knowledge trust network" that contains the true trust an agent has for a peice of knowledge being true.

◆ knowledge_trust_resistance

const Graph<float>& Trust::knowledge_trust_resistance
Initial value:
const std::string ktrust_resist
Definition: GraphManager.h:111

Graph with name "knowledge trust resistance network" that contains how quickly agents change their trust on a knowledge bit.

◆ kttm

Graph<std::map<unsigned int, float> >& Trust::kttm
Initial value:
= graph_manager.load_optional(graph_names::kttm, std::map<unsigned int, float>(),
const std::string kttm
Definition: GraphManager.h:127

Graph with name "knowledge trust transactive memory network" that contains what each agent thinks another's knowledge trust is.