Construct version 5.4.3
An agent based modeling framework
SM_nf_emotions::default_media_user Struct Reference
Inheritance diagram for SM_nf_emotions::default_media_user:
Collaboration diagram for SM_nf_emotions::default_media_user:

Public Member Functions

 default_media_user (SM_nf_emotions *media, const Node &node)
 
SM_nf_emotionsmedia ()
 
void reply (media_event *_event) override
 Modifies Social_Media_no_followers::default_media_user::reply to use emotions. More...
 
void quote (media_event *_event) override
 Modifies Social_Media_no_followers::default_media_user::quote to use emotions. More...
 
void repost (media_event *_event) override
 Modifies Social_Media_no_followers::default_media_user::repost to use emotions. More...
 
void generate_post_events (void) override
 Modifies Social_Media_no_followers::default_media_user::generate_post_events to use emotions. More...
 
unsigned int get_read_count (void) override
 Modifies Social_Media_no_followers::default_media_user::get_read_count to use emotions. More...
 
virtual unsigned int get_knowledge_selection (void)
 Modifies Social_Media_no_followers::default_media_user::get_knowledge_selection to use emotions. More...
 
virtual void add_emotions (media_event *_event)
 Adds emotions to an event. 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...
 

Additional Inherited Members

- 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

summary>

Constructor & Destructor Documentation

◆ default_media_user()

SM_nf_emotions::default_media_user::default_media_user ( SM_nf_emotions media,
const Node node 
)
inline

summary>

Member Function Documentation

◆ add_emotions()

void SM_nf_emotions::default_media_user::add_emotions ( media_event _event)
virtual

Adds emotions to an event.

Events can not store all the emotions that need to be attached to an event. Emotions are instead added in the SM_nf_emotions::attached_emotions member. Each vector stored in the map has size equal to the emotion nodeset.

Here is the call graph for this function:

◆ generate_post_events()

void SM_nf_emotions::default_media_user::generate_post_events ( void  )
overridevirtual

Modifies Social_Media_no_followers::default_media_user::generate_post_events to use emotions.

The equation for calcuating the probability density for posting is updated to \(P^{(post)}_i=pdp_i+\sum_mB_{i,m}E_{i,m}+\sum_{n,m}C_{n,m}E_{i,n}E_{i,m}\) where \(pdp_i\) is Social_Media_no_followers::default_media_user::pdp, \(B\) is the "first order post density emotion network", \(C\) is the "second order post density emotion network", and \(E\) is the "emotion network". Additionally, emotions are attached to an event using add_emotions.

Implements Social_Media_no_followers::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:

◆ get_knowledge_selection()

unsigned int SM_nf_emotions::default_media_user::get_knowledge_selection ( void  )
virtual

Modifies Social_Media_no_followers::default_media_user::get_knowledge_selection to use emotions.

Each piece of knowledge is assigned a probability weight based on the following equation, \(P_{i,k}=(A_{i,k}+\sum_mB_{i,k}|T_{i,k}-0.5|+\sum_mC_{k,m}E_{i,m})*K_{i,k}\), where \(A\) is the "knowledge select bias network", \(B\) is the "knowledge select trust network", \(T\) is the "knowledge trust network", \(C\) is the "knowledge select emotion network", \(E\) is the "emotion network", and \(K\) is the "knowledge network". After calculating all the weights Random::find_dist_index is used to select the knowledge index for creating an event. If all probability weights are zero, a dynet::construct_exception is thrown.

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:

◆ get_read_count()

unsigned int SM_nf_emotions::default_media_user::get_read_count ( void  )
overridevirtual

Modifies Social_Media_no_followers::default_media_user::get_read_count to use emotions.

The equation for calcuating the probability density for number of messages to read is updated to \(P^{(read)}_i=pdread_i+\sum_mB_{i,m}E_{i,m}+\sum_{n,m}C_{n,m}E_{i,n}E_{i,m}\) where \(pdread_i\) is Social_Media_no_followers::default_media_user::pdread, \(B\) is the "first order read density emotion network", \(C\) is the "second order read density emotion network", and \(E\) is the "emotion network".

Implements Social_Media_no_followers::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:

◆ quote()

void SM_nf_emotions::default_media_user::quote ( media_event _event)
overridevirtual

Modifies Social_Media_no_followers::default_media_user::quote to use emotions.

The equation for calcuating the probability the agent will quote an event is updated to \(P^{(quote)}_i=pqu_i+\sum_mB_{i,m}E_{i,m}+\sum_{n,m}C_{n,m}E_{i,n}E_{i,m}\) where \(pqu_i\) is Social_Media_no_followers::default_media_user::pqu, \(B\) is the "first order quote probability emotion network", \(C\) is the "second order quote probability emotion network", and \(E\) is the "emotion network". Additionally, emotions are attached to the created event using add_emotions.

Implements Social_Media_no_followers::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:

◆ reply()

void SM_nf_emotions::default_media_user::reply ( media_event _event)
overridevirtual

Modifies Social_Media_no_followers::default_media_user::reply to use emotions.

The equation for calcuating the probability the agent will reply is updated to \(P^{(reply)}_i=pr_i+\sum_mB_{i,m}E_{i,m}+\sum_{n,m}C_{n,m}E_{i,n}E_{i,m}\) where \(pr_i\) is Social_Media_no_followers::default_media_user::pr, \(B\) is the "first order reply probability emotion network", \(C\) is the "second order reply probability emotion network", and \(E\) is the "emotion network". Additionally, emotions are attached to the created event using add_emotions.

Implements Social_Media_no_followers::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:

◆ repost()

void SM_nf_emotions::default_media_user::repost ( media_event _event)
overridevirtual

Modifies Social_Media_no_followers::default_media_user::repost to use emotions.

The equation for calcuating the probability the agent will repost an event is updated to \(P^{(repost)}_i=prp_i+\sum_mB_{i,m}E_{i,m}+\sum_{n,m}C_{n,m}E_{i,n}E_{i,m}\) where \(prp_i\) is Social_Media_no_followers::default_media_user::prp, \(B\) is the "first order repost probability emotion network", \(C\) is the "second order repost probability emotion network", and \(E\) is the "emotion network". Additionally, emotions are attached to the created event using add_emotions.

Implements Social_Media_no_followers::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: