|
GEGELATI
|
Class to extract metrics from either the agent or the environment. More...
#include <selectionMetrics.h>
Public Member Functions | |
| 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 |
| virtual void | initMetrics (const TPG::TPGVertex *agent, const Learn::LearningEnvironment &learningEnvironment) |
| Init the metrics for the agent in the learning environment. | |
| virtual void | extractMetricsStep (const TPG::TPGVertex *agent, std::vector< double > actionValues, const Learn::LearningEnvironment &learningEnvironment) |
| Extract metrics from the agent in the learning environment. | |
| virtual void | extractMetricsEpisode (const TPG::TPGVertex *agent, size_t nbStepsExecuted, const Learn::LearningEnvironment &learningEnvironment) |
| Extract metrics from the agent in the learning environment. | |
| virtual void | weightedSum (std::shared_ptr< SelectionMetrics > other, size_t nbEvaluation, size_t nbEvaluationOther) |
| Perform a weighted sum between this SelectionMetrics and another. | |
Static Public Member Functions | |
| template<class T > | |
| static T | weightedSum (T value, T valueOther, size_t nbEvaluation, size_t nbEvaluationOther) |
| Perform a weighted sum between 2 values. | |
Protected Attributes | |
| double | score = 0 |
| double | utility = 0 |
Friends | |
| bool | operator< (const SelectionMetrics &lhs, const SelectionMetrics &rhs) |
| Comparison function to enable sorting of SelectionMetrics with STL. | |
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.
|
inline |
Constructor with score and utility initialization.
| [in] | score | the score obtained by the agent. |
| [in] | utility | the utility obtained by the agent. |
|
virtual |
Extract metrics from the agent in the learning environment.
This method is called at the end of every episode of the environment evaluation.
| [in] | agent | the TPGVertex representing the agent. |
| [in] | nbStepsExecuted | number of steps executed at the end of the episode. |
| [in] | learningEnvironment | the learning environment in which the agent is evaluated. |
Reimplemented in Selector::ClassificationSelectionMetrics, and Selector::MapElites::MapElitesSelectionMetrics.
|
inlinevirtual |
Extract metrics from the agent in the learning environment.
This method is called at every step of the environment evaluation.
| [in] | agent | the TPGVertex representing the agent. |
| [in] | actionValues | the action values taken by the agent. |
| [in] | learningEnvironment | the learning environment in which the agent is evaluated. |
Reimplemented in Selector::TimingSelectionMetrics, and Selector::MapElites::MapElitesSelectionMetrics.
|
virtual |
Return the score of the agent.
Reimplemented in Selector::TimingSelectionMetrics.
|
virtual |
Return the utility of the agent.
Reimplemented in Selector::TimingSelectionMetrics.
|
inlinevirtual |
Init the metrics for the agent in the learning environment.
This method is called at the beginning of the evaluateJob method.
| [in] | agent | the TPGVertex representing the agent. |
| [in] | learningEnvironment | the learning environment in which the agent is evaluated. |
Reimplemented in Selector::ClassificationSelectionMetrics, and Selector::MapElites::MapElitesSelectionMetrics.
|
virtual |
Perform a weighted sum between this SelectionMetrics and another.
| [in] | other | the other SelectionMetrics to combine with this. |
| [in] | nbEvaluation | the number of evaluation used to obtain this SelectionMetrics. |
| [in] | nbEvaluationOther | the number of evaluation used to obtain the other SelectionMetrics. |
Reimplemented in Selector::ClassificationSelectionMetrics, Selector::MapElites::MapElitesSelectionMetrics, and Selector::TimingSelectionMetrics.
|
inlinestatic |
Perform a weighted sum between 2 values.
| [in] | value | the value to combine. |
| [in] | valueOther | the other value to combine. |
| [in] | nbEvaluation | the number of evaluations to obtain value. |
| [in] | nbEvaluationOther | the number of evaluations to obtain valueOther. |
|
protected |
Score obtained by the agent at the end of an episode
|
protected |
Double value for the utility. Utility is used only if the LearningEnvironment override the specific method. The utility represent a score needed for logs but not for learning.
It can be used for comparison with different score rules for example.