1#ifndef CYCLUS_SRC_TOOLKIT_TIMESERIES_H_
2#define CYCLUS_SRC_TOOLKIT_TIMESERIES_H_
9#include "boost/variant.hpp"
10#include "boost/variant/get.hpp"
31typedef boost::variant<
35 std::function<void(
cyclus::Agent*,
int,
double, std::string)>,
36 std::function<void(
cyclus::Agent*,
int, std::string, std::string)>
42template <TimeSeriesType T>
44 std::string units =
"");
49 std::string units =
"") {
50 std::string tblname =
"TimeSeries" + tsname;
60 for (
auto f=vec.begin(); f != vec.end(); ++f){
61 std::function<void(
cyclus::Agent*,
int, T, std::string)> fn = boost::get<std::function<void(
cyclus::Agent*,
int, T, std::string)> >(*f);
62 fn(agent, time, value, tsname);
The abstract base class used by all types of agents that live and interact in a simulation.
Context * context() const
Returns this agent's simulation context.
virtual const int id() const
The agent instance's unique ID within a simulation.
Datum * NewDatum(std::string title)
See Recorder::NewDatum documentation.
virtual int time()
Returns the current simulation timestep.
Datum * AddVal(const char *field, boost::spirit::hold_any val, std::vector< int > *shape=NULL)
Add an arbitrary field-value pair to the datum.
void Record()
Record this datum to its Recorder.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....