Template Class grid2D_metrics_csv_sink

Inheritance Relationships

Base Type

Class Documentation

template<typename TCellOp>
class grid2D_metrics_csv_sink : public rcppsw::metrics::csv_sink

Base class for the .csv sinks for metrics using a 2D grid to fill with counts of SOMETHING, to be averaged over the entire simulation. Each line of the resulting .csv file corresponds to an XY plane for a value of Z in the grid.

Public Functions

inline grid2D_metrics_csv_sink(const std::string &fpath_stem, const rmetrics::output_mode &mode, const types::timestep &interval)

See also

rmetrics::csv_sink.

inline virtual std::list<std::string> csv_header_cols(const rmetrics::base_data *data) const override

Return a list of additional columns that should be in the emitted .csv file for the sink.

Returns:

a list of the names of the columns for the .csv.

inline virtual boost::optional<std::string> csv_line_build(const rmetrics::base_data *data, const rtypes::timestep &t) override

Build the next line of metrics.

Returns:

The line that should be added to the .csv file, or empty if the necessary conditions are not met. This allows metrics to be gathered across multiple timesteps, but only written out once an interesting event has occurred.