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

The MinAggregator class - Evaluator aggregating multiple other Evaluators' scores into one output by taking the lowest of those values. More...

#include <MinAggregator.hh>

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

Public Member Functions

 MinAggregator (const std::vector< std::shared_ptr< Evaluator< ContextType >>> &childEvaluators)
 MinAggregator - Constructor. More...
 
virtual data::EvaluatorType GetEvaluatorType () const override final
 
- Public Member Functions inherited from grail::evaluator::Aggregator< ContextType >
 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...
 

Protected Member Functions

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...
 
- Protected Member Functions inherited from grail::evaluator::Aggregator< ContextType >
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...
 

Additional Inherited Members

- Protected Attributes inherited from grail::evaluator::Aggregator< ContextType >
std::vector< std::shared_ptr< Evaluator< ContextType > > > childEvaluators {}
 

Detailed Description

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

The MinAggregator class - Evaluator aggregating multiple other Evaluators' scores into one output by taking the lowest of those values.

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

Constructor & Destructor Documentation

◆ MinAggregator()

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

MinAggregator - Constructor.

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

Member Function Documentation

◆ Evaluate()

template<typename ContextType >
virtual float grail::evaluator::MinAggregator< 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: