45#include "data/dataHandler.h"
46#include "mutator/rng.h"
47#include "program/program.h"
107 std::vector<std::reference_wrapper<const Data::DataHandler>>>
120 std::map<const Program::Program*, std::deque<ArchiveRecording>>
141 size_t initialSeed = 0)
170 const std::vector<std::reference_wrapper<const Data::DataHandler>>&
212 const std::vector<std::reference_wrapper<const Data::DataHandler>>&
214 double result,
bool forced =
false);
235 const std::map<size_t, double>& hashesAndResults,
236 double tau = 1e-4)
const;
263 size_t, std::vector<std::reference_wrapper<const Data::DataHandler>>>&
bool hasDataHandlers(const size_t &hash) const
Check whether the given hash is already in the archive.
Definition: archive.cpp:150
~Archive()
Destructor of the class.
Definition: archive.cpp:40
size_t getNbRecordings() const
Get the number of recordings currently held in the Archive.
Definition: archive.cpp:199
std::map< const Program::Program *, std::deque< ArchiveRecording > > recordingsPerProgram
Map storing the Program pointers referenced in recordings the associated recording.
Definition: archive.h:121
static size_t getCombinedHash(const std::vector< std::reference_wrapper< const Data::DataHandler > > &dHandler)
Combien the hash of a set of dataHandlers into a single one.
Definition: archive.cpp:50
std::map< size_t, std::vector< std::reference_wrapper< const Data::DataHandler > > > dataHandlers
Storage for DataHandler copies used in recordings.
Definition: archive.h:108
void setRandomSeed(size_t newSeed)
Set a new seed for the randomEngine.
Definition: archive.cpp:67
const double archivingProbability
Probability of adding any program execution to the archive.
Definition: archive.h:129
virtual void addRecording(const Program::Program *const program, const std::vector< std::reference_wrapper< const Data::DataHandler > > &dHandler, double result, bool forced=false)
Add a new recording to the Archive.
Definition: archive.cpp:72
virtual bool areProgramResultsUnique(const std::map< size_t, double > &hashesAndResults, double tau=1e-4) const
Definition: archive.cpp:155
Archive(const Archive &other)=delete
Mutator::RNG rng
Randomness engine for archiving.
Definition: archive.h:96
Archive(size_t size=50, double archivingProbability=1.0, size_t initialSeed=0)
Main constructor for Archive.
Definition: archive.h:140
const size_t maxSize
Maximum number of recordings held in the Archive.
Definition: archive.h:83
const ArchiveRecording & at(uint64_t n) const
Access the nth ArchiveRecording within the Archive.
Definition: archive.cpp:62
const std::map< size_t, std::vector< std::reference_wrapper< const Data::DataHandler > > > & getDataHandlers() const
Const accessor to the dataHandlers attribute.
Definition: archive.cpp:211
size_t getNbDataHandlers() const
Get the number of different vector of DataHandler associated to recordings.
Definition: archive.cpp:204
void clear()
Clear all content from the Archive.
Definition: archive.cpp:216
std::deque< ArchiveRecording > recordings
Recordings of the Archive.
Definition: archive.h:124
The Program class contains a list of program lines that can be executed within a well defined Environ...
Definition: program.h:53
Class used to store one recording of an Archive.
Definition: archive.h:58
const size_t dataHash
Hash of the set of DataHandler for this recording.
Definition: archive.h:63
const double result
Definition: archive.h:67
const Program::Program *const prog
Pointer to the Program. This pointer may point to a freed program.
Definition: archive.h:60