Construct version 5.4.4
An agent based modeling framework
|
Model that updates the trust in peices of knowledge. More...
Public Member Functions | |
Trust (const dynet::ParameterMap ¶meters, 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... | |
bool | intercept (InteractionItem &item, unsigned int sender, unsigned int receiver, const CommunicationMedium *medium) override |
Allows for models to effect change to items created by other models. 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 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 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 | |
Construct & | construct |
GraphManager & | graph_manager |
NodesetManager & | ns_manager |
Random & | random |
bool | valid |
If member is false, the model's functions are not called. | |
Model that updates the trust in peices of knowledge.
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.
|
overridevirtual |
Updates each agent's knowledge trust based on the agent's transactive memory and their trust of their alters.
Reimplemented from Model.
|
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.
|
overridevirtual |
Moves the model to the front of the model list to ensure this model's communicate function is called first.
Reimplemented from Model.
|
overridevirtual |
Allows for models to effect change to items created by other models.
A model change add, modify, or remove information from an item based other submitted information. Also allows for models to control what InteractionItems get created. Senders and receiver indexes can include values from 0 to and including the size of the agent nodeset. Always check if the index is equal to the agent nodeset size before accessing a node or network value. The medium can be a node in the medium nodeset, a medium for a specific model, or a null pointer. Always check that a node is not a null pointer before derefrencing it. Complexity and exceptions depend entirely on each models specific implementation. By default, models allow items to be created without modifying them.
item | The InteractionItem that is being created. This item can modified as each model sees fit. |
sender | The index for the agent that is the source of the InteractionItem. |
receiver | The index for the agent that is receiving the item. If the item does not have an intended recipient, its value will equal the agent nodeset size. |
medium | The communication medium intended for the item. If the medium is not yet chosen, it will be a null pointer. The medium may or may not be in the medium nodeset and there are no restraints on what index the medium could have. |
Example
Output:
0.2
Reimplemented from Model.
|
overridevirtual |
Add knowledge trust to knowledge items in messages if they do not already include them.
Reimplemented from Model.
Graph<float>& Trust::agent_trust_net |
Graph with name "agent trust network" that contains how much each agents trusts each other agent.
Graph<float>& Trust::knowledge_trust_net |
Graph with name "knowledge trust network" that contains the true trust an agent has for a peice of knowledge being true.
const Graph<float>& Trust::knowledge_trust_resistance |
Graph with name "knowledge trust resistance network" that contains how quickly agents change their trust on a knowledge bit.