Construct version 5.4.3
An agent based modeling framework
Social_Media_with_followers::default_media_user Struct Reference

Implements the virtual functions in Social_Media_with_followers::media_user. More...

Inheritance diagram for Social_Media_with_followers::default_media_user:
Collaboration diagram for Social_Media_with_followers::default_media_user:

Public Member Functions

 default_media_user (Social_Media_with_followers *reddit, const Node &node)
 Constructor that takes the media pointer this user is apart of and the iterator containing all the required node attributes. More...
 
Social_Media_with_followersmedia ()
 
virtual void add_mentions (media_event *post) override
 Mentions are added to the event if the event is a post by randomly selecting a followee. More...
 
bool follow_user (unsigned int alter_agent_index) override
 Returns true if this user decides to follow an agent when called. More...
 
bool unfollow_user (unsigned int alter_agent_index) override
 Returns true if this user decides to unfollow an agent when called. More...
 
bool respond_to_follow (unsigned int alter_agent_index) override
 An alter has decided to follow this user and can decide to reciprocate that following. More...
 
unsigned int consider_recommendations (void) override
 The number of recommendations the user should view in Social_Media_with_followers::add_followees based on default_media_user::pdaf. More...
 
float get_charisma () override
 Returns default_media_user::charisma. More...
 
- Public Member Functions inherited from Social_Media_no_followers::default_media_user
 default_media_user (Social_Media_no_followers *reddit, const Node &node)
 Constructor that takes the media pointer this user is apart of and the iterator containing all the required node attributes. More...
 
Social_Media_no_followersmedia ()
 
void read (media_event *_event) override
 The read event is checked to ensure it contains knowledge More...
 
void reply (media_event *_event) override
 With proabability default_media_user::pr creates a reply to the event. More...
 
void quote (media_event *_event) override
 With proabability default_media_user::pqu creates a quote to the event. More...
 
void repost (media_event *_event) override
 With proabability default_media_user::prp creates a quote to the event. More...
 
void generate_post_events (void) override
 The user adds a number of post events based on default_media_user::pdp. More...
 
unsigned int get_read_count (void) override
 The user reads a number of events based on default_media_user::pdread. More...
 
virtual void add_mentions (media_event *post)
 Allows derived classes to mention users when creating an event. More...
 
virtual void add_trust (media_event *post)
 If the trust model is present, this users trust is added to a post using Social_Media_no_followers::default_media_user::get_trust.
 
virtual float get_trust (unsigned int knowledge_index)
 Returns the trust the user has in the knowledge index. Returns -1 if the Trust Model is not loaded. More...
 
virtual unsigned int get_knowledge_selection (void)
 Called during media_user::generate_post_events to choose which piece of knowledge to add to a media_event. More...
 
- Public Member Functions inherited from Social_Media_no_followers::media_user
 media_user (Social_Media_no_followers *media)
 
virtual ~media_user ()
 
virtual void read (media_event *read_event)=0
 Called during Social_Media_no_followers::communicate when an agent is to read and parse an event. This function is called once for every message. More...
 
virtual void reply (media_event *read_event)=0
 Called after read only if this agent posseses the knowledge in the read event. This function should create a reply based on the implementation's conditions. More...
 
virtual void quote (media_event *read_event)=0
 Called after read only if this agent posseses the knowledge in the read event. This function should create a quote based on the implementation's conditions. More...
 
virtual void repost (media_event *read_event)=0
 Called after read only if this agent posseses the knowledge in the read event and read_event::type equals media_event::event_types::post. This function should create a reply based on the implementation's conditions. More...
 
virtual void generate_post_events (void)=0
 Called during Social_Media_no_followers::think. Function should generate post events that are added to Social_Media_no_followers::list_of_events. More...
 
virtual unsigned int get_read_count (void)=0
 Called during Social_Media_no_followers::think to determine how many events to read in a user's feed. More...
 
virtual bool follow_user (unsigned int alter_agent_index)=0
 Returns true if this user decides to follow an agent More...
 
virtual bool unfollow_user (unsigned int alter_agent_index)=0
 Returns true if this user decides to unfollow an agent More...
 
virtual bool respond_to_follow (unsigned int alter_agent_index)=0
 An alter has decided to follow this user and can decide to reciprocate that following. More...
 
virtual unsigned int consider_recommendations (void)=0
 Returns how many agents should be considered to be followed in Social_Media_with_followers::add_followees More...
 
virtual float get_charisma ()=0
 Returns the user's charisma or how likable the user is independent of other user attributes. More...
 

