Crystal AI  1.0.0
Crystal.Option Class Reference

Normally this option class should serve all the "option" related needs of an AI. More...

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

Classes

class  OptionAlreadyExistsInCollectionException
 

Public Member Functions

bool SetAction (IAction action)
 Sets the action. More...
 
bool SetAction (string actionId)
 Sets the action to be executed when this option is selected to the action associated with actionId. More...
 
override void Consider (IContext context)
 Calculates the utility for this option given the provided context. More...
 
override 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...
 
 Option ()
 Initializes a new instance of the T:Crystal.Option class. More...
 
 Option (string nameId, IOptionCollection collection)
 Initializes a new instance of the T:Crystal.Option class. More...
 
- Public Member Functions inherited from Crystal.CompositeConsideration
bool AddConsideration (IConsideration consideration)
 Add the specified consideration. More...
 
bool AddConsideration (string considerationId)
 Add the consideration associated with the given Id. 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

 Option (Option other)
 Initializes a new instance of the T:Crystal.Option class. More...
 
- Protected Member Functions inherited from Crystal.CompositeConsideration
 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

IAction Action [get]
 The action to be executed when this option is selected. More...
 
- Properties inherited from Crystal.CompositeConsideration
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...
 
- Properties inherited from Crystal.IOption
IAction Action [get]
 The action to be executed when this option is selected. More...
 

Detailed Description

Normally this option class should serve all the "option" related needs of an AI.

Constructor & Destructor Documentation

Crystal.Option.Option ( )
inline

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

Crystal.Option.Option ( Option  other)
inlineprotected

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

Parameters
otherThe other.
Crystal.Option.Option ( string  nameId,
IOptionCollection  collection 
)
inline

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

Parameters
nameIdThe name identifier.
collectionThe collection.
Exceptions
T:Crystal.Option.OptionAlreadyExistsInCollectionException

Member Function Documentation

override IConsideration Crystal.Option.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 from Crystal.CompositeConsideration.

override void Crystal.Option.Consider ( IContext  context)
inlinevirtual

Calculates the utility for this option given the provided context.

Parameters
contextThe context.
Returns
The utility of this option.

Reimplemented from Crystal.CompositeConsideration.

bool Crystal.Option.SetAction ( IAction  action)
inline

Sets the action.

Parameters
actionThe action.
Returns
bool Crystal.Option.SetAction ( string  actionId)
inline

Sets the action to be executed when this option is selected to the action associated with actionId.

Parameters
actionIdThe action identifier.
Returns
Returns true if the action was successfully set, false otherwise.

Implements Crystal.IOption.

Property Documentation

IAction Crystal.Option.Action
get

The action to be executed when this option is selected.


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