public class Classifier
extends java.lang.Object
implements java.lang.Cloneable
Libary classifierLibrary, Class Classifier
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.
Constructor and Description |
---|
Classifier(Rule r)
Constructor
|
Modifier and Type | Method and Description |
---|---|
double |
callFunction(java.lang.String which)
Calls a functional method of the classifier specified by its name (no
further parameters).
|
java.lang.Object |
clone() |
boolean |
compatibility(Classifier cl)
Checks compatibility of instance to another instance.
|
double |
conditionMatchSubsumptive(Situation sit)
Computes relative degree of a classifiers condition matching a given
situation.
|
Classifier |
cross(Classifier cl)
Returns Classifier as a result of crossing with another classifier,
crossing at random position.
|
Classifier |
cross(Classifier cl,
int position)
Returns Classifier that is a result of crossing with another given
classifier, crossing at defined position.
|
void |
debug_out()
Method for debugging-purposes.
|
long |
getID()
Returns running number of classifier-object for debugging purposes.
|
Rule |
getRule()
Returns the rule part of the classifier.
|
Classifier |
mutation(double probability)
Returns mutation of the current classifier.
|
void |
setRule(Rule r)
Sets rule-part of the classifier to the given rule.
|
double |
size()
Returns size of the classifiers rule, if situations are defined as
sets should be size of the sets.
|
public Classifier(Rule r)
r
- rule, becoming part of the classifier.public java.lang.Object clone()
clone
in class java.lang.Object
public Rule getRule()
public void setRule(Rule r)
r
- rule to be set for the classifierpublic double conditionMatchSubsumptive(Situation sit)
sit
- situation for comparisonpublic boolean compatibility(Classifier cl)
cl
- Classifier against which compatibility is to be checked.public void debug_out()
public Classifier cross(Classifier cl, int position)
cl
- Classifier to cross withposition
- position for crossoverpublic Classifier cross(Classifier cl)
Returns Classifier as a result of crossing with another classifier, crossing at random position.
cl
- Classifier tp cross withpublic Classifier mutation(double probability)
Returns mutation of the current classifier. Mutation of elements with given probability.
probability
- probability of mutationpublic long getID()
Returns running number of classifier-object for debugging purposes.
public double size()
Returns size of the classifiers rule, if situations are defined as sets should be size of the sets.
public double callFunction(java.lang.String which)
Calls a functional method of the classifier specified by its name (no further parameters). Enables calling sub-class-specific functions even when using objects declared with generic classes.
which
- name of function