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

The UnitStepFunction class - Unit Step Function. More...

#include <UnitStepFunction.hh>

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

Public Member Functions

 UnitStepFunction (std::shared_ptr< Evaluator< ContextType >> childEvaluator, float threshold, float beforeThresholdValue, float afterThresholdValue)
 UnitStepFunction - Constructor. More...
 
virtual float Sample (float argument) const override final
 Sample - Transforms argument into output value depending on the type of Curve. More...
 
float GetThreshold () const
 GetThreshold. More...
 
float GetBeforeThresholdValue () const
 GetBeforeThresholdValue. More...
 
float GetAfterThresholdValue () const
 GetAfterThresholdValue. More...
 
virtual data::EvaluatorType GetEvaluatorType () const override final
 
- Public Member Functions inherited from grail::evaluator::Curve< ContextType >
 Curve (std::shared_ptr< Evaluator< ContextType >> childEvaluator)
 Curve - Constructor. More...
 
 Curve (const Curve< ContextType > &other)=default
 
 Curve (Curve< ContextType > &&other)=default
 
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...
 
- 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...
 

Additional Inherited Members

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

The UnitStepFunction class - Unit Step Function.

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

Constructor & Destructor Documentation

◆ UnitStepFunction()

template<typename ContextType >
grail::evaluator::UnitStepFunction< ContextType >::UnitStepFunction ( std::shared_ptr< Evaluator< ContextType >>  childEvaluator,
float  threshold,
float  beforeThresholdValue,
float  afterThresholdValue 
)
inline

UnitStepFunction - Constructor.

Parameters
childEvaluator- Evaluator which output will be transformed by this curve.
threshold- Parameter describing point of separation between two discrete values.
beforeThresholdValue- Value assigned to arguments placed to the left of the threshold.
afterThresholdValue- Value assigned to arguments placed to the right of the threshold.

Member Function Documentation

◆ GetAfterThresholdValue()

template<typename ContextType >
float grail::evaluator::UnitStepFunction< ContextType >::GetAfterThresholdValue ( ) const
inline

GetAfterThresholdValue.

Returns
Value assigned to arguments placed to the right of the threshold.

◆ GetBeforeThresholdValue()

template<typename ContextType >
float grail::evaluator::UnitStepFunction< ContextType >::GetBeforeThresholdValue ( ) const
inline

GetBeforeThresholdValue.

Returns
Value assigned to arguments placed to the left of the threshold.

◆ GetThreshold()

template<typename ContextType >
float grail::evaluator::UnitStepFunction< ContextType >::GetThreshold ( ) const
inline

GetThreshold.

Returns
Parameter describing point of separation between two discrete values.

◆ Sample()

template<typename ContextType >
virtual float grail::evaluator::UnitStepFunction< ContextType >::Sample ( float  argument) const
inlinefinaloverridevirtual

Sample - Transforms argument into output value depending on the type of Curve.

Parameters
argument- Value of a curve argument belonging to its domain.
Returns
Transformed argument.

Implements grail::evaluator::Curve< ContextType >.


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