#include <DataLogger.h>
Public Member Functions | |
DataLogger () | |
virtual | ~DataLogger () |
void | start (const BoxSpace *observationSpace, const BoxSpace *actionSpace, unsigned int maxStepCount) |
void | stop () |
void | record (const MatNd *observation, const MatNd *action) |
bool | isRunning () const |
Private Attributes | |
std::recursive_mutex | mutex |
unsigned int | fileCounter |
volatile bool | running |
MatNd * | buffer |
unsigned int | currentStep |
std::ofstream | output |
Logs experiment data to a csv file. For every time step, it records the observations and the actions. The reward can be computed later on the Python side.
Definition at line 50 of file DataLogger.h.
Rcs::DataLogger::DataLogger | ( | ) |
Constructor. Automatically names files like TIME_FILENUM
.csv on start
Definition at line 44 of file DataLogger.cpp.
|
virtual |
Definition at line 53 of file DataLogger.cpp.
|
inline |
Return true if running.
Definition at line 83 of file DataLogger.h.
void DataLogger::record | ( | const MatNd * | observation, |
const MatNd * | action | ||
) |
Record data for the current step.
Definition at line 129 of file DataLogger.cpp.
void Rcs::DataLogger::start | ( | const BoxSpace * | observationSpace, |
const BoxSpace * | actionSpace, | ||
unsigned int | maxStepCount | ||
) |
Start logging for at most stepCount steps.
[in] | observationSpace | environment's observation space |
[in] | actionSpace | environment's action space |
[in] | maxStepCount | maximum number of time steps |
Definition at line 59 of file DataLogger.cpp.
void DataLogger::stop | ( | ) |
Stop logging and flush data to file.
Definition at line 97 of file DataLogger.cpp.
|
private |
Buffer to avoid writing on realtime main thread.
Definition at line 98 of file DataLogger.h.
|
private |
Step counter in current logging run.
Definition at line 101 of file DataLogger.h.
|
private |
Automatic log file naming.
Definition at line 92 of file DataLogger.h.
|
private |
Definition at line 89 of file DataLogger.h.
|
private |
Current output stream.
Definition at line 104 of file DataLogger.h.
|
private |
Flag if the logger is currently recording.
Definition at line 95 of file DataLogger.h.