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

The Aggregator class - Base class for an Evaluator aggregating multiple other Evaluators' scores into one output. More...

#include <Aggregator.hh>

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

Public Member Functions

 Aggregator (const std::vector< std::shared_ptr< Evaluator< ContextType >>> &childEvaluators)
 Aggregator - Constructor. More...
 
 Aggregator (const Aggregator< ContextType > &)=default
 
 Aggregator (Aggregator< ContextType > &&)=default
 
Aggregatoroperator= (const Aggregator< ContextType > &)=default
 
Aggregatoroperator= (Aggregator< ContextType > &&)=default
 
- 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...
 
virtual data::EvaluatorType GetEvaluatorType () const =0
 

Protected Member Functions

virtual void DebugDump (const std::map< const void *, unsigned int > &nodeMapping, data::EvaluationDebugData &debugData) const override
 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...
 
- Protected Member Functions inherited from grail::evaluator::Evaluator< ContextType >
virtual float Evaluate (const ContextType &context, data::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...
 

Protected Attributes

std::vector< std::shared_ptr< Evaluator< ContextType > > > childEvaluators {}
 

Detailed Description

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

The Aggregator class - Base class for an Evaluator aggregating multiple other Evaluators' scores into one output.

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

Constructor & Destructor Documentation

◆ Aggregator()

template<typename ContextType >
grail::evaluator::Aggregator< ContextType >::Aggregator ( const std::vector< std::shared_ptr< Evaluator< ContextType >>> &  childEvaluators)
inline

Aggregator - Constructor.

Parameters
childEvaluators- All evaluators which scores should be aggregated during evaluation of this node.

Member Function Documentation

◆ DebugDump()

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

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 >.


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