public class CromCAN
extends java.lang.Object
Defines the structure and manage the contents of a rule This implementation uses only integer values to store the gens. So, variables values must be discretized (if they are continuous) or translated into integers (if they are enumerated)
Constructor and Description |
---|
CromCAN(int lenght)
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
|
int |
getCromElem(int pos)
Retuns the value of the gene indicated
|
int |
getCromLength()
Retuns the gene lenght of the chromosome
|
void |
Print(java.lang.String nFile)
Prints the chromosome genes
|
void |
RndInitCrom(TableVar Variables)
Random initialization of an existing chromosome
|
void |
setCromElem(int pos,
int value)
Sets the value of the indicated gene of the chromosome
|
public CromCAN(int lenght)
Creates new instance of chromosome, no initialization
lenght
- Length of the chromosomepublic void RndInitCrom(TableVar Variables)
Random initialization of an existing chromosome
Variables
- Contents the type of the variable, and the number of labels.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
- Percentage of participating variablespublic 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 getCromElem(int pos)
Retuns the value of the gene indicated
pos
- Position of the genepublic void setCromElem(int pos, int value)
Sets the value of the indicated gene of the chromosome
pos
- Position of the genevalue
- Value of the genepublic int getCromLength()
Retuns the gene lenght of the chromosome
public void Print(java.lang.String nFile)
Prints the chromosome genes
nFile
- Fichero to write the cromosome