GEGELATI
Loading...
Searching...
No Matches
evaluationResult.h
1
37#ifndef EVALUATION_RESULT_H
38#define EVALUATION_RESULT_H
39
40#include <cmath>
41#include <memory>
42
43#include "selector/selectionMetrics.h"
44namespace Learn {
55 {
56 protected:
60 std::shared_ptr<Selector::SelectionMetrics> selectionMetrics;
61
64
65 public:
69 EvaluationResult() = delete;
70
74 virtual ~EvaluationResult() = default;
75
84 std::shared_ptr<Selector::SelectionMetrics> selectionMetrics,
85 const size_t& nbEval)
87
92 virtual std::shared_ptr<Selector::SelectionMetrics>
93 getSelectionMetrics() const;
94
99 virtual size_t getNbEvaluation() const;
100
108 virtual EvaluationResult& operator+=(const EvaluationResult& other);
109 };
110
115 bool operator<(const EvaluationResult& a, const EvaluationResult& b);
116} // namespace Learn
117
118namespace std {
120 template <> struct less<std::shared_ptr<Learn::EvaluationResult>>
121 {
123 bool operator()(const std::shared_ptr<Learn::EvaluationResult>& a,
124 const std::shared_ptr<Learn::EvaluationResult>& b) const
125 {
126 return *a < *b;
127 }
128 };
129}; // namespace std
130
131#endif
Base class for storing all result of a policy evaluation within a LearningEnvironment.
Definition evaluationResult.h:55
size_t nbEvaluation
Number of evaluation leading to this result.
Definition evaluationResult.h:63
virtual size_t getNbEvaluation() const
Virtual method to get the default number of evaluation of the EvaluationResult.
Definition evaluationResult.cpp:46
virtual ~EvaluationResult()=default
Virtual destructor for polymorphism.
virtual EvaluationResult & operator+=(const EvaluationResult &other)
Polymorphic addition assignement operator for EvaluationResult.
Definition evaluationResult.cpp:51
EvaluationResult()=delete
Deleted default constructor.
std::shared_ptr< Selector::SelectionMetrics > selectionMetrics
Definition evaluationResult.h:60
EvaluationResult(std::shared_ptr< Selector::SelectionMetrics > selectionMetrics, const size_t &nbEval)
Construct a result from a simple double value.
Definition evaluationResult.h:83
virtual std::shared_ptr< Selector::SelectionMetrics > getSelectionMetrics() const
Virtual method to get the default double equivalent of the reward of the EvaluationResult.
Definition evaluationResult.cpp:41
Definition classificationLearningEnvironment.h:44
bool operator<(const EvaluationResult &a, const EvaluationResult &b)
Comparison function to enable sorting of EvaluationResult with STL.
Definition evaluationResult.cpp:75
bool operator()(const std::shared_ptr< Learn::EvaluationResult > &a, const std::shared_ptr< Learn::EvaluationResult > &b) const
Comparison operator for sorted containers.
Definition evaluationResult.h:123