evSOLve.JEvolution
Class Population

java.lang.Object
  |
  +--evSOLve.JEvolution.Population

public class Population
extends java.lang.Object

The Population of JEvolution is designed to possibly be of varying size. It only operates on Individuals, so the finer details are hidden on the population level.

Version:
0.4
Author:
Helmut A. Mayer

Method Summary
 void addOffspring(evSOLve.JEvolution.Individual individual)
          Adds an offspring of the Individual to the Population.
 double getFitness(int index)
          Gives the fitness of a specific individual.
 evSOLve.JEvolution.Individual getIndividual(int index)
          Gives specific Individual.
 int getSize()
          Gives the population size.
 void swap(int a, int b)
          Exchanges two Individuals in the Population.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSize

public int getSize()
Gives the population size.

getFitness

public double getFitness(int index)
Gives the fitness of a specific individual.
Parameters:
index - index of Individual (0 - (size - 1))

getIndividual

public evSOLve.JEvolution.Individual getIndividual(int index)
Gives specific Individual.
Parameters:
index - index of Individual (0 - (size - 1))

addOffspring

public void addOffspring(evSOLve.JEvolution.Individual individual)
Adds an offspring of the Individual to the Population. i.e., the Individual is actually cloned, and the clone is added to the Population.
Parameters:
individual - an Individual

swap

public void swap(int a,
                 int b)
Exchanges two Individuals in the Population.
Parameters:
a - index of Individual a
b - index of Individual b