Public Attributes

float pdaf
 The probability density for how many agents will be recommended to an agent to follow each time step. More...
 
float rf
 The scale factor to determine number of removed followees.
 
float charisma
 This determines how likable someone's event is going to be.
 
bool auto_follow
 If true, this user, when added as a followee by another user, will automatically reciprocate followings
 
- Public Attributes inherited from Social_Media_no_followers::default_media_user
unsigned int id
 This user's agent index.
 
float pdp
 The probability density to post pdtw * dt = average number of events in a time period.
 
float pr
 The probability to reply when an event is read.
 
float prp
 The probability to repost when a post is read.
 
float pqu
 The probability to quote when an event is read.
 
float pdread
 The probability density to read events (time in hours) pdread * dt = average number of read messages in a time period.
 
- Public Attributes inherited from Social_Media_no_followers::media_user
Social_Media_no_followersmedia_ptr
 

Detailed Description

Implements the virtual functions in Social_Media_with_followers::media_user.

summary>

Constructor & Destructor Documentation

◆ default_media_user()

Social_Media_with_followers::default_media_user::default_media_user ( Social_Media_with_followers reddit,
const Node node 
)

Constructor that takes the media pointer this user is apart of and the iterator containing all the required node attributes.

Some required node attribute names depend on Social_Media_with_followers::media_name. Thus the following attributes are required in addition to the attributes required by Social_Media_no_followers::default_media_user:

  • media_name + " add follower density"
  • media_name + " remove follower scale factor"
  • media_name + " auto follow"
  • media_name + " charisma"
Here is the call graph for this function:

Member Function Documentation

◆ add_mentions()

void Social_Media_with_followers::default_media_user::add_mentions ( media_event post)
overridevirtual

Mentions are added to the event if the event is a post by randomly selecting a followee.

This function is used by other member functions and can be reimplemented in inherieted classes.

Reimplemented from Social_Media_no_followers::default_media_user.

Reimplemented in SM_wf_emotions::default_media_user.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ consider_recommendations()

unsigned int Social_Media_with_followers::default_media_user::consider_recommendations ( void  )
overridevirtual

The number of recommendations the user should view in Social_Media_with_followers::add_followees based on default_media_user::pdaf.

Implements Social_Media_with_followers::media_user.

Here is the caller graph for this function:

◆ follow_user()

bool Social_Media_with_followers::default_media_user::follow_user ( unsigned int  alter_agent_index)
overridevirtual

Returns true if this user decides to follow an agent when called.

Uses a Euclidian distance between the ego agent's knowledge trust and the ego agent's transactive memory for the alter agent. The greater the distance the less likely the ego agent is to follow the alter agent. Finally the probability is multiplied by the alter agent's charisma.

Implements Social_Media_with_followers::media_user.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_charisma()

float Social_Media_with_followers::default_media_user::get_charisma ( )
overridevirtual

Returns default_media_user::charisma.

Implements Social_Media_with_followers::media_user.

Here is the caller graph for this function:

◆ respond_to_follow()

bool Social_Media_with_followers::default_media_user::respond_to_follow ( unsigned int  alter_agent_index)
overridevirtual

An alter has decided to follow this user and can decide to reciprocate that following.

Implements Social_Media_with_followers::media_user.

Here is the caller graph for this function:

◆ unfollow_user()

bool Social_Media_with_followers::default_media_user::unfollow_user ( unsigned int  alter_agent_index)
overridevirtual

Returns true if this user decides to unfollow an agent when called.

Three factors currently contribute to unfollowing an agent, whether a following relationship is bidirectional or unidirectional, receiving responses to your events, and the jacard similarity of the alter agent's followers and the ego agent's followers. More information on the impact of these factors can be seen in Kwak et al. More of a Receiver Than a Giver: Why Do People Unfollow in Social_Media_with_followers? AAAI (2012). The resulting probability is multiplied by Social_Media_with_followers::dt to ensure a similar number of agents are unfollowed regardless of the time between time periods. The probability is also divided by media_user::rf to allow for tuning of the removing of followers.

Implements Social_Media_with_followers::media_user.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ pdaf

float Social_Media_with_followers::default_media_user::pdaf

The probability density for how many agents will be recommended to an agent to follow each time step.

The average number of agents recommended in a time period is pdaf * dt and is sampled from a poisson distribution. Each agent this is recommended a follower is asked via media_user::follow_user and is only added as a follower if the function returns true.