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

The SigmoidFunction class - Sigmoid function. More...

#include <SigmoidFunction.hh>

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

Public Member Functions

 SigmoidFunction (std::shared_ptr< Evaluator< ContextType >> childEvaluator, float range, float slope, float threshold, float displacement)
 SigmoidFunction - Constructor. More...
 
virtual float Sample (float argument) const override final
 Sample - Transforms argument into output value depending on the type of Curve. More...
 
float GetRange () const
 GetRange. More...
 
float GetSlope () const
 GetSlope. More...
 
float GetThreshold () const
 GetThreshold. More...
 
float GetDisplacement () const
 GetDisplacement. 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::SigmoidFunction< ContextType >

The SigmoidFunction class - Sigmoid function.

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

Constructor & Destructor Documentation

◆ SigmoidFunction()

template<typename ContextType >
grail::evaluator::SigmoidFunction< ContextType >::SigmoidFunction ( std::shared_ptr< Evaluator< ContextType >>  childEvaluator,
float  range,
float  slope,
float  threshold,
float  displacement 
)
inline

SigmoidFunction - Constructor.

Parameters
childEvaluator- Evaluator which output will be transformed by this curve.
range- Determines difference between highest possible value and lowest possible value.
slope- The higher the slope, the more it will resemble step function. The lower the slope, the more it will resemble linear function.
threshold- Location of the middle of sigmoid slope on X-axis.
displacement- Displacement of the curve on Y-axis.

Member Function Documentation

◆ GetDisplacement()

template<typename ContextType >
float grail::evaluator::SigmoidFunction< ContextType >::GetDisplacement ( ) const
inline

GetDisplacement.

Returns
Displacement of the curve on Y-axis.

◆ GetRange()

template<typename ContextType >
float grail::evaluator::SigmoidFunction< ContextType >::GetRange ( ) const
inline

GetRange.

Returns
Number determining difference between highest possible value and lowest possible value.

◆ GetSlope()

template<typename ContextType >
float grail::evaluator::SigmoidFunction< ContextType >::GetSlope ( ) const
inline

GetSlope.

Returns
The higher the slope, the more it will resemble step function. The lower the slope, the more it will resemble linear function.

◆ GetThreshold()

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

GetThreshold.

Returns
Location of the middle of sigmoid slope on X-axis.

◆ Sample()

template<typename ContextType >
virtual float grail::evaluator::SigmoidFunction< 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: