Crystal AI  1.0.0
Crystal.CompositeEvaluator Class Reference

The CompositeEvaluator class allows the composition, or combination, of one or more T:Crystal.IEvaluators whose domain of definition does not overlap! Note that addition of an T:Crystal.IEvaluator that has a domain of definition that is covered (even in part) by another T:Crystal.IEvaluator already added to the CompositeEvaluator, will not be added and will have no effect in the evaluation process. More...

Inheritance diagram for Crystal.CompositeEvaluator:
Crystal.EvaluatorBase Crystal.IEvaluator

Public Member Functions

override float Evaluate (float x)
 Returns the value for the specified x. Note that if the given x value does not fall within the domain of definition of any of the T:Crystal.IEvaluators of this T:Crystal.CompositeEvaluator then one of two things will happen depending on the value x itself. More...
 
void Add (IEvaluator ev)
 Adds the specified T:Crystal.IEvaluator to this T:Crystal.CompositeEvaluator if the new evaluator has a domain that does not overlap the domains of definition of the T:Crystal.IEvaluator already added to this T:Crystal.CompositeEvaluator. More...
 
 CompositeEvaluator ()
 Initializes a new instance of the T:Crystal.CompositeEvaluator class. More...
 
- Public Member Functions inherited from Crystal.EvaluatorBase
int CompareTo (IEvaluator other)
 Compares the current object with another object of the same type. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Crystal.EvaluatorBase
 EvaluatorBase ()
 Initializes a new instance of the T:Crystal.EvaluatorBase class. More...
 
 EvaluatorBase (Pointf ptA, Pointf ptB)
 Initializes a new instance of the T:Crystal.EvaluatorBase class. More...
 
- Protected Attributes inherited from Crystal.EvaluatorBase
float Xa
 The x-coordinate of point A. Note, this can have any value in the real interval (-inf, +inf). More...
 
float Xb
 The x-coordinate of point B. Note, this can have any value in the real interval (-inf, +inf). More...
 
float Ya
 The y-coordinate of point A. Note, this can have a value within the interval [0, 1]. More...
 
float Yb
 The y-coordinate of point B. Note, this can have a value within the interval [0, 1]. More...
 
- Properties inherited from Crystal.EvaluatorBase
Pointf PtA [get]
 The first point of the evaluator. The x-coordinate of this point will always be strictly smaller than that of PtB. More...
 
Pointf PtB [get]
 The second point of the evaluator. The x-coordinate of this point will always be strictly larger than that of PtA. More...
 
float MinX [get]
 The lower bound of the x-coordinate interval. More...
 
float MaxX [get]
 The upper bound of the x-coordinate interval. More...
 
float MinY [get]
 The lower bound of the y-coordinate interval. More...
 
float MaxY [get]
 The upper bound of the y-coordinate interval. More...
 
Interval< float > XInterval [get]
 The x-coordinate interval represents the domain of definition of this evaluator. More...
 
Interval< float > YInterval [get]
 The y-coordinate interval represents the range of this evaluator. Note that this must be a sub-interval (or the entire interval) [0,1]. More...
 
bool IsInverted [get, set]
 When true, the output of the Evaluate method is transformed to 1.0f - (normal output). More...
 
- Properties inherited from Crystal.IEvaluator
Pointf PtA [get]
 The first point of the evaluator. The x-coordinate of this point will always be strictly smaller than that of PtB. More...
 
Pointf PtB [get]
 The second point of the evaluator. The x-coordinate of this point will always be strictly larger than that of PtA. More...
 
float MinX [get]
 The lower bound of the x-coordinate interval. More...
 
float MaxX [get]
 The upper bound of the x-coordinate interval. More...
 
float MinY [get]
 The lower bound of the y-coordinate interval. More...
 
float MaxY [get]
 The upper bound of the y-coordinate interval. More...
 
Interval< float > XInterval [get]
 The x-coordinate interval represents the domain of definition of this evaluator. More...
 
Interval< float > YInterval [get]
 The y-coordinate interval represents the range of this evaluator. Note that this must be a sub-interval (or the entire interval) [0,1]. More...
 
bool IsInverted [get, set]
 When true, the output of the Evaluate method is transformed to 1.0f - (normal output). More...
 

Detailed Description

The CompositeEvaluator class allows the composition, or combination, of one or more T:Crystal.IEvaluators whose domain of definition does not overlap! Note that addition of an T:Crystal.IEvaluator that has a domain of definition that is covered (even in part) by another T:Crystal.IEvaluator already added to the CompositeEvaluator, will not be added and will have no effect in the evaluation process.

See also
Crystal.EvaluatorBase

Constructor & Destructor Documentation

Crystal.CompositeEvaluator.CompositeEvaluator ( )
inline

Initializes a new instance of the T:Crystal.CompositeEvaluator class.

Member Function Documentation

void Crystal.CompositeEvaluator.Add ( IEvaluator  ev)
inline

Adds the specified T:Crystal.IEvaluator to this T:Crystal.CompositeEvaluator if the new evaluator has a domain that does not overlap the domains of definition of the T:Crystal.IEvaluator already added to this T:Crystal.CompositeEvaluator.

Parameters
evEv.
override float Crystal.CompositeEvaluator.Evaluate ( float  x)
inlinevirtual

Returns the value for the specified x. Note that if the given x value does not fall within the domain of definition of any of the T:Crystal.IEvaluators of this T:Crystal.CompositeEvaluator then one of two things will happen depending on the value x itself.

  1. If x is within the extended interval defined by the evaluator's lower and upper bounds, then the return value will be linearly interpolated using the values of the T:Crystal.IEvaluator whose domain is to the "left" (i.e. all values of the domain are smaller than x) of the value x and the T:Crystal.IEvaluator to the "right" of x.
  2. If x is outside the extended interval defined by the evaluator's lower and upper bounds, then the Evaluate method will derive its output from the T:Crystal.IEvaluator whose lower or upper bound is closest to the value x.

Reimplemented from Crystal.EvaluatorBase.


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