public class Cromosoma
extends java.lang.Object
implements java.lang.Comparable
Constructor and Description |
---|
Cromosoma(boolean[] datos)
Builder.
|
Cromosoma(int size)
Builder.
|
Cromosoma(int size,
Cromosoma a)
Builder.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o1)
Compare to Method
|
int |
differenceAtOne(Cromosoma a)
Function that informs about if a cromosome is different only in a bit, and obtains the
position of this bit.
|
double |
distancia(double[][] datos,
double[][] real,
int[][] nominal,
boolean[][] nulos,
int[] clases,
boolean distanceEu)
Function that calculates the distance between the train set and the cromosome
|
void |
evaluaError(double[][] datos,
double[][] real,
int[][] nominal,
boolean[][] nulos,
int[] clases,
boolean distanceEu)
Function that calculates the error threshold of a cromosome
|
int |
genesActivos()
Return the number of actived genes
|
double |
getCalidad()
Get the quality of a chromosome
|
double |
getErrorRate()
Get the error rate of a chromosome
|
boolean |
getGen(int indice)
Get the value of a gene
|
Cromosoma |
getSnextNminus(double[][] datos,
double[][] real,
int[][] nominal,
boolean[][] nulos,
int[] clases,
boolean distanceEu,
java.util.Vector movs)
Function that returns the best neighbor in N-
|
Cromosoma |
getSnextNplus(double[][] datos,
double[][] real,
int[][] nominal,
boolean[][] nulos,
int[] clases,
boolean distanceEu,
java.util.Vector movs)
Function that returns the best neighbor in N+
|
java.lang.String |
toString()
To String Method
|
public Cromosoma(int size)
size
- Size of the chromosomepublic Cromosoma(int size, Cromosoma a)
size
- Size of the chromosomea
- Chromosome to copypublic Cromosoma(boolean[] datos)
datos
- Initial data of the chromosomepublic boolean getGen(int indice)
indice
- Index of the genepublic double getCalidad()
public double getErrorRate()
public void evaluaError(double[][] datos, double[][] real, int[][] nominal, boolean[][] nulos, int[] clases, boolean distanceEu)
datos
- Reference to the training setreal
- Reference to the training set (real valued)nominal
- Reference to the training set (nominal valued)nulos
- Reference to the training set (null values)clases
- Output attribute of each instancedistanceEu
- True= Euclidean distance; False= HVDMpublic Cromosoma getSnextNplus(double[][] datos, double[][] real, int[][] nominal, boolean[][] nulos, int[] clases, boolean distanceEu, java.util.Vector movs)
datos
- Reference to the training setreal
- Reference to the training set (real valued)nominal
- Reference to the training set (nominal valued)nulos
- Reference to the training set (null values)clases
- Output attribute of each instancedistanceEu
- True= Euclidean distance; False= HVDMmovs
- movements vectorpublic Cromosoma getSnextNminus(double[][] datos, double[][] real, int[][] nominal, boolean[][] nulos, int[] clases, boolean distanceEu, java.util.Vector movs)
datos
- Reference to the training setreal
- Reference to the training set (real valued)nominal
- Reference to the training set (nominal valued)nulos
- Reference to the training set (null values)clases
- Output attribute of each instancedistanceEu
- True= Euclidean distance; False= HVDMmovs
- movements vectorpublic double distancia(double[][] datos, double[][] real, int[][] nominal, boolean[][] nulos, int[] clases, boolean distanceEu)
datos
- Reference to the training setreal
- Reference to the training set (real valued)nominal
- Reference to the training set (nominal valued)nulos
- Reference to the training set (null values)clases
- Output attribute of each instancedistanceEu
- True= Euclidean distance; False= HVDMpublic int genesActivos()
public int compareTo(java.lang.Object o1)
compareTo
in interface java.lang.Comparable
o1
- Chromosome to comparepublic int differenceAtOne(Cromosoma a)
a
- Chromosome to be checked.public java.lang.String toString()
toString
in class java.lang.Object