|
Grail (C++)
1.3.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
|
3 #ifndef GRAIL_MIN_AGGREGATOR_H
4 #define GRAIL_MIN_AGGREGATOR_H
7 #include "Aggregator.hh"
13 template <
typename ContextType>
30 virtual data::EvaluatorType GetEvaluatorType() const override final {
return data::EvaluatorType::AGGREGATOR_MIN; }
36 float weight = std::numeric_limits<float>::max();
37 for(
const auto& evaluator : this->childEvaluators)
39 float current = evaluator->EvaluateContext(context, snapshot);
40 weight = std::min(weight, current);
The MinAggregator class - Evaluator aggregating multiple other Evaluators' scores into one output by ...
Definition: MinAggregator.hh:18
The Aggregator class - Base class for an Evaluator aggregating multiple other Evaluators' scores into...
Definition: Aggregator.hh:22
The Evaluator class - base class being able to evaluate given context and output the result.
Definition: Evaluator.hh:22
virtual float Evaluate(const ContextType &context, data::UtilityEvaluatorSnapshot *const snapshot) const override final
Evaluate - Called from EvaluateContext which also evaluates context, but without automatically fillin...
Definition: MinAggregator.hh:34
MinAggregator(const std::vector< std::shared_ptr< Evaluator< ContextType >>> &childEvaluators)
MinAggregator - Constructor.
Definition: MinAggregator.hh:25
The UtilityEvaluatorSnapshot class - debug snapshot of whole evaluator tree assigned to evaluated obj...
Definition: UtilityEvaluatorSnapshot.h:26