sdt.ga
Class Population

java.lang.Object
  |
  +--sdt.ga.Population

public class Population
extends java.lang.Object
implements java.io.Serializable

Provides a representation of a population in a particular genertion. The population consists of a number of organisms.

See Also:
Serialized Form

Field Summary
 Population old
           
 Organism[] storage
           
 
Constructor Summary
Population(GeneticAlgorithm ga, boolean instantiate_organisms)
          Creates an instance of population with organisms instatiated depending on the specification
 
Method Summary
protected  void applyMGAOps(Organism incumbent)
          Implements the MGA operations.
 void crossover()
          Implements the recombination by crossing over successive organisms.
 Fitness getAvgFitness()
           
 Organism getFittestOrganism()
          Returns the fittest organism in the current population.
 Organism getRandomOrganism()
           
 int getRandomPosition(int length)
           
 void mutate()
          Implements the mutation operator
 void populateWith(Population old)
          Implements the tournament selection of organisms in the present population from the old population.
 void populateWith(Population old, Organism incumbent, Organism[] MGA)
          Tournament Selection operation when MGA solutions are required.
 void randomize()
          Randomizes the population by randomizing each constituting organism.
 void setGA(GeneticAlgorithm ga)
           
 java.lang.String toString()
           
protected  Organism[] updateMGA(Organism[] MGA, Organism incumbent)
          updates the MGA solution set if better solutions are found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

storage

public Organism[] storage

old

public Population old
Constructor Detail

Population

public Population(GeneticAlgorithm ga,
                  boolean instantiate_organisms)
Creates an instance of population with organisms instatiated depending on the specification
Method Detail

randomize

public void randomize()
Randomizes the population by randomizing each constituting organism.

populateWith

public void populateWith(Population old)
Implements the tournament selection of organisms in the present population from the old population.

populateWith

public void populateWith(Population old,
                         Organism incumbent,
                         Organism[] MGA)
Tournament Selection operation when MGA solutions are required.

applyMGAOps

protected void applyMGAOps(Organism incumbent)
Implements the MGA operations.

updateMGA

protected Organism[] updateMGA(Organism[] MGA,
                               Organism incumbent)
updates the MGA solution set if better solutions are found.

crossover

public void crossover()
Implements the recombination by crossing over successive organisms.

mutate

public void mutate()
Implements the mutation operator

getRandomOrganism

public Organism getRandomOrganism()

getFittestOrganism

public Organism getFittestOrganism()
Returns the fittest organism in the current population.

getAvgFitness

public Fitness getAvgFitness()

setGA

public void setGA(GeneticAlgorithm ga)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRandomPosition

public int getRandomPosition(int length)