Grail (C++)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::evaluator::Consideration< ContextType > Class Template Referenceabstract

The Consideration class - Abstract type of Evaluator representing a subset of game state. More...

#include <Consideration.hh>

Inheritance diagram for grail::evaluator::Consideration< ContextType >:
Collaboration diagram for grail::evaluator::Consideration< ContextType >:

Public Member Functions

 Consideration (const Consideration< ContextType > &)=default
 
 Consideration (Consideration< ContextType > &&)=default
 
Considerationoperator= (const Consideration< ContextType > &)=default
 
Considerationoperator= (Consideration< ContextType > &&)=default
 
virtual data::EvaluatorType GetEvaluatorType () const override final
 
virtual std::string GetDisplayName () const
 
virtual void GetDependentConsiderations (std::vector< Consideration< ContextType > * > &considerations) override
 
- Public Member Functions inherited from grail::evaluator::Evaluator< ContextType >
float EvaluateContext (const ContextType &context, data::UtilityEvaluatorSnapshot *const snapshot) const
 EvaluateContext - evaluates provided context and if provided snapshot is not empty, fills it with debug data describing this node. More...
 

Protected Member Functions

virtual float Evaluate (const ContextType &context) const =0
 Evaluate - Abstract method, which should be overriden by the user to return proper value representing desirable subset of game state. More...
 
virtual void DebugDump (const std::map< const void *, unsigned int > &, data::EvaluationDebugData &debugData) const override final
 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...
 
virtual float Evaluate (const ContextType &context, data::UtilityEvaluatorSnapshot *const snapshot) const override final
 Evaluate - Called from EvaluateContext which also evaluates context, but without automatically filling snapshot with debug data. Should be overriden for each derived Evaluator. More...
 

Friends

template<typename FunctionContextType >
void CacheConsiderationEvaluations (std::shared_ptr< Evaluator< FunctionContextType >> evaluator, FunctionContextType context)
 

Detailed Description

template<typename ContextType>
class grail::evaluator::Consideration< ContextType >

The Consideration class - Abstract type of Evaluator representing a subset of game state.

Template Parameters
ContextType- Type of evaluated object. By default - ValueTuple(AIEntity, Blackboard).

Member Function Documentation

◆ DebugDump()

template<typename ContextType >
virtual void grail::evaluator::Consideration< ContextType >::DebugDump ( const std::map< const void *, unsigned int > &  nodeMapping,
data::EvaluationDebugData debugData 
) const
inlinefinaloverrideprotectedvirtual

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

Implements grail::evaluator::Evaluator< ContextType >.

◆ Evaluate() [1/2]

template<typename ContextType >
virtual float grail::evaluator::Consideration< ContextType >::Evaluate ( const ContextType &  context) const
protectedpure virtual

Evaluate - Abstract method, which should be overriden by the user to return proper value representing desirable subset of game state.

Parameters
context- Object from which user can calculate desirable subset of game state.
Returns
Value representing subset of game state.

◆ Evaluate() [2/2]

template<typename ContextType >
virtual float grail::evaluator::Consideration< ContextType >::Evaluate ( const ContextType &  context,
data::UtilityEvaluatorSnapshot *const  snapshot 
) const
inlinefinaloverrideprotectedvirtual

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.

Implements grail::evaluator::Evaluator< ContextType >.


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