public class CromosomaEntero extends Cromosoma
fitness, rep, tamCromosoma
Constructor and Description |
---|
CromosomaEntero(int numCaracs,
int tam)
Creates a new instance of CromosomaEntero
|
Modifier and Type | Method and Description |
---|---|
void |
cambiarGen(int nuevoValorGen,
int posGen)
modifies the ith value of a gene
|
void |
cruzar(Cromosoma padre2,
Cromosoma hijo1,
Cromosoma hijo2)
crossover operator.
|
boolean |
cruzarHUX(Cromosoma padre2,
Cromosoma hijo1,
Cromosoma hijo2,
int umbral)
this method can't be applied to integer chromosome.
|
boolean[] |
devolverFeaturesVector()
returns a boolean array needed for Leaving One Out, Cross Validation and other methods used in
Feature Selection Algorithm
|
int |
devolverGen(int i)
return the ith gen of chromosome
|
void |
initPlantilla(Cromosoma crPlantilla,
double ratio)
this method is used in CHC method.
|
void |
initRand()
random initialization of a chromosome.
|
void |
mutar()
integer mutation operator in one point
|
java.lang.String |
print()
it prints a chromosome, gene by gene
|
copy, devolverTamCromosoma, getFitness, isEqual, setFitness
public CromosomaEntero(int numCaracs, int tam)
tam
- is the number of features to be selectednumCaracs
- is the total dataset's featurespublic void initRand()
public void initPlantilla(Cromosoma crPlantilla, double ratio)
initPlantilla
in class Cromosoma
crPlantilla
- is a chromosome templateratio
- is the ratio of random initializationpublic int devolverGen(int i)
devolverGen
in class Cromosoma
i
- is the ith positionpublic void cambiarGen(int nuevoValorGen, int posGen)
cambiarGen
in class Cromosoma
nuevoValorGen
- the new value for the geneposGen
- the position what we want to change (0..tamCromsoma-1)public void cruzar(Cromosoma padre2, Cromosoma hijo1, Cromosoma hijo2)
public boolean cruzarHUX(Cromosoma padre2, Cromosoma hijo1, Cromosoma hijo2, int umbral)
public void mutar()
public java.lang.String print()
public boolean[] devolverFeaturesVector()
devolverFeaturesVector
in class Cromosoma