public class CromDNF
extends java.lang.Object
Defines the structure and manage the contents of a DNF rule. This implementation uses only binary values to store the possible values of the variable.
Constructor and Description |
---|
CromDNF(int length,
TableVar Variables)
Creates new instance of chromosome, no initialization
|
Modifier and Type | Method and Description |
---|---|
int |
getCromElemGene(int pos,
int elem)
Retuns the value of the gene indicated
|
int |
getCromLenght()
Retuns the gene lenght of the chromosome
|
void |
initCrom()
Random initialization of an existing chromosome
|
java.lang.String |
print()
Gets the chromosome genes
|
void |
print(java.lang.String nFile)
Prints the chromosome genes
|
void |
setCromElemGene(int pos,
int elem,
int value)
Sets the value of the indicated gene of the chromosome
|
public CromDNF(int length, TableVar Variables)
Creates new instance of chromosome, no initialization
length
- Length of the chromosomeVariables
- Variables structure.public void initCrom()
Random initialization of an existing chromosome
public int getCromElemGene(int pos, int elem)
Retuns the value of the gene indicated
pos
- Position of the variable in the chromosomeelem
- Position of the gene of the variablepublic void setCromElemGene(int pos, int elem, int value)
Sets the value of the indicated gene of the chromosome
pos
- Position of the variable in the chromosomeelem
- Position of the gene of the variablevalue
- Value of the genepublic int getCromLenght()
Retuns the gene lenght of the chromosome
public void print(java.lang.String nFile)
Prints the chromosome genes
nFile
- Files to write the chromosomepublic java.lang.String print()
Gets the chromosome genes