1 #ifndef GRAIL_AVERAGE_AGGREGATOR_H
2 #define GRAIL_AVERAGE_AGGREGATOR_H
4 #include "Aggregator.hh"
10 template <
typename ContextType>
27 virtual EvaluatorType GetEvaluatorType() const override final {
return EvaluatorType::AGGREGATOR_AVERAGE; }
33 for (
const auto& evaluator : this->childEvaluators)
35 weight += evaluator->EvaluateContext(context, snapshot);
37 return this->childEvaluators.size() > 0 ? weight / this->childEvaluators.size() : 0;
The UtilityEvaluatorSnapshot class - debug snapshot of whole evaluator tree assigned to evaluated obj...
Definition: UtilityEvaluatorSnapshot.h:22
The Aggregator class - Base class for an Evaluator aggregating multiple other Evaluators' scores into...
Definition: Aggregator.hh:21
The AverageAggregator class - Evaluator aggregating multiple other Evaluators' scores into one output...
Definition: AverageAggregator.hh:16
virtual float Evaluate(const ContextType &context, UtilityEvaluatorSnapshot *const snapshot) const override final
Evaluate - Called from EvaluateContext which also evaluates context, but without automatically fillin...
Definition: AverageAggregator.hh:30
AverageAggregator(const std::vector< std::shared_ptr< Evaluator< ContextType >>> &childEvaluators)
AverageAggregator - Constructor.
Definition: AverageAggregator.hh:22
The Evaluator class - base class being able to evaluate given context and output the result.
Definition: Evaluator.hh:21