Classes in this package

Class: Agent — Implements functionality of a single agent

class Agent.Agent[source]
__init__(w=1, c=1, numfacts=0, numnoise=0, spammer=0, selfish=0, trust_used=True, inbox_trust_sorted=True, trust_filter_on=True, capacity=1, uses_knowledge=True)[source]

Class for generating and implementing Agents.

param int numfacts:
 number of facts in the simulation that are valuable
param int numnoise:
 number of facts in the simulation that are noise
param float will:
 how frequently an agent will act
param float comp:
 how frequently the agent will a fact as valuable or not correctly (1: always, p: p% of the time)
param float spam:
 how frequently the agent will send the same fact to the same person (1 always, 0 never)
param float selfish:
 how frequently the agent will drop a fact and not send at all to a specific person (0 never, 1 always)
param int capacity:
 how many actions an agent can take at each simulation step, 1 by default to implement agents with limited cognitive resources.
param Boolean trust_used:
 If True (default), keeps statistics about Trust and sorts outbox by how much each neighbor is trusted
param Boolean inbox_trust_sorted:
 If True (default), periodically sorts the inbox by trust, processing facts from trusted neighbors first
param Boolean trust_filter_on:
 If True (default), it only sends messages out to neighbors that are minimally trusted, the rest are filtered out.
param Boolean uses_knowledge:
 True (default) if agent uses knowledge based processing and sends only facts it considers valuable. If False: it sends all facts regardless of value, used for hierarchical processing.

Key functions:

Agent.connect_to(neighbors, prior_comp=('M', 'M'), prior_will=('M', 'M'))[source]

Connects the agent to a set of other agents.

Example usage:

a.connect_to(neighbors, ('M','L'), ('H','H'))

Create a link to all Agents in the set neighbors. Initialize prior trust for all neighbors if prior competence and willigness is given.

Parameters:
  • neighbors – a set of Agent objects that are neighbors of the current Agent
  • prior_comp – prior competence belief for all neighbors, given as a pair of belief and uncertainty values, each one of ‘L’,’M’,’H’ for low medium and high. See Trust for more details.
  • prior_will – prior competence belief for all neighbors, same format as prior_comp.

Table Of Contents

Previous topic

Running the taNdem simulation model

This Page