GEGELATI

Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Selector::MapElites::MapElitesArchive Class Reference

Class representing a Map Elites archive. More...

`#include <mapElitesArchive.h>`

Inheritance diagram for Selector::MapElites::MapElitesArchive:

## Public Member Functions
| MapElitesArchive (size_t nbBinPerDescriptor, size_t nbDescriptors, double minValue, double maxValue)
| Constructor of the MapElitesArchive.
uint64_t | size () const
| Get the size of the archive.
std::pair< uint64_t, uint64_t > | getDimensions () const
| Get the dimensions of the archive.
std::vector< double > | getArchiveLimits () const
| get the archive limits
virtual const std::vector< std::pair< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > > & | getAllArchive () const
| Get all the archive content.
virtual const std::pair< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > & | getArchiveAt (const std::vector< uint64_t > &indices) const
| Get the archive content at given indices.
virtual const std::pair< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > & | getArchiveFromDescriptors (const std::vector< double > &descriptors) const
| Get the archive content at given descriptors.
virtual void | setArchiveAt (const TPG::TPGVertex *vertex, std::shared_ptr< Learn::EvaluationResult > eval, const std::vector< uint64_t > &indices)
| Set the archive content at given indices.
virtual void | setArchiveFromDescriptors (const TPG::TPGVertex *vertex, std::shared_ptr< Learn::EvaluationResult > eval, const std::vector< double > &descriptors)
| Set the archive content at given descriptors.
virtual uint64_t | getIndexArchive (double value) const
| Get the index in one dimension of the archive from a value.
virtual uint64_t | computeLinearIndex (const std::vector< uint64_t > &indices) const
| Compute the linear index from multi-dimensional indices.
virtual std::vector< uint64_t > | computeIndices (uint64_t index) const
| Compute the multi-dimensional indices from linear index.
virtual bool | containsRoot (const TPG::TPGVertex *root) const
| Check if the archive contains a root TPGVertex.
virtual void | removeRootFromArchiveIfNotComplete (const TPG::TPGVertex *root, size_t maxNbEvaluation)
| Remove a root TPGVertex from the archive if its number of evaluation is below maxNbEvaluation.
virtual void | removeRootFromArchive (const TPG::TPGVertex *root, size_t maxNbEvaluation)
| Remove a root TPGVertex from the archive.
virtual std::set< const TPG::TPGVertex * > | getVerticesInArchive () const
| Return a set with the current vectors in the archive.

## Protected Attributes
uint64_t | nbBinPerDescriptor
| Number of bins per descriptor.
uint64_t | nbDescriptors
| Number of descriptors for this archive.
double | minValue
| Minimum value for the descriptors.
double | maxValue
| Maximum value for the descriptors.
std::vector< double > | archiveLimits
| Limits of the bins for the descriptors.
std::vector< std::pair< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > > | archive

## Detailed Description

Class representing a Map Elites archive.

The archive is represented as a multi-dimensional grid, where each cell can store an EvaluationResult and its corresponding agent.

## Constructor & Destructor Documentation

## ◆ MapElitesArchive()

Selector::MapElites::MapElitesArchive::MapElitesArchive | ( | size_t | nbBinPerDescriptor,
|  | size_t | nbDescriptors,
|  | double | minValue,
|  | double | maxValue )
| inline

Constructor of the MapElitesArchive.

Parameters

  [in] | nbBinPerDescriptor | Number of bins per descriptor
  [in] | nbDescriptors | Number of descriptors for this archive
  [in] | minValue | Minimum value for the descriptors
  [in] | maxValue | Maximum value for the descriptors

## Member Function Documentation

## ◆ computeIndices()

std::vector< uint64_t > Selector::MapElites::MapElitesArchive::computeIndices | ( | uint64_t | index | ) | const
| virtual

Compute the multi-dimensional indices from linear index.

Parameters

  [in] | index | the linear index to compute

## ◆ computeLinearIndex()

