Crystal AI  1.0.0
Crystal.CompositeConsideration Class Reference

An aggregate of considerations. Although it is possible to create fully functioning AIs using only T:Crystal.IConsiderations, this class allows for such considerations to be combined. This is quite useful as it can reduce the complexity of individual considerations allowing them to be seen as building blocks. More...

Inheritance diagram for Crystal.CompositeConsideration:
Crystal.ICompositeConsideration Crystal.IConsideration Crystal.IAiPrototype< IConsideration > Crystal.Behaviour Crystal.Option Crystal.ConstantUtilityOption

Classes

class  ConsiderationCollectionNullException
 
class  NameIdAlreadyExistsInCollectionException
 
class  NameIdIsNullOrEmptyException
 

Public Member Functions

bool AddConsideration (IConsideration consideration)
 Add the specified consideration. More...
 
bool AddConsideration (string considerationId)
 Add the consideration associated with the given Id. More...
 
virtual void Consider (IContext context)
 Calculates the utility for this option given the provided context. More...
 
virtual IConsideration Clone ()
 Creates a new instance of the implementing class. Note that the semantics here are somewhat vague, however, by convention the "Prototype Pattern" uses a "Clone" function. Note that this may have very different semantics when compared with either shallow or deep cloning. When implementing this remember to include only the defining characteristics of the class and not its state! More...
 
 CompositeConsideration ()
 Initializes a new instance of the T:Crystal.CompositeConsideration class. More...
 
 CompositeConsideration (string nameId, IConsiderationCollection collection)
 Initializes a new instance of the CompositeConsideration class. More...
 
- Public Member Functions inherited from Crystal.IAiPrototype< IConsideration >
Clone ()
 Creates a new instance of the implementing class. Note that the semantics here are somewhat vague, however, by convention the "Prototype Pattern" uses a "Clone" function. Note that this may have very different semantics when compared with either shallow or deep cloning. When implementing this remember to include only the defining characteristics of the class and not its state! More...
 

Protected Member Functions

 CompositeConsideration (CompositeConsideration other)
 Initializes a new instance of the T:Crystal.CompositeConsideration class. More...
 
 CompositeConsideration (IConsiderationCollection collection)
 Initializes a new instance of the T:Crystal.CompositeConsideration class. More...
 

Properties

string NameId [get, set]
 An identifier for this consideration. More...
 
IMeasure Measure [get, set]
 The measure to be used to evaluate the utility of this consideration. More...
 
Utility DefaultUtility [get, set]
 Gets or sets the default utility. More...
 
Utility Utility [get, protected set]
 Returns the combined utility for this consideration. More...
 
float Weight [get, set]
 Gets the weight of this consideration. More...
 
bool IsInverted [get, set]
 If true, then the output of the associated evaluator is inverted, in effect, inverting the consideration. More...
 
- Properties inherited from Crystal.ICompositeConsideration
IMeasure Measure [get, set]
 The measure to be used to evaluate the utility of this consideration. More...
 
- Properties inherited from Crystal.IConsideration
string NameId [get]
 A unique named identifier for this consideration. More...
 
Utility DefaultUtility [get, set]
 Gets or sets the default utility. More...
 
Utility Utility [get]
 Returns the utility for this consideration. More...
 
float Weight [get, set]
 The weight of this consideration. More...
 
bool IsInverted [get, set]
 If true, then the output of the associated evaluator is inverted, in effect, inverting the consideration. More...
 

Detailed Description

An aggregate of considerations. Although it is possible to create fully functioning AIs using only T:Crystal.IConsiderations, this class allows for such considerations to be combined. This is quite useful as it can reduce the complexity of individual considerations allowing them to be seen as building blocks.

See also
T:Crystal.ICompositeConsideration, T:Crystal.Behaviour, T:Crystal.Option

Constructor & Destructor Documentation

Crystal.CompositeConsideration.CompositeConsideration ( )
inline

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

Crystal.CompositeConsideration.CompositeConsideration ( CompositeConsideration  other)
inlineprotected

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

Parameters
otherThe other.
Crystal.CompositeConsideration.CompositeConsideration ( IConsiderationCollection  collection)
inlineprotected

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

Parameters
collectionThe collection.
Exceptions
T:Crystal.CompositeConsideration.ConsiderationCollectionNullException
Crystal.CompositeConsideration.CompositeConsideration ( string  nameId,
IConsiderationCollection  collection 
)
inline

Initializes a new instance of the CompositeConsideration class.

Parameters
nameIdThe name identifier.
collectionThe collection.
Exceptions
T:Crystal.CompositeConsideration.NameIdIsNullOrEmptyException
T:Crystal.CompositeConsideration.ConsiderationCollectionNullException
T:Crystal.CompositeConsideration.NameIdAlreadyExistsInCollectionException

Member Function Documentation

bool Crystal.CompositeConsideration.AddConsideration ( IConsideration  consideration)
inline

Add the specified consideration.

Parameters
consideration
Returns

Implements Crystal.ICompositeConsideration.

bool Crystal.CompositeConsideration.AddConsideration ( string  considerationId)
inline

Add the consideration associated with the given Id.

Parameters
considerationId
Returns

Implements Crystal.ICompositeConsideration.

virtual IConsideration Crystal.CompositeConsideration.Clone ( )
inlinevirtual

Creates a new instance of the implementing class. Note that the semantics here are somewhat vague, however, by convention the "Prototype Pattern" uses a "Clone" function. Note that this may have very different semantics when compared with either shallow or deep cloning. When implementing this remember to include only the defining characteristics of the class and not its state!

Returns

Reimplemented in Crystal.Behaviour, Crystal.Option, and Crystal.ConstantUtilityOption.

virtual void Crystal.CompositeConsideration.Consider ( IContext  context)
inlinevirtual

Calculates the utility for this option given the provided context.

Parameters
contextThe context.
Returns
The utility of this option.

Implements Crystal.IConsideration.

Reimplemented in Crystal.Option, and Crystal.ConstantUtilityOption.

Property Documentation

Utility Crystal.CompositeConsideration.DefaultUtility
getset

Gets or sets the default utility.

The default utility.

bool Crystal.CompositeConsideration.IsInverted
getset

If true, then the output of the associated evaluator is inverted, in effect, inverting the consideration.

IMeasure Crystal.CompositeConsideration.Measure
getset

The measure to be used to evaluate the utility of this consideration.

string Crystal.CompositeConsideration.NameId
getset

An identifier for this consideration.

Utility Crystal.CompositeConsideration.Utility
getprotected set

Returns the combined utility for this consideration.

The utility.

float Crystal.CompositeConsideration.Weight
getset

Gets the weight of this consideration.


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