(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
UniqueTreeDataset.hh
1 #ifndef GRAIL_UNIQUE_TREE_DATASET_H
2 #define GRAIL_UNIQUE_TREE_DATASET_H
3 
4 #include "../ISimulatedGameAction.hh"
5 #include "../DT/DTConsiderationType.hh"
6 #include <unordered_set>
7 #include <initializer_list>
8 #include <memory>
9 
10 namespace grail
11 {
12  namespace simulation
13  {
14  class TreeDataSample;
15  class ISimulatedGameAction;
16  class Dataset;
17 
19  {
20  public:
21  virtual ~UniqueTreeDataset();
22 
24  void Add(std::unique_ptr<TreeDataSample> sample);
25 
27  void Add(std::vector<float>& data, const ISimulatedGameAction* action);
28 
30  std::unique_ptr<Dataset> ConvertToDataset(const std::initializer_list<DTConsiderationType>& considerationTypes);
31 
33  std::unique_ptr<Dataset> ConvertToDataset(const std::vector<DTConsiderationType>& considerationTypes);
34 
37  std::unique_ptr<Dataset> ConvertToDataset(DTConsiderationType considerationType, int count);
38  private:
39  std::unordered_set<std::unique_ptr<TreeDataSample>, HashForOfflineLearning, EqualsForOfflineLearning> samples;
40  };
41  }
42 }
43 
44 #endif //GRAIL_UNIQUE_TREE_DATASET_H
Base class for all actions in SimulatedGame. Derive from it for your actions.
Definition: ISimulatedGameAction.hh:41
Definition: UniqueTreeDataset.hh:19
void Add(std::unique_ptr< TreeDataSample > sample)
Adds a new sample.
Definition: UniqueTreeDataset.cpp:9
std::unique_ptr< Dataset > ConvertToDataset(const std::initializer_list< DTConsiderationType > &considerationTypes)
Converts to a flat dataset - with the chosen decision - that is suitable for constructing the Decisio...
Definition: UniqueTreeDataset.cpp:25
Helper that provides a EqualsForLearning() method. Used with ISimulatedGameAction only by OfflineLear...
Definition: ISimulatedGameAction.hh:25
Helper that provides a HashForLearning() method. Used with ISimulatedGameAction only by OfflineLearni...
Definition: ISimulatedGameAction.hh:15