Grail (C++)  1.2.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
EvaluationDebugData.h
1 // Copyright QED Software 2023.
2 
3 #ifndef GRAIL_EVALUATION_DEBUG_DATA_H
4 #define GRAIL_EVALUATION_DEBUG_DATA_H
5 
6 #include <string>
7 #include <vector>
8 #include "../UtilityModel/EvaluatorType.h"
9 
10 namespace YAML
11 {
12  template <typename DataType>
13  struct convert;
14 }
15 
16 namespace grail
17 {
18 namespace data
19 {
24  {
25  friend struct YAML::convert<EvaluationDebugData>;
26  public:
33  EvaluationDebugData(EvaluatorType evaluatorType, float score, std::size_t nodeIndex);
34  EvaluationDebugData() = default;
35 
40  void AddChildNode(std::size_t childNodeIndex);
41 
46  EvaluatorType GetEvaluatorType() const;
47 
52  float GetScore() const;
53 
58  std::size_t GetNodeIndex() const;
59 
64  const std::vector<std::size_t>& GetChildNodes() const;
65 
70  const std::string& GetMetadata() const;
71 
72  void SetMetadata(const std::string& newMetadata);
73 
74  private:
75  EvaluatorType evaluatorType{};
76  float score{};
77  std::size_t nodeIndex{};
78  std::vector<std::size_t> childNodes{};
79  std::string metadata{};
80  };
81 }
82 }
83 
84 #endif
grail::data::EvaluationDebugData
The EvaluationDebugData class - debug data describing singular evaluator.
Definition: EvaluationDebugData.h:23
grail::data::EvaluationDebugData::GetEvaluatorType
EvaluatorType GetEvaluatorType() const
GetEvaluatorType - provides type of the evalutor described by this debug data.
Definition: EvaluationDebugData.cpp:19
grail::data::EvaluationDebugData::GetMetadata
const std::string & GetMetadata() const
GetMetadata - provides a metadata string.
Definition: EvaluationDebugData.cpp:23
grail::data::EvaluationDebugData::GetScore
float GetScore() const
GetScore - provides output of the evaluator descibed by this debug data.
Definition: EvaluationDebugData.cpp:20
grail::data::EvaluationDebugData::GetChildNodes
const std::vector< std::size_t > & GetChildNodes() const
GetChildNodes - provides indexes of all nodes attached to this node as children.
Definition: EvaluationDebugData.cpp:22
grail::data::EvaluationDebugData::AddChildNode
void AddChildNode(std::size_t childNodeIndex)
AddChildNode - add node as leaf/child to this data node.
Definition: EvaluationDebugData.cpp:14
grail::data::EvaluationDebugData::GetNodeIndex
std::size_t GetNodeIndex() const
GetNodeIndex - provides this nodes position in debug tree.
Definition: EvaluationDebugData.cpp:21