Construct version 5.4.4
An agent based modeling framework
Output_Reddit_Posts Struct Reference

Outputs the contents of the event_list to a csv file, with fields similar to Reddit data. More...

Inheritance diagram for Output_Reddit_Posts:
Collaboration diagram for Output_Reddit_Posts:

Public Member Functions

virtual const Reddit::event_containerget_event_list (const dynet::ParameterMap &params, Construct &construct)
 
 ~Output_Reddit_Posts (void)
 
void msg_out (const Social_Media_no_followers::media_event &msg, const unsigned int current_timestep)
 
void process (unsigned int t)
 
 Output_Reddit_Posts (const dynet::ParameterMap &params, Construct &construct)
 
- Public Member Functions inherited from Output
 Output (const dynet::ParameterMap &params, Construct &construct)
 Sets up the output to only record during certain timeperiods. Allows the usage of should_process.
 
 Output ()
 Creates an output that does not depend on time. Output::should_process should not be called when using this constructor.
 
bool should_process (int t)
 Given the current time index, returns true if the current time period is flagged to be processed.
 
virtual ~Output ()
 Virtual Deconstructor. More...
 
virtual std::vector< int > get_output_timeperiods (const dynet::ParameterMap &params, Construct &construct)
 Creates a vector of indexes that indicate in which timeperiod output should be processed. The parameter "timeperiods" in params controls this value. "all" will fill the entire the array with -1 followed by all timeperiods. "last" will set it to only contain the last time index. "initial" will set it to only contain -1. If it is none of these, the param is tokenized with a comma delimiter and converts the tokens to integers. Returned vector should always be ordered.
 
virtual void process (unsigned int t)=0
 Called after each model has executed. More...
 

Public Attributes

std::ofstream _output_file
 
const Reddit::event_containermedia_events
 
int output_frequency
 

Detailed Description

Outputs the contents of the event_list to a csv file, with fields similar to Reddit data.

Constructor & Destructor Documentation

◆ ~Output_Reddit_Posts()

Output_Reddit_Posts::~Output_Reddit_Posts ( void  )
inline

summary> The passed media_event is formatted and output in csv format.

Member Function Documentation

◆ msg_out()

void Output_Reddit_Posts::msg_out ( const Social_Media_no_followers::media_event msg,
const unsigned int  current_timestep 
)
inline

summary> Outputs the media events in media_events with the specified frequency.

Here is the caller graph for this function:

◆ process()

void Output_Reddit_Posts::process ( unsigned int  t)
inlinevirtual

summary> Loads the required parameters.

Implements Output.

Here is the call graph for this function:

Member Data Documentation

◆ _output_file

std::ofstream Output_Reddit_Posts::_output_file

summary>

◆ media_events

const Reddit::event_container* Output_Reddit_Posts::media_events

summary>Frequency to write data to the output file.

◆ output_frequency

int Output_Reddit_Posts::output_frequency

summary>