|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectclassifierLibrary.StandardSituation
Library classifierLibrary, Klasse StandardSituation
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 Summary | |
StandardSituation(Language l,
int Length)
Constructor, creates a string-like sequence of Symbols, with given language and lenght, initializes all places in sequence with the default symbol of the language |
Method Summary | |
java.lang.Object |
clone()
Retuns a copy(clone) of the situation as a new object. |
int |
compare(Situation sit)
Compares the Situation with another one. |
int |
compareSubsumtive(Situation sit)
Compares the Situation with another one. |
boolean |
compatibility(Situation sit)
Method checks compatitbility with another situation, e.g. if Languages match. |
Situation |
cross(Situation sit,
int Position)
Method for crossover at given position, returns new Situation after crossover. |
void |
debug_out()
Output for Debugging. |
Symbol |
getElement(int position)
Returns the Symbol at a given position in the Situation/sequence. |
Language |
getLanguage()
getLanguageReturns the Language defined for the Situation. |
int |
getLength()
Returns the size of the situation, for sets this should be the maximum size / size of the defined basic set. |
boolean |
isMatched(Situation sit)
Criterion for a situation to be matched by another situation, should be used for specifying different types of Situations in subclasses. |
boolean |
isMatchedSubsumtive(Situation sit)
Criterion for a situation to be matched by another situation, should be used for specifying different types of Situations in subclasses. |
Situation |
mutation(double Probability)
Method for mutation with given probability. |
void |
randomizeSituation()
Changes the situation to a random situation based on the given language |
void |
randomizeSituation(double wildprob)
Changes the situation to a random situation based on the given language, using a given probability for wildcard symbols. |
void |
setElement(int Position,
Symbol Symbol)
Sets the Element of the Situation/sequence at given position to the given Symbol. |
void |
setLanguage(Language lang)
Sets the Language to be used for the Situation. |
int |
size()
Returns the size of the situation, can be dynamic if situation is a set. |
int |
specificMembers()
Returns the number of elements in the Situation that are not wildcards. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StandardSituation(Language l, int Length)
l
- Language to useLength
- Length of the sequenceMethod Detail |
public java.lang.Object clone()
Situation
clone
in interface Situation
public int getLength()
Situation
getLength
in interface Situation
public int size()
Situation
size
in interface Situation
public Language getLanguage()
Situation
getLanguage
in interface Situation
public void setLanguage(Language lang)
Situation
setLanguage
in interface Situation
lang
- Language to be setpublic boolean compatibility(Situation sit)
Situation
compatibility
in interface Situation
sit
- Situation to compare with
public Situation cross(Situation sit, int Position)
Situation
cross
in interface Situation
sit
- Situation to cross withPosition
- Position for crossover
public Situation mutation(double Probability)
Situation
mutation
in interface Situation
Probability
- Probability for mutation
public void setElement(int Position, Symbol Symbol)
Position
- Position at which the Symbol has to be setSymbol
- Symbol to setpublic Symbol getElement(int position)
position
- Position of wanted Symbol
public void randomizeSituation()
Situation
randomizeSituation
in interface Situation
public void randomizeSituation(double wildprob)
Situation
randomizeSituation
in interface Situation
wildprob
- Probability for wildcards.public void debug_out()
Situation
debug_out
in interface Situation
public int compare(Situation sit)
Situation
compare
in interface Situation
sit
- Situation to compare with
public int compareSubsumtive(Situation sit)
Situation
compareSubsumtive
in interface Situation
sit
- Situation to compare with
public boolean isMatched(Situation sit)
Situation
isMatched
in interface Situation
sit
- Situation to compare with
public boolean isMatchedSubsumtive(Situation sit)
Situation
isMatchedSubsumtive
in interface Situation
sit
- Situation to compare with
public int specificMembers()
Situation
specificMembers
in interface Situation
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |