GEGELATI

Loading...
Searching...
No Matches
adversarialEvaluationResult.h
1
36#ifndef ADVERSARIAL_EVALUATION_RESULT_H
37#define ADVERSARIAL_EVALUATION_RESULT_H
38
39#include <memory>
40#include <stdexcept>
41#include <vector>
42
43#include "learn/evaluationResult.h"
44
45 namespace Learn {
55 class AdversarialEvaluationResult : public EvaluationResult
56 {
57 protected:
59 std::vector<double> scores;
60
61 public:
71 AdversarialEvaluationResult(std::initializer_list<double> res,
72 size_t nbEval = 1)
73 : EvaluationResult(*res.begin(), nbEval), scores(res)
74 {
75 }
76
84 AdversarialEvaluationResult(size_t size, size_t nbEval = 0)
85 : EvaluationResult(0, nbEval), scores(size, 0)
86 {
87 }
88
95 double getScoreOf(int index);
96
106 EvaluationResult& operator+=(const EvaluationResult& other) override;
107
115 virtual EvaluationResult& operator/=(double divisor);
116
124 double getResult() const override;
125
131 size_t getSize() const;
132 };
133} // namespace Learn
134
135#endif
Learn::AdversarialEvaluationResult
Class for storing all results of a policy evaluation in in adversarial mode with an AdversarialLearni...
Definition adversarialEvaluationResult.h:56
Learn::AdversarialEvaluationResult::AdversarialEvaluationResult
AdversarialEvaluationResult(std::initializer_list< double > res, size_t nbEval=1)
Base constructor of EvaluationResult, allowing to set scores and the number of evaluations.
Definition adversarialEvaluationResult.h:71
Learn::AdversarialEvaluationResult::getScoreOf
double getScoreOf(int index)
Simple getter of the score of a single root, given its index.
Definition adversarialEvaluationResult.cpp:39
Learn::AdversarialEvaluationResult::scores
std::vector< double > scores
The scores of the roots, in the order in which they participated.
Definition adversarialEvaluationResult.h:59
Learn::AdversarialEvaluationResult::operator/=
virtual EvaluationResult & operator/=(double divisor)
Division operator for AdversarialEvaluationResult that simply divides all scores contained in the sco...
Definition adversarialEvaluationResult.cpp:78
Learn::AdversarialEvaluationResult::AdversarialEvaluationResult
AdversarialEvaluationResult(size_t size, size_t nbEval=0)
Constructor initializing scores as empty.
Definition adversarialEvaluationResult.h:84
Learn::AdversarialEvaluationResult::operator+=
EvaluationResult & operator+=(const EvaluationResult &other) override
Polymorphic addition assignement operator for AdversariEalvaluationResult.
Definition adversarialEvaluationResult.cpp:44
Learn::AdversarialEvaluationResult::getSize
size_t getSize() const
Getter fot the size of scores.
Definition adversarialEvaluationResult.cpp:96
Learn::AdversarialEvaluationResult::getResult
double getResult() const override
Returns the mean of the scores, used for example in a simple learning agent as the root will play aga...
Definition adversarialEvaluationResult.cpp:87
Learn::EvaluationResult
Base class for storing all result of a policy evaluation within a LearningEnvironment.
Definition evaluationResult.h:54
Learn
Definition adversarialEvaluationResult.h:45