xcseco
Class PredictionArray
java.lang.Object
|
+--xcseco.PredictionArray
- All Implemented Interfaces:
- java.io.Serializable
- public class PredictionArray
- extends java.lang.Object
- implements java.io.Serializable
This class generates a prediction array of the provided set.
The prediction array is generated according to Wilson's Classifier Fitness Based on Accuracy
(Evolutionary Computation Journal, 1995).
Moreover, this class provides all methods to handle selection in the prediction array, essentially, to select the
best action, a present random action or an action by roulette wheel selection.
- Since:
- JDK1.1
- Version:
- XCSJava 1.0
- Author:
- Martin V. Butz
- See Also:
- Serialized Form
|
Constructor Summary |
PredictionArray(XClassifierSet set,
int size)
Constructs the prediction array according to the current set and the possible number of actions. |
|
Method Summary |
int |
bestActionWinner()
Selects the action in the prediction array with the best value. |
double |
getBestValue()
Returns the highest value in the prediction array. |
double |
getValue(int i)
Returns the value of the specified entry in the prediction array. |
int |
randomActionWinner()
Selects an action randomly.
|
int |
rouletteActionWinner()
Selects an action in the prediction array by roulette wheel selection. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PredictionArray
public PredictionArray(XClassifierSet set,
int size)
- Constructs the prediction array according to the current set and the possible number of actions.
- Parameters:
set - The classifier set out of which a prediction array is formed (normally the match set).size - The number of entries in the prediction array (should be set to the number of possible actions in the problem)
getBestValue
public double getBestValue()
- Returns the highest value in the prediction array.
getValue
public double getValue(int i)
- Returns the value of the specified entry in the prediction array.
randomActionWinner
public int randomActionWinner()
- Selects an action randomly.
The function assures that the chosen action is represented by at least one classifier.
bestActionWinner
public int bestActionWinner()
- Selects the action in the prediction array with the best value.
rouletteActionWinner
public int rouletteActionWinner()
- Selects an action in the prediction array by roulette wheel selection.