Grail (C++)  1.1.1
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::simulation::OfflineLearner Class Reference

This is the main class you will use to peform the offline learning process. Assign it to the unit of a SimulatedGame. It will gather properly vectorized data. You get access to this data by methods of this class. More...

#include <OfflineLearner.hh>

Public Member Functions

 OfflineLearner (std::unique_ptr< IVectorizer > vectorizer)
 Constructs a new OfflineLearner object. More...
 
void ClearData ()
 Clears all data gathered for the game. You may want to call it after you already use the data but you want to continue using the OfflineLearning object.
 
std::unique_ptr< UniqueTreeDatasetGetSamplesDataset (double minFractionOfSimulationsThreshold=0.7)
 Gets data gathered by OfflineLearner in the form of UniqueTreeDataset. More...
 
void FillSamplesDataset (UniqueTreeDataset &dataset, double minFractionOfSimulationsThreshold=0.7)
 Gets data gathered by OfflineLearner and adds it to dataset. Pass the container you want to add data to. More...
 

Friends

class SimulatedGameThinkingUnit
 

Detailed Description

This is the main class you will use to peform the offline learning process. Assign it to the unit of a SimulatedGame. It will gather properly vectorized data. You get access to this data by methods of this class.

Constructor & Destructor Documentation

◆ OfflineLearner()

grail::simulation::OfflineLearner::OfflineLearner ( std::unique_ptr< IVectorizer vectorizer)

Constructs a new OfflineLearner object.

Parameters
vectorizerObject that implements the @IVectorizer interface. It will provide the way of gathering data.

Member Function Documentation

◆ FillSamplesDataset()

void grail::simulation::OfflineLearner::FillSamplesDataset ( UniqueTreeDataset dataset,
double  minFractionOfSimulationsThreshold = 0.7 
)

Gets data gathered by OfflineLearner and adds it to dataset. Pass the container you want to add data to.

Parameters
datasetOutput dataset to write the data.
minFractionOfSimulationsThresholdThreshold that defines which game states will contribute to learning. This value is multiplied by MAX - the number of visits to the starting state, which is equal to the number of training simulations States with at least [minFractionOfSimulationsThreshold * MAX] visits will contribute to learning.

◆ GetSamplesDataset()

std::unique_ptr< UniqueTreeDataset > grail::simulation::OfflineLearner::GetSamplesDataset ( double  minFractionOfSimulationsThreshold = 0.7)

Gets data gathered by OfflineLearner in the form of UniqueTreeDataset.

Parameters
minFractionOfSimulationsThresholdThreshold that defines which game states will contribute to learning. This value is multiplied by MAX - the number of visits to the starting state, which is equal to the number of training simulations States with at least [minFractionOfSimulationsThreshold * MAX] visits will contribute to learning.
Returns

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