public class CromDNF
extends java.lang.Object
Defines the structure and manage the contents of a rule This implementation uses disjunctive formal norm to store the gens. So, variables are codified in binary genes
Constructor and Description |
---|
CromDNF(int lenght,
TableVar Variables)
Creates new instance of chromosome, no initialization
|
Modifier and Type | Method and Description |
---|---|
void |
BsdInitCrom(TableVar Variables,
float porcVar)
Biased Random initialization of an existing chromosome
|
void |
CobInitCrom(Population pop,
TableVar Variables,
TableDat Examples,
float porcCob,
int nobj)
Initialization based on coverage
|
boolean |
getCromGeneElem(int pos,
int elem)
Retuns the value of the gene indicated
|
int |
getCromGeneLenght(int pos)
Retuns the gene lenght of the chromosome
|
int |
getCromLenght()
Retuns the lenght of the chromosome
|
void |
Print(java.lang.String nFile)
Prints the chromosome genes
|
void |
RndInitCrom()
Random initialization of an existing chromosome
|
void |
setCromGeneElem(int pos,
int elem,
boolean val)
Sets the value of the indicated gene of the Chromosome
|
public CromDNF(int lenght, TableVar Variables)
Creates new instance of chromosome, no initialization
lenght
- Length of the chromosomeVariables
- Structure of variables of the datasetpublic void RndInitCrom()
Random initialization of an existing chromosome
public void BsdInitCrom(TableVar Variables, float porcVar)
Biased Random initialization of an existing chromosome
Variables
- Contents the type of the variable, and the number of labels.porcVar
- Participating variables in the chromosompublic void CobInitCrom(Population pop, TableVar Variables, TableDat Examples, float porcCob, int nobj)
Initialization based on coverage
pop
- Main populationVariables
- Contents the type of the variable, and the number of labels.Examples
- DatasetporcCob
- Percentage of participating variablesnobj
- Number of objectives of the algorithmpublic int getCromLenght()
Retuns the lenght of the chromosome
public int getCromGeneLenght(int pos)
Retuns the gene lenght of the chromosome
pos
- gene's positionpublic boolean getCromGeneElem(int pos, int elem)
Retuns the value of the gene indicated
pos
- Position of the variableelem
- Position of the genepublic void setCromGeneElem(int pos, int elem, boolean val)
Sets the value of the indicated gene of the Chromosome
pos
- Position of the variableelem
- Position of the geneval
- Value to insertpublic void Print(java.lang.String nFile)
Prints the chromosome genes
nFile
- Fichero to write the chromosome