Crystal AI  1.0.0
Crystal.MultiplicativePseudoMeasure Class Reference

Calculates a multiplicative pseudo-measure, namely, this class calculates the product of P:Crystal.Utility.Combined in T:System.Collections.ICollection. More...

Inheritance diagram for Crystal.MultiplicativePseudoMeasure:
Crystal.IMeasure Crystal.IAiPrototype< IMeasure >

Public Member Functions

float Calculate (ICollection< Utility > elements)
 Calculate the measure for the given set of elements. More...
 
IMeasure 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...
 
- Public Member Functions inherited from Crystal.IAiPrototype< IMeasure >
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...
 

Detailed Description

Calculates a multiplicative pseudo-measure, namely, this class calculates the product of P:Crystal.Utility.Combined in T:System.Collections.ICollection.

Note that this pseudo-measure, in this or similar forms, is used utility AIs by game developers. From a mathematical point of view the use of this pseudo-measure simply doesn’t make sense. That, in and of itself, doesn’t mean that this pseudo-measure shouldn’t be used or that it is somehow inherently a bad practice. However, due to the fact that this pseudo-measure multiplies the elements of the vector of utilities, it exhibits some peculiar behaviour for vectors of different length. For example, ignoring the weight in utilities for the time being, let’s say that you have a vector of utilities that is (0.9, 0.9) and another that belongs to a different option that is (0.92, 0.92, 0.92). Using the MultiplicativePseudoMeasure on these two vectors will result in a final value for the first equal to 0.81 and 0.77 for the second. This means that the first option will be selected ignoring the fact that each of its considerations individually have lower utility compared with the second option. This is counter intuitive, and because of this, I would avoid using this pseudo-measure. Nevertheless, it appears to be in common use so an implementation is available for completeness. If you have insights on the reasons behind the use of this particular pseudo-measure in the game development industry I would love to hear them!

See also
T:Crystal.IMeasure

Member Function Documentation

float Crystal.MultiplicativePseudoMeasure.Calculate ( ICollection< Utility elements)
inline

Calculate the measure for the given set of elements.

Parameters
elements
Returns

Implements Crystal.IMeasure.

IMeasure Crystal.MultiplicativePseudoMeasure.Clone ( )
inline

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

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