Construct version 5.4.4
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 enrich_event (media_event *_event) override
 Enirches the event with information. More...
 
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...
 
- 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 parse (media_event *_event)
 The parsed event is checked to ensure it contains knowledge More...
 
void reply (media_event *_event)
 With proabability default_media_user::pr creates a reply to the event. More...
 
void quote (media_event *_event)
 With proabability default_media_user::pqu creates a quote to the event. More...
 
void repost (media_event *_event)
 With proabability default_media_user::prp creates a quote to the event. More...
 
void generate_post_events (void)
 The user adds a number of post events based on default_media_user::pdp. More...
 
unsigned int get_read_count (void)
 The user reads a number of events based on default_media_user::pdread. More...
 
virtual void enrich_event (media_event *_event)
 Enirches the event with information. 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...
 
std::set< media_event * > read (media_event *read_event)
 Collects all events an agent will parse when reading an event. More...
 
- Public Member Functions inherited from Social_Media_no_followers::media_user
Randomrandom ()
 
 media_user (Social_Media_no_followers *media)
 
virtual ~media_user ()
 
virtual void parse (media_event *read_event)=0
 Called during Social_Media_no_followers::communicate when an agent parses an event. This function is called once for every message. More...
 
virtual void reply (media_event *read_event)=0
 Called after media_user::parse 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 media_user::parse 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 media_user::parse 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 repost 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 using Social_Media_no_followers::create_post. 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 std::set< media_event * > read (media_event *read_event)=0
 Called during Social_Media_no_followers::think to determine which other events should be added to an InteractionMessage in addition to the read event. 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

◆ enrich_event()

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

Enirches the event with information.

By default this is called after every event is created by this class. The last operation in this function is Social_Media_no_followers::finalize_event. Any functions that override this function should call this function after performing all other operations.

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:

◆ 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: