37#ifndef SELECTION_METRICS_H
38#define SELECTION_METRICS_H
40#include "learn/learningEnvironment.h"
41#include "tpg/tpgGraph.h"
154 virtual void weightedSum(std::shared_ptr<SelectionMetrics> other,
155 size_t nbEvaluation,
size_t nbEvaluationOther);
176 size_t nbEvaluationOther)
178 value = value * (T)nbEvaluation + valueOther * (T)nbEvaluationOther;
179 value /= (T)(nbEvaluation + nbEvaluationOther);
188 bool operator<(std::shared_ptr<SelectionMetrics> a,
189 std::shared_ptr<SelectionMetrics> b);
Interface for creating a Learning Environment.
Definition learningEnvironment.h:81
Class to extract metrics from either the agent or the environment.
Definition selectionMetrics.h:52
static T weightedSum(T value, T valueOther, size_t nbEvaluation, size_t nbEvaluationOther)
Perform a weighted sum between 2 values.
Definition selectionMetrics.h:175
virtual void initMetrics(const TPG::TPGVertex *agent, const Learn::LearningEnvironment &learningEnvironment)
Init the metrics for the agent in the learning environment.
Definition selectionMetrics.h:106
virtual void weightedSum(std::shared_ptr< SelectionMetrics > other, size_t nbEvaluation, size_t nbEvaluationOther)
Perform a weighted sum between this SelectionMetrics and another.
Definition selectionMetrics.cpp:61
virtual void extractMetricsStep(const TPG::TPGVertex *agent, std::vector< double > actionValues, const Learn::LearningEnvironment &learningEnvironment)
Extract metrics from the agent in the learning environment.
Definition selectionMetrics.h:122
SelectionMetrics(double score, double utility=0)
Constructor with score and utility initialization.
Definition selectionMetrics.h:84
virtual double getUtility() const
Definition selectionMetrics.cpp:44
SelectionMetrics()=default
Default constructor.
double utility
Definition selectionMetrics.h:67
virtual ~SelectionMetrics()=default
Default destructor.
virtual void extractMetricsEpisode(const TPG::TPGVertex *agent, size_t nbStepsExecuted, const Learn::LearningEnvironment &learningEnvironment)
Extract metrics from the agent in the learning environment.
Definition selectionMetrics.cpp:49
friend bool operator<(const SelectionMetrics &lhs, const SelectionMetrics &rhs)
Comparison function to enable sorting of SelectionMetrics with STL.
Definition selectionMetrics.h:159
double score
Definition selectionMetrics.h:57
virtual double getScore() const
Definition selectionMetrics.cpp:39
Abstract class representing the vertices of a TPGGraph.
Definition tpgVertex.h:55
Definition mapElitesArchiveLogger.h:45
bool operator<(std::shared_ptr< SelectionMetrics > a, std::shared_ptr< SelectionMetrics > b)
Comparison function to enable sorting of SelectionMetrics with STL.
Definition selectionMetrics.cpp:75