Crystal AI  1.0.0
Crystal.Utility Struct Reference

This struct is used throughout Crystal AI to communicate the utility (or usefulness) of a particular option, consideration or behaviour. More...

Inheritance diagram for Crystal.Utility:

Public Member Functions

bool Equals (Utility other)
 Determines whether the specified T:Crystal.Utility is equal to the current T:Crystal.Utility. More...
 
override bool Equals (object obj)
 Determines whether the specified T:System.Object, is equal to this instance. More...
 
override int GetHashCode ()
 Returns a hash code for this instance. More...
 
int CompareTo (Utility other)
 Compares to. More...
 
override string ToString ()
 Returns a string that represents the current T:Crystal.Utility. More...
 
 Utility (float value)
 Initializes a new instance of the T:Crystal.Utility struct. More...
 
 Utility (float value, float weight)
 Initializes a new instance of the T:Crystal.Utility struct. More...
 

Static Public Member Functions

static implicit operator Utility (float a)
 
Parameters
aThe alpha component.

 
static bool operator== (Utility a, Utility b)
 
static bool operator!= (Utility a, Utility b)
 
static bool operator> (Utility a, Utility b)
 
static bool operator< (Utility a, Utility b)
 
static bool operator>= (Utility a, Utility b)
 
static bool operator<= (Utility a, Utility b)
 

Public Attributes

float _value
 
float _weight
 

Properties

float Value [get, set]
 The value of the option associated with this Utility. This parameter is normalized to the interval [0,1]. More...
 
float Weight [get, set]
 The weighting of the option associated with this Utility. This parameter is normalized to the interval [0,1]. More...
 
float Combined [get]
 Returns the Value*Weight of this Utility. More...
 
bool IsZero [get]
 Gets a value indicating whether the combined utility is zero. More...
 
bool IsOne [get]
 Gets a value indicating whether the combined utility is one. More...
 

Detailed Description

This struct is used throughout Crystal AI to communicate the utility (or usefulness) of a particular option, consideration or behaviour.

See also
T:System.IEquatable`1, T:System.IComparable`1

Constructor & Destructor Documentation

Crystal.Utility.Utility ( float  value)
inline

Initializes a new instance of the T:Crystal.Utility struct.

Parameters
valueValue.
Crystal.Utility.Utility ( float  value,
float  weight 
)
inline

Initializes a new instance of the T:Crystal.Utility struct.

Parameters
valueValue.
weightWeight.

Member Function Documentation

int Crystal.Utility.CompareTo ( Utility  other)
inline

Compares to.

Returns
The to.
Parameters
otherOther.
bool Crystal.Utility.Equals ( Utility  other)
inline

Determines whether the specified T:Crystal.Utility is equal to the current T:Crystal.Utility.

Parameters
otherThe T:Crystal.Utility to compare with the current T:Crystal.Utility.
Returns
true if the specified T:Crystal.Utility is equal to the current T:Crystal.Utility; otherwise, false.
override bool Crystal.Utility.Equals ( object  obj)
inline

Determines whether the specified T:System.Object, is equal to this instance.

Parameters
objThe T:System.Object to compare with this instance.
Returns
true if the specified T:System.Object is equal to this instance; otherwise, false.
override int Crystal.Utility.GetHashCode ( )
inline

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
static bool Crystal.Utility.operator!= ( Utility  a,
Utility  b 
)
inlinestatic
Parameters
aThe alpha component.
bThe blue component.
static bool Crystal.Utility.operator< ( Utility  a,
Utility  b 
)
inlinestatic
Parameters
aThe alpha component.
bThe blue component.
static bool Crystal.Utility.operator<= ( Utility  a,
Utility  b 
)
inlinestatic
Parameters
aThe alpha component.
bThe blue component.
static bool Crystal.Utility.operator== ( Utility  a,
Utility  b 
)
inlinestatic
Parameters
aThe alpha component.
bThe blue component.
static bool Crystal.Utility.operator> ( Utility  a,
Utility  b 
)
inlinestatic
Parameters
aThe alpha component.
bThe blue component.
static bool Crystal.Utility.operator>= ( Utility  a,
Utility  b 
)
inlinestatic
Parameters
aThe alpha component.
bThe blue component.
override string Crystal.Utility.ToString ( )
inline

Returns a string that represents the current T:Crystal.Utility.

Returns
A string that represents the current T:Crystal.Utility.

Property Documentation

float Crystal.Utility.Combined
get

Returns the Value*Weight of this Utility.

bool Crystal.Utility.IsOne
get

Gets a value indicating whether the combined utility is one.

true if the combined utility is one; otherwise, false.

bool Crystal.Utility.IsZero
get

Gets a value indicating whether the combined utility is zero.

true if the combined utility is zero; otherwise, false.

float Crystal.Utility.Value
getset

The value of the option associated with this Utility. This parameter is normalized to the interval [0,1].

float Crystal.Utility.Weight
getset

The weighting of the option associated with this Utility. This parameter is normalized to the interval [0,1].

The weight.


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