uint64_t Selector::MapElites::MapElitesArchive::computeLinearIndex | ( | const std::vector< uint64_t > & | indices | ) | const
| virtual

Compute the linear index from multi-dimensional indices.

Parameters

  [in] | indices | the multi-dimensional indices to compute the linear index from

## ◆ containsRoot()

bool Selector::MapElites::MapElitesArchive::containsRoot | ( | const TPG::TPGVertex * | root | ) | const
| virtual

Check if the archive contains a root TPGVertex.

Parameters

  [in] | root | the root TPGVertex to check

## ◆ getArchiveAt()

const std::pair< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > & Selector::MapElites::MapElitesArchive::getArchiveAt | ( | const std::vector< uint64_t > & | indices | ) | const
| virtual

Get the archive content at given indices.

Parameters

  [in] | indices | the indices to get the archive content from

## ◆ getArchiveFromDescriptors()

const std::pair< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > & Selector::MapElites::MapElitesArchive::getArchiveFromDescriptors | ( | const std::vector< double > & | descriptors | ) | const
| virtual

Get the archive content at given descriptors.

Parameters

  [in] | descriptors | the descriptors to get the archive content from

Reimplemented in Selector::MapElites::CvtMapElitesArchive.

## ◆ getIndexArchive()

uint64_t Selector::MapElites::MapElitesArchive::getIndexArchive | ( | double | value | ) | const
| virtual

Get the index in one dimension of the archive from a value.

Parameters

  [in] | value | the value to get the index from

## ◆ removeRootFromArchive()

void Selector::MapElites::MapElitesArchive::removeRootFromArchive | ( | const TPG::TPGVertex * | root,
|  | size_t | maxNbEvaluation )
| virtual

Remove a root TPGVertex from the archive.

Parameters

  [in] | root | the root TPGVertex to remove
  [in] | maxNbEvaluation | the maximum number of evaluation allowed

## ◆ removeRootFromArchiveIfNotComplete()

void Selector::MapElites::MapElitesArchive::removeRootFromArchiveIfNotComplete | ( | const TPG::TPGVertex * | root,
|  | size_t | maxNbEvaluation )
| virtual

Remove a root TPGVertex from the archive if its number of evaluation is below maxNbEvaluation.

Parameters

  [in] | root | the root TPGVertex to remove
  [in] | maxNbEvaluation | the maximum number of evaluation allowed

## ◆ setArchiveAt()

void Selector::MapElites::MapElitesArchive::setArchiveAt | ( | const TPG::TPGVertex * | vertex,
|  | std::shared_ptr< Learn::EvaluationResult > | eval,
|  | const std::vector< uint64_t > & | indices )
| virtual

Set the archive content at given indices.

Parameters

  [in] | vertex | the TPGVertex to set in the archive
  [in] | eval | the EvaluationResult to set in the archive
  [in] | indices | the indices to set the archive content at

## ◆ setArchiveFromDescriptors()

void Selector::MapElites::MapElitesArchive::setArchiveFromDescriptors | ( | const TPG::TPGVertex * | vertex,
|  | std::shared_ptr< Learn::EvaluationResult > | eval,
|  | const std::vector< double > & | descriptors )
| virtual

Set the archive content at given descriptors.

Parameters

  [in] | vertex | the TPGVertex to set in the archive
  [in] | eval | the EvaluationResult to set in the archive
  [in] | descriptors | the descriptors to set the archive content at

Reimplemented in Selector::MapElites::CvtMapElitesArchive.

## Member Data Documentation

## ◆ archive

std::vector<std::pair<std::shared_ptr<Learn::EvaluationResult>, const TPG::TPGVertex*> > Selector::MapElites::MapElitesArchive::archive
| protected

The archive storing evaluation results and their corresponding root TPGVertex

The documentation for this class was generated from the following files:

- D:/a/gegelati/gegelati/gegelatilib/include/selector/mapElites/mapElitesArchive.h
- D:/a/gegelati/gegelati/gegelatilib/src/selector/mapElites/mapElitesArchive.cpp