Grail (C++)  1.2.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
DecisionNode.h
1 // Copyright QED Software 2023.
2 
3 #ifndef GRAIL_DECISION_NODE_H
4 #define GRAIL_DECISION_NODE_H
5 
6 #include <memory>
7 #include <string>
8 #include <unordered_map>
9 #include <vector>
10 #include "DecisionNodeType.h"
11 
12 namespace grail
13 {
14 namespace simgames
15 {
16 namespace dt
17 {
18  const int decisionTreeMaxDepth = 99999;
19 
23  template <class TDecisionType>
24  struct DecisionNode
25  {
26  virtual ~DecisionNode()
27  {
28  }
29 
30  const virtual TDecisionType* Predict(std::vector<float>& data) const = 0;
31  virtual void Print(std::unordered_map<int, std::string>& columnNames,
32  const std::string& indent = "") const = 0;
33  virtual DecisionNodeType GetNodeType() const = 0;
34  template <class T>
35  friend struct IDecisionTreeSerializer;
36  };
37 }
38 }
39 }
40 
41 #endif //GRAIL_DECISION_NODE_H
grail::simgames::dt::DecisionNode
Class for internal usage. Decision tree node base type.
Definition: DecisionNode.h:24
grail::simgames::dt::IDecisionTreeSerializer
A base class for an object that is passed to Serialize() and Deserialize() methods of DecisionTree....
Definition: DecisionTree.hh:27