Grail (C#)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.Evaluators.Aggregators.AverageAggregator< ContextType > Class Template Reference

Evaluator aggregating multiple other Evaluators' scores into one output by taking the average. More...

Inheritance diagram for Grail.Evaluators.Aggregators.AverageAggregator< ContextType >:
Collaboration diagram for Grail.Evaluators.Aggregators.AverageAggregator< ContextType >:

Public Member Functions

 AverageAggregator (IEnumerable< Evaluator< ContextType >> childEvaluators)
 Constructor. More...
 
- Public Member Functions inherited from Grail.Evaluators.Aggregators.Aggregator< ContextType >
 Aggregator (IEnumerable< Evaluator< ContextType >> childEvaluators)
 Constructor. More...
 
override void GetDependentConsiderations (List< Consideration< ContextType >> considerations)
 
- Public Member Functions inherited from Grail.Evaluators.Evaluator< ContextType >
float EvaluateContext (ContextType context, in UtilityEvaluatorSnapshot snapshot)
 Evaluates provided context and if provided snapshot is not empty, fills it with debug data describing this node. More...
 

Public Attributes

sealed override EvaluatorType EvaluatorType => EvaluatorType.AGGREGATOR_AVERAGE
 

Protected Member Functions

sealed override float Evaluate (ContextType context, in UtilityEvaluatorSnapshot snapshot)
 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.Evaluators.Aggregators.Aggregator< ContextType >
sealed override void DebugDump (IReadOnlyDictionary< object, int > nodeMapping, ref EvaluationDebugData debugData)
 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

- Static Public Member Functions inherited from Grail.Evaluators.Evaluator< ContextType >
static void CacheConsiderationEvaluations (Evaluator< ContextType > evaluator, ContextType context)
 
- Protected Attributes inherited from Grail.Evaluators.Aggregators.Aggregator< ContextType >
readonly List< Evaluator< ContextType > > childEvaluators = new List<Evaluator<ContextType>>()
 
- Properties inherited from Grail.Evaluators.Evaluator< ContextType >
abstract EvaluatorType EvaluatorType [get]
 

Detailed Description

Evaluator aggregating multiple other Evaluators' scores into one output by taking the average.

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

Constructor & Destructor Documentation

◆ AverageAggregator()

Grail.Evaluators.Aggregators.AverageAggregator< ContextType >.AverageAggregator ( IEnumerable< Evaluator< ContextType >>  childEvaluators)
inline

Constructor.

Parameters
childEvaluatorsAll evaluators which scores should be aggregated during evaluation of this node.

Member Function Documentation

◆ Evaluate()

sealed override float Grail.Evaluators.Aggregators.AverageAggregator< ContextType >.Evaluate ( ContextType  context,
in UtilityEvaluatorSnapshot  snapshot 
)
inlineprotectedvirtual

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

Parameters
contextInput data for evaluation.
snapshotEvaluator snapshot containing debug data describing whole evaluator tree.
Returns
Numerical evaluation of provided context.

Implements Grail.Evaluators.Evaluator< ContextType >.


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