demoZLCS
Class ZLCS

java.lang.Object
  extended byclassifierLibrary.ClassifierSystem
      extended bydemoZLCS.ZLCS
All Implemented Interfaces:
java.lang.Cloneable

public class ZLCS
extends ClassifierSystem

Bibliothek demoZLCS

Klasse ZLCS

Copyright by Klaus Hufschlag 2004,2005,2006

This file is part of the Generic Classifier Library. The Generic Classifier Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The Generic Classifier Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the Generic Classifier Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Version:
1.4
Author:
Klaus Hufschlag

Constructor Summary
ZLCS()
          Construktor creating an empty instance of ZLCS
ZLCS(java.lang.String name, StandardClassifier sample, int size, boolean randomized)
          Construktor creating an instance of ZLCS, using a given sample Classifier for filling the instance up to a defined size.
 
Method Summary
 StandardClassifier chooseClassifier()
          Roulettewheel-choice of a StandardClassifier, using the classifiers' strength for determining probabilities.
 StandardClassifier cover(Situation sit)
          Covering: Generation of a new StandardClassifier matching a given Situation.
 void GA()
          Genetic Algorithm, only performed with a probability of Rho
 Situation getActionChoice(Situation condition)
          ZLCS-Choice of an action matching a given condition
 ZLCS getActionSet(Situation action)
          Returns the action-set matchin a given action as a new instance.
 double getBeta()
          Reading accessor-method for beta.
 double getChi()
          Reading accessor-method for chi.
 double getGamma()
          Reading accessor-method for gamma.
 ZLCS getMatchSet(Situation situation)
          Returns the match-set (before covering) to a given Situation as a new instance.
 double getMy()
          Reading accessor-method for my.
 int getNumVictimsGA()
          Reading accessor-method for numVictimsGA.
 double getP_wild()
          Reading accessor-method for p_wild.
 double getPhi()
          Reading accessor-method for phi.
 double getRho()
          Reading accessor-method for rho.
 double getS_init()
          Reading accessor-method for s_init.
 double getTau()
          Reading accessor-method for tau.
 ZLCS match_n_cover(Situation sit)
          Returns the match-set (after covering) to a given Situation as a new instance.
 void processReward(double reward)
          Processing of a reward
 void setBeta(double beta)
          Writing accessor-method for beta.
 void setChi(double chi)
          Writing accessor-method for chi.
 void setGamma(double gamma)
          Writing accessor-method for gamma.
 void setMy(double my)
          Writing accessor-method for my.
 void setNumVictimsGA(int numVictimsGA)
          Writing accessor-method for numVictimsGA.
 void setP_wild(double p_wild)
          Writing accessor-method for p_wild.
 void setPhi(double phi)
          Writing accessor-method for phi.
 void setRho(double rho)
          Writing accessor-method for rho.
 void setS_init(double s_init)
          Writing accessor-method for s_init.
 void setTau(double tau)
          Writing accessor-method for tau.
 
Methods inherited from class classifierLibrary.ClassifierSystem
add, add, clone, crossover, csSelection, debug_out, filterbyaction, filterbyaction, filterByCondition, filterByCondition, getAverage, getClassifier, getExtremeValues, getName, getSample, getTotal, init, iterator, mutation, randomSubset, remove, remove, remove, RoulettewheelChoice, setName, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZLCS

public ZLCS()
Construktor creating an empty instance of ZLCS


ZLCS

public ZLCS(java.lang.String name,
            StandardClassifier sample,
            int size,
            boolean randomized)
Construktor creating an instance of ZLCS, using a given sample Classifier for filling the instance up to a defined size. Classifiers can be just clones of the sample or their rules can be randomized.

Parameters:
name - Name of the ClassifierSystem
sample - Sample classifier for filling the instance
size - Number of classifiers for initial filling
randomized - If true, the classifiers rule components will be randomized
Method Detail

getBeta

public double getBeta()
Reading accessor-method for beta.

Returns:
content of beta (double)

setBeta

public void setBeta(double beta)
Writing accessor-method for beta.

Parameters:
beta - Value to be set

getChi

public double getChi()
Reading accessor-method for chi.

Returns:
content of chi (double)

setChi

public void setChi(double chi)
Writing accessor-method for chi.

Parameters:
chi - Value to be set

getGamma

public double getGamma()
Reading accessor-method for gamma.

Returns:
content of gamma (double)

setGamma

public void setGamma(double gamma)
Writing accessor-method for gamma.

Parameters:
gamma - Value to be set

getMy

public double getMy()
Reading accessor-method for my.

Returns:
content of my (double)

setMy

public void setMy(double my)
Writing accessor-method for my.

Parameters:
my - Value to be set

getNumVictimsGA

public int getNumVictimsGA()
Reading accessor-method for numVictimsGA.

Returns:
content of numVictimsGA (int)

setNumVictimsGA

public void setNumVictimsGA(int numVictimsGA)
Writing accessor-method for numVictimsGA.

Parameters:
numVictimsGA - Value to be set

getP_wild

public double getP_wild()
Reading accessor-method for p_wild.

Returns:
content of p_wild (double)

setP_wild

public void setP_wild(double p_wild)
Writing accessor-method for p_wild.

Parameters:
p_wild - Value to be set

getPhi

public double getPhi()
Reading accessor-method for phi.

Returns:
content of phi (double)

setPhi

public void setPhi(double phi)
Writing accessor-method for phi.

Parameters:
phi - Value to be set

getRho

public double getRho()
Reading accessor-method for rho.

Returns:
content of rho (double)

setRho

public void setRho(double rho)
Writing accessor-method for rho.

Parameters:
rho - Value to be set

getS_init

public double getS_init()
Reading accessor-method for s_init.

Returns:
content of s_init (double)

setS_init

public void setS_init(double s_init)
Writing accessor-method for s_init.

Parameters:
s_init - Value to be set

getTau

public double getTau()
Reading accessor-method for tau.

Returns:
content of tau (double)

setTau

public void setTau(double tau)
Writing accessor-method for tau.

Parameters:
tau - Value to be set

getMatchSet

public ZLCS getMatchSet(Situation situation)
Returns the match-set (before covering) to a given Situation as a new instance.

Parameters:
situation - Situation to match
Returns:
New instance of ZLCS containing just the matching classifiers

match_n_cover

public ZLCS match_n_cover(Situation sit)
Returns the match-set (after covering) to a given Situation as a new instance.

Parameters:
sit - Situation to match
Returns:
New instance of ZLCS containing the matching and covered classifiers

getActionSet

public ZLCS getActionSet(Situation action)
Returns the action-set matchin a given action as a new instance.

Parameters:
action - Action to match
Returns:
New instance of ZLCS containing the classifiers with matching actions.

getActionChoice

public Situation getActionChoice(Situation condition)
ZLCS-Choice of an action matching a given condition

Parameters:
condition - Condition to match.
Returns:
Action chosen

chooseClassifier

public StandardClassifier chooseClassifier()
Roulettewheel-choice of a StandardClassifier, using the classifiers' strength for determining probabilities.

Returns:
StandardClassifier chosen

cover

public StandardClassifier cover(Situation sit)
Covering: Generation of a new StandardClassifier matching a given Situation.

Parameters:
sit - Situation to match
Returns:
New classifier

GA

public void GA()
Genetic Algorithm, only performed with a probability of Rho


processReward

public void processReward(double reward)
Processing of a reward

Parameters:
reward - Value of the reward to process.