20 #ifndef _TIMESTAMPEDREWARD_H_
21 #define _TIMESTAMPEDREWARD_H_
24 #include <boost/date_time/posix_time/posix_time_types.hpp>
29 #include "RewardXML.h"
55 std::string
getAsXML(
bool prettyPrint )
const;
Definition: RewardXML.h:34
A map of int:double storing a value on each dimension, with an attached timestamp saying when it was ...
Definition: TimestampedReward.h:35
std::string getAsXML(bool prettyPrint) const
Formats as an XML string.
double getValueOnDimension(int dimension) const
Returns the reward value stored on the specified dimension.
TimestampedReward(boost::posix_time::ptime timestamp, const RewardXML &reward)
Constructs from an XML node element.
TimestampedReward & createFromSimpleString(boost::posix_time::ptime timestamp, std::string simple_string)
Constructs from a simple string.
double getValue() const
Returns the reward value stored on dimension zero. By default the reward producers store their output...
TimestampedReward()
Constructs an empty reward.
boost::posix_time::ptime timestamp
The timestamp.
Definition: TimestampedReward.h:62
friend std::ostream & operator<<(std::ostream &os, const TimestampedReward &tsf)
Stream a readable version, for casual inspection.
void add(const TimestampedReward &other)
Merge the specified reward structure into this one, adding rewards that are on the same dimension.
bool hasValueOnDimension(int dimension) const
Returns whether a reward value is stored on the specified dimension.
TimestampedReward(float reward)
Constructs from a single reward float (assumes default dimension of 0)
std::string getAsSimpleString() const
Formats as a simple string.
TimestampedReward & createFromXML(boost::posix_time::ptime timestamp, std::string xml_string)
Constructs from an XML string.