|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--xcseco.XClassifier
Each instance of this class represents one classifier. The class provides different constructors for generating
| Constructor Summary | |
XClassifier(double setSize,
int time,
int condLength,
int numberOfActions)
Construct a classifier with random condition and random action. |
|
XClassifier(double setSize,
int time,
int numberOfActions,
java.lang.String situation)
Construct matching classifier with random action. |
|
XClassifier(double setSize,
int time,
java.lang.String situation,
int act)
Constructs a classifier with matching condition and specified action. |
|
XClassifier(XClassifier clOld)
Constructs an identical XClassifier. |
|
| Method Summary | |
void |
addNumerosity(int num)
Adds to the numerosity of the classifier. |
boolean |
applyMutation(java.lang.String state,
int numberOfActions)
Applies a niche mutation to the classifier. |
boolean |
equals(XClassifier cl)
Returns if the two classifiers are identical in condition and action. |
double |
getAccuracy()
Returns the accuracy of the classifier. |
int |
getAction()
Returns the action of the classifier. |
double |
getDelProp(double meanFitness)
Returns the vote for deletion of the classifier. |
double |
getFitness()
Returns the fitness of the classifier. |
int |
getNumerosity()
Returns the numerosity of the classifier. |
double |
getPrediction()
Returns the prediction of the classifier. |
double |
getPredictionError()
Returns the prediction error of the classifier. |
int |
getTimeStamp()
Returns the time stamp of the classifier. |
void |
increaseExperience()
Increases the Experience of the classifier by one. |
boolean |
isMoreGeneral(XClassifier cl)
Returns if the classifier is more general than cl. |
boolean |
isSubsumer()
Returns if the classifier is a possible subsumer. |
boolean |
match(java.lang.String state)
Returns if the classifier matches in the current situation. |
void |
printXClassifier()
Prints the classifier to the control panel. |
void |
printXClassifier(java.io.PrintWriter pW)
Prints the classifier to the print writer (normally referencing a file). |
void |
setFitness(double fit)
Sets the fitness of the classifier. |
void |
setPrediction(double pre)
Sets the prediction of the classifier. |
void |
setPredictionError(double preE)
Sets the prediction error of the classifier. |
void |
setTimeStamp(int ts)
Sets the time stamp of the classifier. |
boolean |
subsumes(XClassifier cl)
Returns if the classifier subsumes cl. |
boolean |
twoPointCrossover(XClassifier cl)
Applies two point crossover and returns if the classifiers changed. |
double |
updateActionSetSize(double numerositySum)
Updates the action set size. |
double |
updateFitness(double accSum,
double accuracy)
Updates the fitness of the classifier according to the relative accuracy. |
double |
updatePrediction(double P)
Updates the prediction of the classifier according to P. |
double |
updatePreError(double P)
Updates the prediction error of the classifier according to P. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XClassifier(double setSize,
int time,
java.lang.String situation,
int act)
setSize - The size of the current set which the new classifier matches.time - The actual number of instances the XCS learned from so far.situation - The current problem instance/perception.act - The action of the new classifier.
public XClassifier(double setSize,
int time,
int numberOfActions,
java.lang.String situation)
setSize - The size of the current set which the new classifier matches.time - The actual number of instances the XCS learned from so far.numberOfActions - The number of different actions to chose from
(This should be set to the number of actions possible in the problem).situation - The current problem instance/perception.
public XClassifier(double setSize,
int time,
int condLength,
int numberOfActions)
setSize - The size of the current set which the new classifier matches.time - The actual number of instances the XCS learned from so far.condLength - The length of the condition of the new classifier.numberOfActions - The number of different actions to chose frompublic XClassifier(XClassifier clOld)
clOld - The to be copied classifier.| Method Detail |
public boolean match(java.lang.String state)
state - The current situation which can be the current state or problem instance.public boolean twoPointCrossover(XClassifier cl)
cl - The second classifier for the crossover application.XCSConstants.pX
public boolean applyMutation(java.lang.String state,
int numberOfActions)
state - The current situation/problem instancenumberOfActions - The maximal number of actions possible in the environment.public boolean equals(XClassifier cl)
cl - The classifier to be compared.public boolean subsumes(XClassifier cl)
The - new classifier that possibly is subsumed.public boolean isSubsumer()
XCSConstants.theta_sub,
XCSConstants.epsilon_0public boolean isMoreGeneral(XClassifier cl)
The - classifier that is tested to be more specific.public double getDelProp(double meanFitness)
meanFitness - The mean fitness in the population.XCSConstants.delta,
XCSConstants.theta_delpublic double updatePrediction(double P)
P - The actual Q-payoff value (actual reward + max of predicted reward in the following situation).XCSConstants.betapublic double updatePreError(double P)
P - The actual Q-payoff value (actual reward + max of predicted reward in the following situation).XCSConstants.betapublic double getAccuracy()
XCSConstants.epsilon_0,
XCSConstants.alpha,
XCSConstants.nu
public double updateFitness(double accSum,
double accuracy)
accSum - The sum of all the accuracies in the action setaccuracy - The accuracy of the classifier.XCSConstants.betapublic double updateActionSetSize(double numerositySum)
numeriositySum - The number of micro-classifiers in the populationXCSConstants.betapublic int getAction()
public void increaseExperience()
public double getPrediction()
public void setPrediction(double pre)
pre - The new prediction of the classifier.public double getPredictionError()
public void setPredictionError(double preE)
preE - The new prediction error of the classifier.public double getFitness()
public void setFitness(double fit)
fit - The new fitness of the classifier.public int getNumerosity()
public void addNumerosity(int num)
num - The added numerosity (can be negative!).public int getTimeStamp()
public void setTimeStamp(int ts)
ts - The new time stamp of the classifier.public void printXClassifier()
public void printXClassifier(java.io.PrintWriter pW)
pW - The writer to which the classifier is written.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||