public class Gene
extends java.lang.Object
This class implements a gene as specified by the COGIN algorithm
Constructor and Description |
---|
Gene()
Default constructor
|
Gene(Attribute a)
this constructor builds up a gene from the information of an attribute
|
Gene(Gene gen)
Copy constructor, performs a deep copy of the passed object
|
Modifier and Type | Method and Description |
---|---|
void |
applydiffs(double value)
Transforms the current gene, so the attribute value is now covered
by this gene
|
java.util.ArrayList<java.lang.Integer> |
bin2nominal()
This method converts from the status of the gene to a
list of nominals values of the attribute which are currently covered
|
char |
getBit(int pos)
Get the bit indicated
|
int |
getNegationBit()
Obtains the status of the negation bit
|
int |
getNumBits()
Obtains the number of bits (computed from the attribute associated)
|
void |
setBit(int i,
char newBit)
Sets the bits status indicated by index and value
|
void |
setNegation(int isNeg)
Sets the negation bit of this gene
|
boolean |
test(double value)
Test if the passed value (index of the nominal in the
attribute) is covered by this gene
|
public Gene()
Default constructor
public Gene(Attribute a)
this constructor builds up a gene from the information of an attribute
a
- the attributepublic Gene(Gene gen)
Copy constructor, performs a deep copy of the passed object
gen
- the gene to be copiedpublic int getNegationBit()
Obtains the status of the negation bit
public int getNumBits()
Obtains the number of bits (computed from the attribute associated)
public char getBit(int pos)
Get the bit indicated
pos
- position of the bit to be retrievedpublic void setNegation(int isNeg)
Sets the negation bit of this gene
isNeg
- The new negation statuspublic void setBit(int i, char newBit)
Sets the bits status indicated by index and value
i
- the index of the bitnewBit
- the new status (0 or 1)public java.util.ArrayList<java.lang.Integer> bin2nominal()
This method converts from the status of the gene to a list of nominals values of the attribute which are currently covered
public boolean test(double value)
Test if the passed value (index of the nominal in the attribute) is covered by this gene
value
- the index of the nominal value in the attribute listpublic void applydiffs(double value)
Transforms the current gene, so the attribute value is now covered by this gene
value
- the nominal value to be covered