Leviathan_no_group
Agent Class Reference

#include <Leviathan.h>

Public Member Functions

 Agent (Leviathan *father, IdAgent agent_)
 
void init (unsigned int nbAgents)
 
IdAgent gossipToWho ()
 
void updateOpinions ()
 
float getOpinion (IdAgent other)
 

Public Attributes

Leviathandady
 
IdAgent id
 
std::vector< float > opinions
 
std::vector< float > deltaOpinions
 
std::vector< IdAgent > listGossip
 
IdAgent directInteraction
 
float influenceOther
 
std::vector< IdAgent > gossipAbout
 
unsigned int countGossipAbout
 

Detailed Description

An agent contain the opinions all the opinions of the agent

Constructor & Destructor Documentation

◆ Agent()

Agent::Agent ( Leviathan father,
IdAgent  agent_ 
)
inline

Constructor

Parameters
fatherthe pointer the Leviathan that contain the new Agent
agent_the id of the new agent.

Member Function Documentation

◆ getOpinion()

float Agent::getOpinion ( IdAgent  other)
inline

return the opinion of the agent about other

Parameters
otherthe id of the other agent

◆ gossipToWho()

IdAgent Agent::gossipToWho ( )

Choose and return one agent to gossip about

◆ init()

void Agent::init ( unsigned int  nbAgents)

Must be call after the construction of all agents in dady

Parameters
nbAgentsthe number of agent in dady

◆ updateOpinions()

void Agent::updateOpinions ( )

Update all the opinions (with deltaOpinions)

Member Data Documentation

◆ countGossipAbout

unsigned int Agent::countGossipAbout

just a counter to speed up the choice of the agent to gossip about

◆ dady

Leviathan* Agent::dady

Pointer to Leviathan that contain all agents

◆ deltaOpinions

std::vector<float> Agent::deltaOpinions

change of opinion about the agents (for the current step)

◆ directInteraction

IdAgent Agent::directInteraction

agent of the direct interaction (for the current step)

◆ gossipAbout

std::vector<IdAgent> Agent::gossipAbout

just a vector to speed up the choice of the agent to gossip about

◆ id

IdAgent Agent::id

id of the agent

◆ influenceOther

float Agent::influenceOther

influence (p) of the other agent in the direct interaction (for the current step)

◆ listGossip

std::vector<IdAgent> Agent::listGossip

agents the gossip (for the current step)

◆ opinions

std::vector<float> Agent::opinions

opinions about the agent


The documentation for this class was generated from the following files: