public class Population
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private double |
crm
Crossover mean.
|
private Individual[] |
individuals |
private int |
iterationNumber |
private RichArray |
offFitness
Objective function values.
|
private RichMatrix |
offspringGenes
Offspring population.
|
private boolean |
ordered |
Constructor and Description |
---|
Population(int size) |
Population(int dimensions,
int size) |
Modifier and Type | Method and Description |
---|---|
double |
getBestError()
Returns the best error of the current population.
|
Individual |
getBestIndividual()
Returns the best individual of the current population.
|
double |
getCrm() |
Individual |
getIndividual(int pos)
Return an population individual from position pos
|
Individual[] |
getIndividuals() |
int |
getIterationNumber() |
RichArray |
getOffFitness()
Objective function values for DCMA-ES algorithm.
|
RichMatrix |
getOffspringGenes() |
void |
newOffspringGenes() |
void |
order()
Orders the population, from the least to the more error.
|
void |
print(java.lang.String header)
Prints to the standard output the current individuals, one line per individual with all its genes.
|
private static void |
quicksort(Individual[] ind,
int left,
int right)
Quicksort-based ordering algorithm.
|
void |
setCrm(double crm) |
void |
setIndividual(Individual ind,
int pos)
Sets an individual to position pos
|
void |
setIterationNumber(int iterationNumber) |
void |
setOffspringGenes(RichMatrix offX) |
int |
size() |
private Individual[] individuals
private int iterationNumber
private boolean ordered
private RichArray offFitness
private RichMatrix offspringGenes
private double crm
public Population(int dimensions, int size)
dimensions
- Number of genes per individualsize
- Number of individualspublic Population(int size)
public Individual[] getIndividuals()
public Individual getIndividual(int pos)
pos
- position must be less than number of individuals (population size)public void setIndividual(Individual ind, int pos)
ind
- Individual to be insertedpos
- position must be less than number of individuals (population size)public int size()
public void order()
public RichArray getOffFitness()
public RichMatrix getOffspringGenes()
public void newOffspringGenes()
public void setOffspringGenes(RichMatrix offX)
public double getCrm()
public void setCrm(double crm)
private static void quicksort(Individual[] ind, int left, int right)
ind
- left
- right
- public void setIterationNumber(int iterationNumber)
public int getIterationNumber()
public void print(java.lang.String header)
header
- An string to be added at the beginning of the line.public double getBestError()
public Individual getBestIndividual()