Construct version 5.4.4
An agent based modeling framework
|
Model that adds moderation to various social media platforms. More...
Classes | |
struct | Platform |
Data structure that holds information for moderated platforms More... | |
Public Member Functions | |
Social_Media_Moderation (const dynet::ParameterMap ¶meters, 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 Nodeset & | knowledge = ns_manager.get_nodeset(nodeset_names::knowledge) |
std::vector< std::string > | platform_names |
std::vector< Platform > | moderated_platforms |
Public Attributes inherited from Model | |
Construct & | construct |
GraphManager & | graph_manager |
NodesetManager & | ns_manager |
Random & | random |
bool | valid |
If member is false, the model's functions are not called. | |
Model that adds moderation to various social media platforms.
|
overridevirtual |
Populates moderated_platforms::platform once all models have been loaded.
Reimplemented from Model.
Reimplemented in Multiplatform_Manager.
|
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.
|
inlinevirtual |
Called during should_moderate_user and allows inherieted models to perform operations in resonse to that moderation.
Reimplemented in Multiplatform_Manager.
|
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.