Grail (C#)  1.3.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.Evaluators.Curves.LinearFunction< ContextType > Class Template Reference

Linear Function. More...

Inheritance diagram for Grail.Evaluators.Curves.LinearFunction< ContextType >:
Collaboration diagram for Grail.Evaluators.Curves.LinearFunction< ContextType >:

Public Member Functions

 LinearFunction (Evaluator< ContextType > childEvaluator, float slope, float intercept)
 Constructor. More...
 
 LinearFunction (Evaluator< ContextType > childEvaluator, KeyValuePair< float, float > firstPoint, KeyValuePair< float, float > secondPoint)
 Constructor. More...
 
sealed override float Sample (float argument)
 Transforms argument into output value depending on the type of Curve. More...
 
- Public Member Functions inherited from Grail.Evaluators.Curves.Curve< ContextType >
 Curve (Evaluator< ContextType > childEvaluator)
 Constructor. More...
 
- Public Member Functions inherited from Grail.Evaluators.Evaluator< ContextType >
float EvaluateContext (ContextType context, in UtilityEvaluatorSnapshot snapshot)
 Evaluates provided context and if provided snapshot is not empty, fills it with debug data describing this node. More...
 

Public Attributes

sealed override EvaluatorType EvaluatorType => EvaluatorType.CURVE_LINEAR
 

Additional Inherited Members

- Protected Member Functions inherited from Grail.Evaluators.Curves.Curve< ContextType >
sealed override float Evaluate (ContextType context, in UtilityEvaluatorSnapshot snapshot)
 Called from EvaluateContext which also evaluates context, but without automatically filling snapshot with debug data. Should be overriden for each derived Evaluator. More...
 
sealed override void DebugDump (IReadOnlyDictionary< object, int > nodeMapping, ref EvaluationDebugData debugData)
 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...
 
- Properties inherited from Grail.Evaluators.Evaluator< ContextType >
abstract EvaluatorType EvaluatorType [get]
 

Detailed Description

Linear Function.

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

Constructor & Destructor Documentation

◆ LinearFunction() [1/2]

Grail.Evaluators.Curves.LinearFunction< ContextType >.LinearFunction ( Evaluator< ContextType >  childEvaluator,
float  slope,
float  intercept 
)
inline

Constructor.

Parameters
childEvaluatorEvaluator which output will be transformed by this curve.
slope"a" parameter of linear function.
intercept"b" parameter of linear function.

◆ LinearFunction() [2/2]

Grail.Evaluators.Curves.LinearFunction< ContextType >.LinearFunction ( Evaluator< ContextType >  childEvaluator,
KeyValuePair< float, float >  firstPoint,
KeyValuePair< float, float >  secondPoint 
)
inline

Constructor.

Parameters
childEvaluatorEvaluator which output will be transformed by this curve.
firstPointBeginning of the segment describing linear function.
secondPointEnd of the segment describing linear function.
Exceptions
ArgumentExceptionThrown when firstPoint and secondPoint describe impossible segment.

Member Function Documentation

◆ Sample()

sealed override float Grail.Evaluators.Curves.LinearFunction< ContextType >.Sample ( float  argument)
inlinevirtual

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

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

Implements Grail.Evaluators.Curves.Curve< ContextType >.


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