Construct version 5.4.4
An agent based modeling framework
Social_Media_Moderation Struct Reference

Model that adds moderation to various social media platforms. More...

Inheritance diagram for Social_Media_Moderation:
Collaboration diagram for Social_Media_Moderation:

Classes

struct  Platform
 Data structure that holds information for moderated platforms More...
 

Public Member Functions

 Social_Media_Moderation (const dynet::ParameterMap &parameters, Construct &construct)
 Requires the parameters "platform model names", "ban thresholds", and "moderation thresholds".
 
void initialize () override
 Populates moderated_platforms::platform once all models have been loaded. More...
 
virtual void moderation_response (unsigned int user_index, Social_Media_no_followers *platform)
 Called during should_moderate_user and allows inherieted models to perform operations in resonse to that moderation. More...
 
bool intercept (InteractionItem &item, unsigned int sender, unsigned int receiver, const CommunicationMedium *medium) override
 Prevents banned agents on the specified platforms from creating content. More...
 
virtual bool should_moderate_user (InteractionItem &item, unsigned int sender, Social_Media_no_followers *platform, float moderation_threshold)
 Evaluates whether a user should be moderated. More...
 
- Public Member Functions inherited from Model
 Model (Construct &_construct)
 Constructor for all models in Construct. More...
 
virtual ~Model (void)
 Virtual Deconstructor. More...
 
virtual void initialize (void)
 Function called once before any simulation cycles begin. More...
 
virtual void think (void)
 First function called in a simulation cycle. More...
 
virtual void update (void)
 Function called after the think functions in a simulation cycle. More...
 
virtual bool intercept (InteractionItem &item, unsigned int sender, unsigned int receiver, const CommunicationMedium *medium)
 Allows for models to effect change to items created by other models. More...
 
virtual void communicate (const InteractionMessage &msg)
 Function called after the update functions in a simulation cycle. More...
 
virtual void cleanup (void)
 Function called after the Model::communicate functions in a simulation cycle. More...
 
void add_base_model_to_model_manager (const std::string &base_model_name)
 Adds a derived model under the name of the base model and disables the model manager from calling its functions.
 

Public Attributes

const Nodesetknowledge = ns_manager.get_nodeset(nodeset_names::knowledge)
 
std::vector< std::string > platform_names
 
std::vector< Platformmoderated_platforms
 
- Public Attributes inherited from Model
Constructconstruct
 
GraphManagergraph_manager
 
NodesetManagerns_manager
 
Randomrandom
 
bool valid
 If member is false, the model's functions are not called.
 

Detailed Description

Model that adds moderation to various social media platforms.

Member Function Documentation

◆ initialize()

void Social_Media_Moderation::initialize ( void  )
overridevirtual

Populates moderated_platforms::platform once all models have been loaded.

Reimplemented from Model.

Reimplemented in Multiplatform_Manager.

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

◆ intercept()

bool Social_Media_Moderation::intercept ( InteractionItem item,
unsigned int  sender,
unsigned int  receiver,
const CommunicationMedium medium 
)
overridevirtual

Prevents banned agents on the specified platforms from creating content.

If an item contains the InteractionItem::item_keys::banned key true is returned regardless of other inputs. If the medium is equal to a moderated platform's medium and the receiver index has not been selected (receiver == agent_count), the should_moderate_user is called. If that result is true, the Social_Media_Moderation::Platform::removal_count for the sender is incremented.

Reimplemented from Model.

Here is the call graph for this function:

◆ moderation_response()

virtual void Social_Media_Moderation::moderation_response ( unsigned int  user_index,
Social_Media_no_followers platform 
)
inlinevirtual

Called during should_moderate_user and allows inherieted models to perform operations in resonse to that moderation.

Reimplemented in Multiplatform_Manager.

Here is the caller graph for this function:

◆ should_moderate_user()

bool Social_Media_Moderation::should_moderate_user ( InteractionItem item,
unsigned int  sender,
Social_Media_no_followers platform,
float  moderation_threshold 
)
virtual

Evaluates whether a user should be moderated.

The item is parsed for knowledge trust if the item contains it. If the corresponding knowledge node's attribute value for node_attributes::moderated is true and the knowledge trust value is above the moderation threshold, the item becomes banned, a moderation response for that user is called, and true is returned. If any of these conditions are not met, false is returned.

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