GEGELATI

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Learn::AdversarialLearningEnvironment Class Referenceabstract

Interface for creating a Learning Environment in adversarial mode. More...

`#include <adversarialLearningEnvironment.h>`

Inheritance diagram for Learn::AdversarialLearningEnvironment:

## Public Member Functions
virtual std::shared_ptr< Learn::AdversarialEvaluationResult > | getScores () const =0
| Computes scores of each root and returns them.
double | getScore () const override
| Simply returns the first score of the results, allowing compatibility with non adversarial learning agents.
Public Member Functions inherited from Learn::LearningEnvironment
| LearningEnvironment ()=delete
| Delete the default constructor of a LearningEnvironment.
virtual | ~LearningEnvironment ()=default
| Default virtual destructor.
| LearningEnvironment (uint64_t nbAct, bool isDiscreteEnv=true, const std::vector< uint64_t > &initAct=std::vector< uint64_t >())
| Constructor for LearningEnviroment.
virtual LearningEnvironment * | clone () const
| Get a copy of the LearningEnvironment.
virtual bool | isCopyable () const
| Can the LearningEnvironment be copy constructed to evaluate several LearningAgent in parallel.
virtual bool | isUsingUtility () const
| Is the LearningEnvrionment using a utility in addition to the reward. Information needed for the logs.
uint64_t | getNbActions () const
| Get the number of actions available for this LearningEnvironment.
const std::vector< uint64_t > & | getInitActions () const
| Get the vector of initial actions available for this LearningEnvironment.
const bool | isDiscrete () const
| Get the information of the nature of the environment action type.
virtual void | doAction (double actionID)
| Execute an action on the LearningEnvironment.
virtual void | doActions (std::vector< double > vectActionID)
| Execute actions on the LearningEnvironment.
virtual void | reset (size_t seed=0, LearningMode mode=LearningMode::TRAINING, uint16_t iterationNumber=0, uint64_t generationNumber=0)=0
| Reset the LearningEnvironment.
virtual std::vector< std::reference_wrapper< const Data::DataHandler > > | getDataSources ()=0
| Get the data sources for this LearningEnvironment.
virtual double | getUtility () const
| Returns the current utility of the Environment.
virtual bool | isTerminal () const =0
| Method for checking if the LearningEnvironment has reached a terminal state.

## Additional Inherited Members
Protected Member Functions inherited from Learn::LearningEnvironment
| LearningEnvironment (const LearningEnvironment &other)=default
| Make the default copy constructor protected.
Protected Attributes inherited from Learn::LearningEnvironment
const uint64_t | nbActions
const bool | isDiscreteEnvironment
const std::vector< uint64_t > | initActions

## Detailed Description

Interface for creating a Learning Environment in adversarial mode.

The main difference with the base Learning Environment is that several roots will participate in a single simulation. It is the user responsibility to correctly adapt this class to the problem. In fact, there should be 2 overrides that will be different from the basic Learning Environment :

- doAction will be called by the Learning Agent with participating roots in turn. If there are 3 roots in this simulation, the first will call doAction, then the second one, and the third one. Then, it will be the first root again. Note that each root will use the same dataSource. It means the user has to update the dataSource so that each root will see the input from its point of view (doing that, a root that was first to act will not be lost of it becomes third).
- getScores will be called by the Learning Agent once, at the end of the game. It shall return an evaluation result containing the scores of the roots, in the order in which they participated.

## Member Function Documentation

## ◆ getScore()

double Learn::AdversarialLearningEnvironment::getScore | ( |  | ) | const
| inline override virtual

Simply returns the first score of the results, allowing compatibility with non adversarial learning agents.

Inherited from LearningEnvironment

Returns
  The first score of the evaluation result from getScores().

Implements Learn::LearningEnvironment.

## ◆ getScores()

virtual std::shared_ptr< Learn::AdversarialEvaluationResult > Learn::AdversarialLearningEnvironment::getScores | ( |  | ) | const
| pure virtual

Computes scores of each root and returns them.

Returns
  A shared pointer of an evaluation result containing a score per participant.

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

- D:/a/gegelati/gegelati/gegelatilib/include/learn/adversarialLearningEnvironment.h