(C++)  1.1.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::utility::Evaluator< ContextType > Class Template Referenceabstract

The Evaluator class - base class being able to evaluate given context and output the result. More...

#include <Evaluator.hh>

Inheritance diagram for grail::utility::Evaluator< ContextType >:

Public Member Functions

float EvaluateContext (const ContextType &context, UtilityEvaluatorSnapshot *const snapshot) const
 EvaluateContext - evaluates provided context and if provided snapshot is not empty, fills it with debug data describing this node. More...
 
virtual EvaluatorType GetEvaluatorType () const =0
 

Protected Member Functions

virtual float Evaluate (const ContextType &context, UtilityEvaluatorSnapshot *const snapshot) const =0
 Evaluate - Called from EvaluateContext which also evaluates context, but without automatically filling snapshot with debug data. Should be overriden for each derived Evaluator. More...
 
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. Should be overriden in each derived evaluator to better reflect debug tree topology. More...
 

Detailed Description

template<typename ContextType>
class grail::utility::Evaluator< ContextType >

The Evaluator class - base class being able to evaluate given context and output the result.

Member Function Documentation

◆ DebugDump()

template<typename ContextType >
virtual void grail::utility::Evaluator< ContextType >::DebugDump ( const std::map< const void *, std::size_t > &  nodeMapping,
EvaluationDebugData debugData 
) const
protectedpure virtual

DebugDump - Called from EvaluateContext, which generates additional debug data for each evaluator. Should be overriden in each derived evaluator to better reflect debug tree topology.

Parameters
nodeMapping- Maps node pointers to node index.
debugData- Evaluation debug data which will be filled in this method

Implemented in grail::curves::Curve< ContextType >, grail::utility::Aggregator< ContextType >, and grail::utility::Consideration< ContextType >.

◆ Evaluate()

template<typename ContextType >
virtual float grail::utility::Evaluator< ContextType >::Evaluate ( const ContextType &  context,
UtilityEvaluatorSnapshot *const  snapshot 
) const
protectedpure virtual

Evaluate - Called from EvaluateContext which also evaluates context, but without automatically filling snapshot with debug data. Should be overriden for each derived Evaluator.

Parameters
context- Input data for evaluation
snapshot- Evaluator snapshot containing debug data describing whole evaluator tree.
Returns
Numerical evaluation of provided context.

Implemented in grail::curves::Curve< ContextType >, grail::utility::Consideration< ContextType >, grail::utility::SumAggregator< ContextType >, grail::utility::ProductAggregator< ContextType >, grail::utility::MinAggregator< ContextType >, grail::utility::MaxAggregator< ContextType >, and grail::utility::AverageAggregator< ContextType >.

◆ EvaluateContext()

template<typename ContextType >
float grail::utility::Evaluator< ContextType >::EvaluateContext ( const ContextType &  context,
UtilityEvaluatorSnapshot *const  snapshot 
) const
inline

EvaluateContext - evaluates provided context and if provided snapshot is not empty, fills it with debug data describing this node.

Parameters
context- input data for evaluation
snapshot- evaluator snapshot containing debug data describing whole evaluator tree
Returns
evaluation score

The documentation for this class was generated from the following file: