Construct version 5.4.4
An agent based modeling framework
|
Outputs the contents of the message queue to a json file. More...
Public Member Functions | |
~Output_Messages (void) | |
void | process (unsigned int t) override |
Called after each model has executed. More... | |
Output_Messages (const dynet::ParameterMap ¶ms, Construct &construct) | |
Constructor for the "mesages" type output. More... | |
Public Member Functions inherited from Output | |
Output (const dynet::ParameterMap ¶ms, 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 ¶ms, 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::list< InteractionMessage > * | queue |
std::ofstream | _output_file |
Outputs the contents of the message queue to a json file.
|
inline |
summary>
|
inline |
Constructor for the "mesages" type output.
Exception Safety
If the parameters "output file" is not in the ParameterMap, a dynet::could_not_find_parameter is thrown. If the "output file" parameter does not have extension ".json", a dynet::wrong_file_extension is thrown. If this file can not be opened for writing, a dynet::could_not_open_file is thrown.
|
inlineoverridevirtual |
Called after each model has executed.
t | The current time period. |
Implements Output.
std::list<InteractionMessage>* Output_Messages::queue |
summary>