art.ga
Class Population

java.lang.Object
  extended byart.ga.Population

public class Population
extends java.lang.Object

The population is composed by many Chromosome and represent the space of solutions evaluated at the current generation.

Author:
Marco Lamieri and Gianluigi Ferraris

Constructor Summary
Population(GaConfiguration configuration)
          Constructor of the class.
 
Method Summary
 void generatePopulation()
          Initialize a population with Chromosomes
 double getAverageFitness()
          Get the average fitness within the Population
 Chromosome getChromosome(int position)
          Get a Chromosome of the population in the specific position of the LinkedList chromosomeList
 java.util.ArrayList getChromosomeList()
          Get the list of all the Chromosomes in the population at the current generation.
 double getConvergence()
          Compute convergence on a given population.
 Chromosome getDominantChromosome()
          Compute the dominant chromosome of a given population using the convergence criterion.
 int getGenerationNumber()
          Get current generation number.
 Chromosome getHigherFitted()
          Get Chromosome with higher fitness in the Population at the current generation.
 Chromosome getLowerFitted()
          Get Chromosome with lower fitness in the Population at the current generation.
 int getPopulationSize()
          Get the number of Chromosome in the population.
 double getRescaledTotalFitness()
          Get the total fitness rescaled for the roulette wheel selection.
 double getStdDev()
          Get the standard deviation of the Chromosome's fitness at current generation.
 double getTotalFitness()
          Get the sum of fitness of all Chromosome in the Population at current generation.
 boolean isConvergenceEvaluated()
          Inform if convergence has been evaluated for all the chromosomes of the population in the current generation.
 void nextGeneration()
          Technical operation to move from a generation to the next one.
 void print(boolean printChromosomeDetails, boolean printGenomeDetails)
          Print some Population's information to screen.
 void reciveAnIndividual()
          Not implemented
 void sendAnIndividual()
          Not implemented
 void setBody(Chromosome chromosome, int position)
          Set one of the Cromosomes from wich the Population is composed by.
 void setChromosomeList(java.util.ArrayList list)
          Set all of the Cromosomes from wich the Population is composed by.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Population

public Population(GaConfiguration configuration)
Constructor of the class.

Parameters:
configuration - Configuration from with get parameters
Method Detail

generatePopulation

public void generatePopulation()
Initialize a population with Chromosomes


getAverageFitness

public double getAverageFitness()
Get the average fitness within the Population

Returns:
Average fitness

getChromosome

public Chromosome getChromosome(int position)
Get a Chromosome of the population in the specific position of the LinkedList chromosomeList

Returns:
Requested Chromosome

getChromosomeList

public java.util.ArrayList getChromosomeList()
Get the list of all the Chromosomes in the population at the current generation.

Returns:
Chromosome list

getGenerationNumber

public int getGenerationNumber()
Get current generation number.

Returns:
Generation number

getHigherFitted

public Chromosome getHigherFitted()
Get Chromosome with higher fitness in the Population at the current generation.

Returns:
Higher fitted Chromosome

getLowerFitted

public Chromosome getLowerFitted()
Get Chromosome with lower fitness in the Population at the current generation.

Returns:
Lower fitted Chromosome

getPopulationSize

public int getPopulationSize()
Get the number of Chromosome in the population.

Returns:
Population size

getStdDev

public double getStdDev()
Get the standard deviation of the Chromosome's fitness at current generation.

Returns:
Standard deviation

getTotalFitness

public double getTotalFitness()
Get the sum of fitness of all Chromosome in the Population at current generation.

Returns:
Total fitness

nextGeneration

public void nextGeneration()
Technical operation to move from a generation to the next one.


print

public void print(boolean printChromosomeDetails,
                  boolean printGenomeDetails)
Print some Population's information to screen.

Parameters:
printChromosomeDetails - Options defining if some Chromosome's info have to be printed
printGenomeDetails - Options defining if some Genome's info have to be printed

reciveAnIndividual

public void reciveAnIndividual()
Not implemented


sendAnIndividual

public void sendAnIndividual()
Not implemented


setBody

public void setBody(Chromosome chromosome,
                    int position)
Set one of the Cromosomes from wich the Population is composed by. The Cromosome is added or replace the current one in a given position.

Parameters:
chromosome - Inserted Chromosome
position - Position of insertion.

setChromosomeList

public void setChromosomeList(java.util.ArrayList list)
Set all of the Cromosomes from wich the Population is composed by.

Parameters:
list - Chromosome LinkedList

getRescaledTotalFitness

public double getRescaledTotalFitness()
Get the total fitness rescaled for the roulette wheel selection.

Returns:
Total rescaled fitness

getConvergence

public double getConvergence()
Compute convergence on a given population. The convergence is scaled between 0 and 1 and represent the part of population having the same chromosome. This particular chromosome is the most diffused one and is assumed to be the best solution of the given problem(to obtain it use getDominantChromosome()). The restrictive nature of elitism could cause convergence to one of those local minima, which is most likely a far from optimal solution.

Convergence is useful if the analyzed problem has not known maximum. The best solution is assumed when there is a high convergence. John Holland’s Schema Theorem [Holland, 1992] is widely accepted as mathematical proof that the genetic algorithm, due to its fitness-proportionate reproduction, converges to better solutions. The number of individuals in each group converges if the fitness of that group relative to the entire population is high, and vice versa.

Returns:
Computed convergence. It is scaled between 0 and 1.
See Also:
getDominantChromosome()

getDominantChromosome

public Chromosome getDominantChromosome()
Compute the dominant chromosome of a given population using the convergence criterion. To get dominant chromosome is necessary compute convergence before.

Returns:
The dominant chromosome (most diffused one).
See Also:
getConvergence()

isConvergenceEvaluated

public boolean isConvergenceEvaluated()
Inform if convergence has been evaluated for all the chromosomes of the population in the current generation.

Returns:
Boolean defining if convergence is evaluated