Construct version 5.4.3
An agent based modeling framework
Reddit::reddit_user Struct Reference

Class for the behavior of users on Reddit. More...

Inheritance diagram for Reddit::reddit_user:
Collaboration diagram for Reddit::reddit_user:

Public Member Functions

 reddit_user (Reddit *reddit, const Node &node)
 Loads node attributes of the agent into values for the class. More...
 
Redditmedia ()
 
void generate_post_events (void)
 Each user checks whether to generate a post this time step. More...
 
void init_reddit_event_fields (media_event *_event, float ktrust, unsigned int subreddit, unsigned int prev_ban)
 Sets the reddit-specific fields when a new Reddit post is created.
 
void read (media_event *_event)
 The post/comment is read and user responses (comment, vote, knowledge trust updates) are handled. More...
 
void comment (media_event *_event)
 The user comments on the passed media_event based on the user's pr value and their status in the subreddit.
 
void upvote (media_event *_event)
 The user upvotes the passed media_event with probability reddit_user::up.
 
void downvote (media_event *_event)
 The user downvotes the passed media_event with probability reddit_user::dp.
 
void update_ktrust (media_event *_event)
 The user's trust of the knowledge bit associated with the media_event is updated.
 
virtual float get_trust (unsigned int knowledge_index)
 Returns the trust the user has in the knowledge index from the knowledge trust network.
 
unsigned int get_read_count () override
 Returns a value sampled from a poisson distribution with a mean of reddit_user::pdread * Social_Media_no_followers::dt. More...
 
void reply (media_event *_event)
 No Operation More...
 
void quote (media_event *_event)
 No Operation More...
 
void repost (media_event *_event)
 No Operation 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...
 

Public Attributes

unsigned int id
 This user's agent index.
 
float pdread
 The probability density to read events (time in hours) pdread * dt = average number of read messages in a time period.
 
float pp
 The probability the agent creates a post each time step.
 
float pr
 The probability to reply when an event is read.
 
float up
 The probability to upvote an event when read.
 
float dp
 The probability to downvote an event when read.
 
- Public Attributes inherited from Social_Media_no_followers::media_user
Social_Media_no_followersmedia_ptr
 

Detailed Description

Class for the behavior of users on Reddit.

The class provides the framework for agent descision making in the model environment.

Constructor & Destructor Documentation

◆ reddit_user()

Reddit::reddit_user::reddit_user ( Reddit reddit,
const Node node 
)

Loads node attributes of the agent into values for the class.

The following attributes are required:

Member Function Documentation

◆ generate_post_events()

void Reddit::reddit_user::generate_post_events ( void  )
virtual

Each user checks whether to generate a post this time step.

Each user creates a post with probability reddit_user::pp. Users that create a post select a random subreddit they subscribe to from the subreddit network and a random knowledge bit from knowledge they know in the knowledge network and adds that information to the post along with the agent's corresponding knowledge trust from the knowledge trust network.

Implements Social_Media_no_followers::media_user.

Here is the call graph for this function:

◆ get_read_count()

unsigned int Reddit::reddit_user::get_read_count ( void  )
overridevirtual

Returns a value sampled from a poisson distribution with a mean of reddit_user::pdread * Social_Media_no_followers::dt.

Implements Social_Media_no_followers::media_user.

◆ quote()

void Reddit::reddit_user::quote ( media_event _event)
inlinevirtual

No Operation

Implements Social_Media_no_followers::media_user.

◆ read()

void Reddit::reddit_user::read ( media_event _event)
virtual

The post/comment is read and user responses (comment, vote, knowledge trust updates) are handled.

Implements Social_Media_no_followers::media_user.

Here is the call graph for this function:

◆ reply()

void Reddit::reddit_user::reply ( media_event _event)
inlinevirtual

No Operation

Implements Social_Media_no_followers::media_user.

◆ repost()

void Reddit::reddit_user::repost ( media_event _event)
inlinevirtual

No Operation

Implements Social_Media_no_followers::media_user.