Go to the documentation of this file. 1 #ifndef HOPS_STATERECORDER_HPP
2 #define HOPS_STATERECORDER_HPP
15 template<
typename MarkovChainImpl>
18 explicit StateRecorder(
const MarkovChainImpl &markovChainImpl) : MarkovChainImpl(markovChainImpl) {
19 records = std::make_shared<std::vector<VectorType>>();
25 MarkovChainImpl::installDataObject(chainData);
30 fileWriter->
write(
"states", *records);
32 MarkovChainImpl::writeRecordsToFile(fileWriter);
41 records->reserve(numberOfSamples);
45 records->emplace_back(MarkovChainImpl::getState());
47 MarkovChainImpl::storeRecord();
54 MarkovChainImpl::clearRecords();
59 std::shared_ptr<std::vector<VectorType>> records;
64 #endif //HOPS_STATERECORDER_HPP
void setStates(const std::shared_ptr< std::vector< Eigen::VectorXd >> &states)
Definition: ChainData.hpp:47
Definition: IsClearRecordsAvailable.hpp:8
const std::vector< VectorType > & getStateRecords() const
Definition: StateRecorder.hpp:36
Definition: IsInstallDataObjectAvailable.hpp:9
void reserveStateRecords(long numberOfSamples)
Definition: StateRecorder.hpp:40
void writeRecordsToFile(const FileWriter *const fileWriter) const
Definition: StateRecorder.hpp:29
Definition: IsWriteRecordsToFileAvailable.hpp:9
void installDataObject(ChainData &chainData)
Definition: StateRecorder.hpp:22
StateRecorder(const MarkovChainImpl &markovChainImpl)
Definition: StateRecorder.hpp:18
virtual void write(const std::string &description, const std::vector< float > &records) const =0
Writes records.
Definition: ChainData.hpp:12
Definition: IsStoreRecordAvailable.hpp:8
Definition: FileWriter.hpp:9
Definition: CsvReader.hpp:8
void clearRecords()
Definition: StateRecorder.hpp:51
Definition: StateRecorder.hpp:16
void storeRecord()
Definition: StateRecorder.hpp:44