clarion.system
Class StochasticSelector

java.lang.Object
  extended by clarion.system.StochasticSelector

public final class StochasticSelector
extends java.lang.Object

This class implements a stochastic selector within CLARION. This class is final and, therefore, cannot cannot be extended.

Usage:

This class is used to by the various subsystems of the CLARION Library to select an object from a collection of objects that implement the InterfaceStochasticallySelectable interface. It uses a soft-max Boltzmann distribution to choose the object based on the "final selection measure" of that stochastically selectable object.

Classes that currently instantiate a stochastic selector are:

This class contains both global (static) and local constants. The default is to use the local constants. If you want to change any of the global constants, you need to do so before any instances of this class are initialized.

Version:
6.0.4
Author:
Nick Wilson

Field Summary
static double GLOBAL_TEMPERATURE
          The temperature for Boltzmann selection.
static double GLOBAL_THRESHOLD
          The threshold for Boltzmann selection.
 double TEMPERATURE
          The temperature for Boltzmann selection.
 double THRESHOLD
          The threshold for Boltzmann selection.
 
Constructor Summary
StochasticSelector()
           
 
Method Summary
 double getBoltzmannProbability(java.util.Collection<? extends InterfaceStochasticallySelectable> s, InterfaceStochasticallySelectable ss)
          Gets the BoltzmannProbability of a specified stochastically selectable object given a collection of stochastically selectable objects.
 java.util.Collection<? extends InterfaceStochasticallySelectable> performBoltzmannDistribution(java.util.Collection<? extends InterfaceStochasticallySelectable> s)
          This method calculates a Boltzmann distribution for a collection of stochastically selectable objects but does not go so far as to perform the actual selection.
 InterfaceStochasticallySelectable select(java.util.Collection<? extends InterfaceStochasticallySelectable> s)
          Given a collection of stochastically selectable objects, this method chooses an object from that collection using a Boltzmann distribution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL_THRESHOLD

public static double GLOBAL_THRESHOLD
The threshold for Boltzmann selection.


THRESHOLD

public double THRESHOLD
The threshold for Boltzmann selection.


GLOBAL_TEMPERATURE

public static double GLOBAL_TEMPERATURE
The temperature for Boltzmann selection.


TEMPERATURE

public double TEMPERATURE
The temperature for Boltzmann selection.

Constructor Detail

StochasticSelector

public StochasticSelector()
Method Detail

select

public InterfaceStochasticallySelectable select(java.util.Collection<? extends InterfaceStochasticallySelectable> s)
Given a collection of stochastically selectable objects, this method chooses an object from that collection using a Boltzmann distribution.

Parameters:
s - The array of stochastically selectable objects from which to choose.
Returns:
The chosen object.

performBoltzmannDistribution

public java.util.Collection<? extends InterfaceStochasticallySelectable> performBoltzmannDistribution(java.util.Collection<? extends InterfaceStochasticallySelectable> s)
This method calculates a Boltzmann distribution for a collection of stochastically selectable objects but does not go so far as to perform the actual selection. The method is used mainly for things like level combination as the match statistics are partially updated based on the Boltzmann probability (each items in the collection's measure after it has been update using the Boltzmann equation.

Parameters:
s - The collection of stochastically selectable objects.
Returns:
A collection of stochastically selectable objects with adjusted Boltzmann probabilities.

getBoltzmannProbability

public double getBoltzmannProbability(java.util.Collection<? extends InterfaceStochasticallySelectable> s,
                                      InterfaceStochasticallySelectable ss)
                               throws java.lang.IllegalArgumentException
Gets the BoltzmannProbability of a specified stochastically selectable object given a collection of stochastically selectable objects. The specified object must be in the specified collection or this method will throw an exception.

Parameters:
s - The collection of stochastically selectable objects.
ss - The object (within the collection) whose Boltzmann probability your wish to get.
Returns:
The Boltzmann probability of the specified stochastically selectable object.
Throws:
java.lang.IllegalArgumentException - If the specified stochastic object is not contained within the specified collection.