Grail (C++)  1.2.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
TreeDataSample.hh
1 // Copyright QED Software 2023.
2 
3 #ifndef GRAIL_TREE_DATA_SAMPLE_H
4 #define GRAIL_TREE_DATA_SAMPLE_H
5 
6 #include <memory>
7 #include <vector>
8 #include "C45GameActionCounter.h"
9 
10 namespace grail
11 {
12 namespace simgames
13 {
14  class ISimulatedGameAction;
15 
16 namespace learn
17 {
18  struct DatasetSample;
19 
21  {
22  public:
23  TreeDataSample(std::vector<float>& initData);
24  TreeDataSample(std::vector<float>& initData, const ISimulatedGameAction* decision);
25 
26  virtual ~TreeDataSample();
27 
28  void AddDecision(const ISimulatedGameAction* decision);
29  std::unique_ptr<DatasetSample> Reduce();
30  const ISimulatedGameAction* GetFirstDecision() const;
31 
32  size_t HashForLearning() const;
33  bool EqualsForLearning(const TreeDataSample& other) const;
34 
35  std::vector<float> data;
36 
37  private:
38  C45GameActionCounter counter;
39  };
40 }
41 }
42 }
43 
44 #endif //GRAIL_TREE_DATA_SAMPLE_H
grail::simgames::learn::C45GameActionCounter
The whole class should be INTERNAL; part of the private interface.
Definition: C45GameActionCounter.h:17
grail::simgames::ISimulatedGameAction
Base class for all actions in SimulatedGame. Derive from it for your actions.
Definition: ISimulatedGameAction.hh:41
grail::simgames::learn::TreeDataSample
Definition: TreeDataSample.hh:20