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

The UtilityEvaluator class - Standard evaluator calculating scores based on considerations and curves. More...

#include <Evaluator.hh>

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

Public Types

using CurveDataPair = std::pair< std::shared_ptr< Consideration< ContextType > >, std::shared_ptr< curves::Curve > >
 

Public Member Functions

 Evaluator (WeightEvaluationMethod evaluationMethod, const std::vector< CurveDataPair > &curveData)
 UtilityEvaluator. More...
 
 Evaluator (const Evaluator< ContextType > &)=default
 
 Evaluator (Evaluator< ContextType > &&)=default
 
Evaluatoroperator= (const Evaluator< ContextType > &)=default
 
Evaluatoroperator= (Evaluator< ContextType > &&)=default
 
float EvaluateWeight (const ContextType &object) const override
 EvaluateWeight - Evaluates weight using provided evaluation method. More...
 
int EvaluateRank () const override
 EvaluateRank - Evaluates rank by choosing highest rank from all of it's owned considerations. More...
 
const std::vector< CurveDataPair > & GetCurveData () const
 
WeightEvaluationMethod GetEvaluationMethod () const override
 

Protected Member Functions

float EvaluateConsiderations (const std::shared_ptr< Consideration< ContextType >> &consideration, const ContextType &object) const
 

Detailed Description

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

The UtilityEvaluator class - Standard evaluator calculating scores based on considerations and curves.

Constructor & Destructor Documentation

◆ Evaluator()

template<typename ContextType >
grail::utility::Evaluator< ContextType >::Evaluator ( WeightEvaluationMethod  evaluationMethod,
const std::vector< CurveDataPair > &  curveData 
)
inline

UtilityEvaluator.

Parameters
evaluationMethod- score aggregation method (MAX, MIN, AVERAGE, ADD, MULTIPLY)
curveData- container of considerations paired with curves

Member Function Documentation

◆ EvaluateRank()

template<typename ContextType >
int grail::utility::Evaluator< ContextType >::EvaluateRank ( ) const
inlineoverridevirtual

EvaluateRank - Evaluates rank by choosing highest rank from all of it's owned considerations.

Returns
rank - measure of importance of evaluated object

Implements grail::utility::IEvaluator< ContextType >.

◆ EvaluateWeight()

template<typename ContextType >
float grail::utility::Evaluator< ContextType >::EvaluateWeight ( const ContextType &  object) const
inlineoverridevirtual

EvaluateWeight - Evaluates weight using provided evaluation method.

Parameters
object
Returns
weight - measure of suitability of evaluated object in given Context

Implements grail::utility::IEvaluator< ContextType >.


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