public class Poblacion
extends java.lang.Object
Title: Poblacion (Population).
Description: This class implements the population of chromosomes used to perform the genetic algorithm
Constructor and Description |
---|
Poblacion()
Default Constructor.
|
Poblacion(myDataset train,
int n_ejemplos,
int[] ejemplos,
int nGenerations,
double[] pesos,
double valor)
Paramenter constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
BETTER(double a,
double b)
Checks if the double a is greater than b.
|
void |
genetico()
Performs the GA to generate the different rules for the decision tree.
|
double[] |
mejorSolucion()
Returns the best solution obtained by the GA.
|
public Poblacion()
public Poblacion(myDataset train, int n_ejemplos, int[] ejemplos, int nGenerations, double[] pesos, double valor)
n_ejemplos
- number of examples used to build the population.ejemplos
- examples used to build the population.pesos
- initial weights associated to the examples given.valor
- initial value for the chromosomes.nGenerations
- maximum number for generations.train
- training dataset.public boolean BETTER(double a, double b)
a
- first given number.b
- second given number.public void genetico()
public double[] mejorSolucion()