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

The Curve class - Defines objects transforming one value into the other. More...

#include <Curve.hh>

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

Public Member Functions

 Curve (std::shared_ptr< Evaluator< ContextType >> childEvaluator)
 Curve - Constructor. More...
 
 Curve (const Curve< ContextType > &other)=default
 
 Curve (Curve< ContextType > &&other)=default
 
virtual float Sample (float argument) const =0
 Sample - Transforms argument into output value depending on the type of Curve. More...
 
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...
 
virtual void GetDependentConsiderations (std::vector< Consideration< ContextType > * > &considerations) override
 
- 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 final
 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...
 

Detailed Description

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

The Curve class - Defines objects transforming one value into the other.

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

Constructor & Destructor Documentation

◆ Curve()

template<typename ContextType >
grail::evaluator::Curve< ContextType >::Curve ( std::shared_ptr< Evaluator< ContextType >>  childEvaluator)
inlineexplicit

Curve - Constructor.

Parameters
childEvaluator- Evaluator which output will be transformed by this curve.

Member Function Documentation

◆ DebugDump()

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

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

◆ Evaluate()

template<typename ContextType >
virtual float grail::evaluator::Curve< ContextType >::Evaluate ( const ContextType &  context,
data::UtilityEvaluatorSnapshot *const  snapshot 
) const
inlinefinaloverridevirtual

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

◆ Sample()


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