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

Class to extract metrics from either the agent or the environment. More...

#include <mapElitesSelectionMetrics.h>

Inheritance diagram for Selector::MapElites::MapElitesSelectionMetrics:
Selector::SelectionMetrics

Public Member Functions

 MapElitesSelectionMetrics (std::vector< std::shared_ptr< const MapElitesDescriptor > > descriptors)
 Default constructor of MapEliteselectionMetrics with a vector of descriptors.
 
 MapElitesSelectionMetrics (double score, const std::map< std::shared_ptr< const MapElitesDescriptor >, std::vector< double > > &mapDescriptors)
 Constructor of MapEliteselectionMetrics with a vector of scores.
 
 MapElitesSelectionMetrics (double score)
 Constructor of MapEliteselectionMetrics with a vector of scores.
 
const std::map< std::shared_ptr< const MapElitesDescriptor >, std::vector< double > > & getMapDescriptors () const
 Get a const ref to the scorePerClass attribute.
 
void initMetrics (const TPG::TPGVertex *agent, const Learn::LearningEnvironment &learningEnvironment) override
 Specialization of the initialisation of the metrics.
 
void extractMetricsStep (const TPG::TPGVertex *agent, std::vector< double > actionValues, const Learn::LearningEnvironment &learningEnvironment) override
 Specialization of the extraction of the metrics at the end of an episode.
 
void extractMetricsEpisode (const TPG::TPGVertex *agent, size_t nbStepsExecuted, const Learn::LearningEnvironment &learningEnvironment) override
 Specialization of the extraction of the metrics at the end of an episode.
 
virtual void weightedSum (std::shared_ptr< SelectionMetrics > other, size_t nbEvaluation, size_t nbEvaluationOther) override
 Specialization of weightedSum method to add the score per class and nbEvalPerClass.
 
- Public Member Functions inherited from Selector::SelectionMetrics
 SelectionMetrics ()=default
 Default constructor.
 
virtual ~SelectionMetrics ()=default
 Default destructor.
 
 SelectionMetrics (double score, double utility=0)
 Constructor with score and utility initialization.
 
virtual double getScore () const
 
virtual double getUtility () const
 

Protected Attributes

std::map< std::shared_ptr< const MapElitesDescriptor >, std::vector< double > > mapDescriptors
 Map storing a descriptor and a Vector storing a double value per descriptor (i.e. per Action) of a classification LearningEnvironment.
 
- Protected Attributes inherited from Selector::SelectionMetrics
double score = 0
 
double utility = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from Selector::SelectionMetrics
template<class T >
static T weightedSum (T value, T valueOther, size_t nbEvaluation, size_t nbEvaluationOther)
 Perform a weighted sum between 2 values.
 

Detailed Description

Class to extract metrics from either the agent or the environment.

This metrics can be used to specify the selection of the selector. This class does not implement any metrics, it need to be override by the different selection methods.

Constructor & Destructor Documentation

◆ MapElitesSelectionMetrics() [1/3]

Selector::MapElites::MapElitesSelectionMetrics::MapElitesSelectionMetrics ( std::vector< std::shared_ptr< const MapElitesDescriptor > > descriptors)
inline

Default constructor of MapEliteselectionMetrics with a vector of descriptors.

Parameters
[in]descriptorsthe vector of descriptors to use.

◆ MapElitesSelectionMetrics() [2/3]

Selector::MapElites::MapElitesSelectionMetrics::MapElitesSelectionMetrics ( double score,
const std::map< std::shared_ptr< const MapElitesDescriptor >, std::vector< double > > & mapDescriptors )
inline

Constructor of MapEliteselectionMetrics with a vector of scores.

Parameters
[in]scorethe score obtained by the agent.
[in]mapDescriptorsthe map of descriptors associated to their descriptor values.

◆ MapElitesSelectionMetrics() [3/3]

Selector::MapElites::MapElitesSelectionMetrics::MapElitesSelectionMetrics ( double score)
inline

Constructor of MapEliteselectionMetrics with a vector of scores.

Parameters
[in]scorethe score obtained by the agent.

Member Function Documentation

◆ extractMetricsEpisode()

void Selector::MapElites::MapElitesSelectionMetrics::extractMetricsEpisode ( const TPG::TPGVertex * agent,
size_t nbStepsExecuted,
const Learn::LearningEnvironment & learningEnvironment )
overridevirtual

Specialization of the extraction of the metrics at the end of an episode.

Reimplemented from Selector::SelectionMetrics.

◆ extractMetricsStep()

void Selector::MapElites::MapElitesSelectionMetrics::extractMetricsStep ( const TPG::TPGVertex * agent,
std::vector< double > actionValues,
const Learn::LearningEnvironment & learningEnvironment )
overridevirtual

Specialization of the extraction of the metrics at the end of an episode.

Reimplemented from Selector::SelectionMetrics.

◆ getMapDescriptors()

const std::map< std::shared_ptr< const Selector::MapElites::MapElitesDescriptor >, std::vector< double > > & Selector::MapElites::MapElitesSelectionMetrics::getMapDescriptors ( ) const

Get a const ref to the scorePerClass attribute.

Copyright or © or Copr. IETR/INSA - Rennes (2025) :

Quentin Vacher qvach.nosp@m.er@i.nosp@m.nsa-r.nosp@m.enne.nosp@m.s.fr (2025)

GEGELATI is an open-source reinforcement learning framework for training artificial intelligence based on Tangled Program Graphs (TPGs).

This software is governed by the CeCILL-C license under French law and abiding by the rules of distribution of free software. You can use, modify and/ or redistribute the software under the terms of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".

As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.

In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.

The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms.

◆ initMetrics()

void Selector::MapElites::MapElitesSelectionMetrics::initMetrics ( const TPG::TPGVertex * agent,
const Learn::LearningEnvironment & learningEnvironment )
overridevirtual

Specialization of the initialisation of the metrics.

Reimplemented from Selector::SelectionMetrics.

◆ weightedSum()

void Selector::MapElites::MapElitesSelectionMetrics::weightedSum ( std::shared_ptr< SelectionMetrics > other,
size_t nbEvaluation,
size_t nbEvaluationOther )
overridevirtual

Specialization of weightedSum method to add the score per class and nbEvalPerClass.

Reimplemented from Selector::SelectionMetrics.


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