clarion.tools
Class StochasticDecider

java.lang.Object
  extended byclarion.tools.StochasticDecider

public class StochasticDecider
extends java.lang.Object


Field Summary
protected  double BoltzmannSum
           
protected  double[] elementsArr
          the array of elements.
protected  int size
          the size of elements in this decider.
protected  double temperature
          temperature for action-decision making.
protected  double threshold
          threshold.
 
Constructor Summary
StochasticDecider()
           
StochasticDecider(double temper)
          constructor.
StochasticDecider(int nSize, double temper)
          constructor.
 
Method Summary
 short[][] getMultiRecommendation(double[] els, short[] dimVals)
          Returns action recommendation with multiple active values in some dimensions.
 int getRecommendation()
          Returns the action recommendation.
 int getRecommendation(double[] els)
          Returns the action recommendation given the array of action activations.
 int getRecommendation(double[] els, int len)
          Returns the action recommendation given the array of action activations and a limit on the length of elements in the array from position 0 those are eligible candidates.
 int getRecommendation(double[] els, int start, int end)
          Returns the action recommendation given the array of action activations and a limit on start position and end position in the array within the range the elements are eligible candidates.
 short[] getRecommendation(double[] els, short[] dimVals)
          Returns the action recommendation given the arrray of action activations and the array of value number info of each dimension.
 void setElements(double[] els)
          Sets the elements in this decider.
 void setSize(int length)
          Sets the size of elments in this decider.
 void setTemperature(double temper)
          Sets the temperature of this decider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size
the size of elements in this decider.


threshold

protected double threshold
threshold.


temperature

protected double temperature
temperature for action-decision making.


BoltzmannSum

protected double BoltzmannSum

elementsArr

protected double[] elementsArr
the array of elements.

Constructor Detail

StochasticDecider

public StochasticDecider()

StochasticDecider

public StochasticDecider(int nSize,
                         double temper)
constructor.

Parameters:
nSize - the size of elements.
temper - the temperature of this decider.

StochasticDecider

public StochasticDecider(double temper)
constructor.

Parameters:
temper - the temperature of the decider.
Method Detail

setSize

public void setSize(int length)
Sets the size of elments in this decider.

Parameters:
length - the size to set.

setTemperature

public void setTemperature(double temper)
Sets the temperature of this decider.

Parameters:
temper - the temperature to set.

setElements

public void setElements(double[] els)
Sets the elements in this decider.

Parameters:
els - the elements to set.

getRecommendation

public int getRecommendation()
Returns the action recommendation.

Returns:
the action recommendation.

getRecommendation

public int getRecommendation(double[] els)
Returns the action recommendation given the array of action activations.

Parameters:
els - the array of action activations.
Returns:
the index of the recommended action.

getRecommendation

public int getRecommendation(double[] els,
                             int len)
Returns the action recommendation given the array of action activations and a limit on the length of elements in the array from position 0 those are eligible candidates.

Parameters:
els - the array of action activations.
len - the length of eligible candidates.
Returns:
the index of the recommended action.

getRecommendation

public int getRecommendation(double[] els,
                             int start,
                             int end)
Returns the action recommendation given the array of action activations and a limit on start position and end position in the array within the range the elements are eligible candidates.

Parameters:
els - the array of action activations.
start - the start position.
end - the end position.
Returns:
the index of the recommended action which is the offset from start.

getRecommendation

public short[] getRecommendation(double[] els,
                                 short[] dimVals)
Returns the action recommendation given the arrray of action activations and the array of value number info of each dimension.

Parameters:
els - the array of action activations.
dimVals - the array of value number info of each dimension.
Returns:
an array of indices of recommended value in each dimension.

getMultiRecommendation

public short[][] getMultiRecommendation(double[] els,
                                        short[] dimVals)
Returns action recommendation with multiple active values in some dimensions. needs be further implemented.