public class CromCAN
extends java.lang.Object
Defines the structure and manage the contents of a canonical rule. This implementation uses only integer values to store the gens.
Constructor and Description |
---|
CromCAN(int length)
Creates new instance of chromosome, no initialization
|
Modifier and Type | Method and Description |
---|---|
int |
getCromElem(int pos)
Retuns the value of the gene indicated
|
int |
getCromLenght()
Retuns the gene lenght of the chromosome
|
void |
initCrom(TableVar Variables)
Random initialization of an existing chromosome
|
void |
print(java.lang.String nFile)
Prints the chromosome genes
|
void |
setCromElem(int pos,
int value)
Sets the value of the indicated gene of the chromosome
|
public CromCAN(int length)
Creates new instance of chromosome, no initialization
length
- Length of the chromosomepublic void initCrom(TableVar Variables)
Random initialization of an existing chromosome
Variables
- contents the characteristics of the variablespublic int getCromElem(int pos)
Retuns the value of the gene indicated
pos
- Position of the variable in the chromosomepublic void setCromElem(int pos, int value)
Sets the value of the indicated gene of the chromosome
pos
- Position of the variable in the chromosomevalue
- Value of the variablepublic int getCromLenght()
Retuns the gene lenght of the chromosome
public void print(java.lang.String nFile)
Prints the chromosome genes
nFile
- File to write the chromosome