public class TernaryRep extends java.lang.Object implements Attribute
It contains a char value, that represents the value of the alelle.
Constructor and Description |
---|
TernaryRep()
It is the default constructor of the class.
|
TernaryRep(Attribute tr)
It is the constructor of the class.
|
TernaryRep(char value)
It is the constructor of the class.
|
TernaryRep(double env)
It's the constructor of the class value from the environmental value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Attribute tr)
Returns true if the allele is equal to the allele given as a parameter.
|
double |
getGenerality()
It returns the generality of the allele.
|
double |
getLowerAllele()
It returns the lower allele.
|
double |
getUpperAllele()
It returns the upper allele.
|
double |
isDontCareSymbol()
Returns if the character of the representation
is a don't care symbol
|
boolean |
isMoreGeneral(Attribute t)
Indicates if the classifier is more general than
the classifier passed as a parameter.
|
void |
makeSpecify(double env)
Changes the allele if it is a don't care symbol and the random number generated is less than Pspecify.
|
boolean |
match(double env)
Returns true if the allele matches with the environment.
|
void |
mutate(double currentState)
Mutates the character.
|
void |
print()
Prints the allele.
|
void |
print(java.io.PrintWriter out)
Prints the allele.
|
void |
printNotNorm(java.io.PrintWriter fout,
double lo)
Prints the classifier representation not normalized on the PrintWriter object given.
|
void |
printNotNorm(java.io.PrintWriter fout,
double lo,
double up)
Prints the classifier representation not normalized on the PrintWriter object given.
|
void |
setAllele(Attribute tr)
Sets the value of the allele.
|
void |
setAllele(double value,
double value2)
Sets the value of the allele.
|
boolean |
subsumes(Attribute tr)
Returns true if the allele is subsumed by the ternary representation given as a parameter.
|
void |
verifyInterval()
Does verify that the interval construction is correct
|
public TernaryRep()
It is the default constructor of the class. value.
public TernaryRep(double env)
It's the constructor of the class value from the environmental value.
env
- is the environmental value for this attribute.public TernaryRep(char value)
It is the constructor of the class. It initializes the char according to the char value given as a parameter.
value
- is the value that takes the allele.public TernaryRep(Attribute tr)
It is the constructor of the class. It creates a copy of the TernaryRep given as a parameter.
tr
- is the ternary representation that has to be cloned.public void setAllele(double value, double value2)
Sets the value of the allele.
public void setAllele(Attribute tr)
Sets the value of the allele.
public double getGenerality()
getGenerality
in interface Attribute
public void makeSpecify(double env)
makeSpecify
in interface Attribute
env
- is the environment.public void mutate(double currentState)
public boolean match(double env)
Returns true if the allele matches with the environment.
public boolean subsumes(Attribute tr)
Returns true if the allele is subsumed by the ternary representation given as a parameter.
public boolean equals(Attribute tr)
Returns true if the allele is equal to the allele given as a parameter.
public double isDontCareSymbol()
Returns if the character of the representation is a don't care symbol
isDontCareSymbol
in interface Attribute
public boolean isMoreGeneral(Attribute t)
Indicates if the classifier is more general than the classifier passed as a parameter.
isMoreGeneral
in interface Attribute
t
- is the ternary representation of the more
specific classifier.
public void print(java.io.PrintWriter out)
Prints the allele.
public double getUpperAllele()
Attribute
getUpperAllele
in interface Attribute
public double getLowerAllele()
Attribute
getLowerAllele
in interface Attribute
public void verifyInterval()
Attribute
verifyInterval
in interface Attribute
public void printNotNorm(java.io.PrintWriter fout, double lo)
printNotNorm
in interface Attribute
fout
- PrintWriter object given to write on.lo
- lower value in the interval.public void printNotNorm(java.io.PrintWriter fout, double lo, double up)
printNotNorm
in interface Attribute
fout
- PrintWriter object given to write on.lo
- lower value in the interval.up
- upper value in the interval.