|
Grail (C++)
1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
|
3 #ifndef GRAIL_EVALUATOR_H
4 #define GRAIL_EVALUATOR_H
6 #include "../GrailData/DebugInfo/UtilityEvaluatorSnapshot.h"
7 #include "../GrailData/UtilityModel/EvaluatorType.h"
18 template<
typename ContextType>
21 template <
typename ContextType>
36 float score =
Evaluate(context, snapshot);
37 if(snapshot !=
nullptr)
39 unsigned int nodeIndex = snapshot->
AddNode(
this);
47 virtual data::EvaluatorType GetEvaluatorType()
const =0;
64 virtual void DebugDump(
const std::map<const void*, unsigned int>& nodeMapping,
69 #endif //GRAIL_EVALUATOR_H
The EvaluationDebugData class - debug data describing singular evaluator.
Definition: EvaluationDebugData.h:24
float EvaluateContext(const ContextType &context, data::UtilityEvaluatorSnapshot *const snapshot) const
EvaluateContext - evaluates provided context and if provided snapshot is not empty,...
Definition: Evaluator.hh:34
virtual float Evaluate(const ContextType &context, data::UtilityEvaluatorSnapshot *const snapshot) const =0
Evaluate - Called from EvaluateContext which also evaluates context, but without automatically fillin...
The Evaluator class - base class being able to evaluate given context and output the result.
Definition: Evaluator.hh:25
unsigned int AddNode(const void *nodePointer)
AddNode - assign index indicating position in debug tree to the given node pointer.
Definition: UtilityEvaluatorSnapshot.cpp:21
const std::map< const void *, unsigned int > & GetNodeMapping() const
GetNodeMapping.
Definition: UtilityEvaluatorSnapshot.cpp:32
The Consideration class - Abstract type of Evaluator representing a subset of game state.
Definition: Consideration.hh:20
virtual void DebugDump(const std::map< const void *, unsigned int > &nodeMapping, data::EvaluationDebugData &debugData) const =0
DebugDump - Called from EvaluateContext, which generates additional debug data for each evaluator....
void AddEvaluation(EvaluationDebugData &&debugData)
AddEvaluation - add debug data describing singular evaluator node to this snapshot.
Definition: UtilityEvaluatorSnapshot.cpp:16
The UtilityEvaluatorSnapshot class - debug snapshot of whole evaluator tree assigned to evaluated obj...
Definition: UtilityEvaluatorSnapshot.h:26