1 #ifndef GRAIL_EVALUATOR_H
2 #define GRAIL_EVALUATOR_H
4 #include "../GrailData/UtilityModel/EvaluatorType.h"
5 #include "../GrailData/DebugInfo/UtilityEvaluatorSnapshot.h"
16 template <
typename ContextType>
31 float score =
Evaluate(context, snapshot);
32 if(snapshot !=
nullptr)
34 std::size_t nodeIndex = snapshot->
AddNode(
this);
42 virtual EvaluatorType GetEvaluatorType()
const =0;
The EvaluationDebugData class - debug data describing singular evaluator.
Definition: EvaluationDebugData.h:20
The UtilityEvaluatorSnapshot class - debug snapshot of whole evaluator tree assigned to evaluated obj...
Definition: UtilityEvaluatorSnapshot.h:22
std::size_t AddNode(const void *nodePointer)
AddNode - assign index indicating position in debug tree to the given node pointer.
Definition: UtilityEvaluatorSnapshot.cpp:15
const std::map< const void *, std::size_t > & GetNodeMapping() const
GetNodeMapping.
Definition: UtilityEvaluatorSnapshot.cpp:26
void AddEvaluation(EvaluationDebugData &&debugData)
AddEvaluation - add debug data describing singular evaluator node to this snapshot.
Definition: UtilityEvaluatorSnapshot.cpp:10
The Evaluator class - base class being able to evaluate given context and output the result.
Definition: Evaluator.hh:21
virtual float Evaluate(const ContextType &context, UtilityEvaluatorSnapshot *const snapshot) const =0
Evaluate - Called from EvaluateContext which also evaluates context, but without automatically fillin...
float EvaluateContext(const ContextType &context, UtilityEvaluatorSnapshot *const snapshot) const
EvaluateContext - evaluates provided context and if provided snapshot is not empty,...
Definition: Evaluator.hh:29
virtual void DebugDump(const std::map< const void *, std::size_t > &nodeMapping, EvaluationDebugData &debugData) const =0
DebugDump - Called from EvaluateContext, which generates additional debug data for each evaluator....