com.rubecula.darwin.core
Interface Population

All Superinterfaces:
Auditable, CensusibleCollection, Generatable, Identifiable
All Known Implementing Classes:
Population_Abstract, Population_Default, Population_TS

public interface Population
extends Generatable, Identifiable, Auditable, CensusibleCollection

Defines the properties (methods) which characterize a population in an Evolutionary Computation. Briefly, a population consists of a collection of instances of Organism, and which is subject to an Environment. A population forms part of a Darwinian system, which in turn provides definitions for the genetic and physical aspects of the organisms.

Author:
Robin

Method Summary
 boolean add(Organism organism)
           
 void addListener(PopulationListener listener)
          Add a listener to population change events.
 String createIdentifier()
          Method to yield an unique identifier within this population.
 Environment getEnvironment()
          Method to get the environment in which this population thrives.
 Fitness getFitness()
          Method to get an application-supplied fitness function for this population.
 Genome getGenome()
          Method to get the genome for this population.
 Phenome getPhenome()
          Method to get the phenome for this population.
 double getSaturation()
          Method to determine the population saturation.
 Darwinian getSystem()
          Method to get the Darwinian system to which this population belongs.
 boolean isIsolated()
           
 Iterator<Organism> iterator()
           
 Mating pairUp(Random random, MateChoice chooser, Organism_Sexual female)
          Create a pair bond.
 void seedGeneration(int organisms)
          Method to seed a population which a certain number of organisms.
 void setIsolated(boolean isolated)
           
 int size()
           
 
Methods inherited from interface com.rubecula.darwin.core.Generatable
getGeneration, midGenerationProcessing, nextGeneration, postGenerationCleanup, preGenerationPreparation
 
Methods inherited from interface com.rubecula.util.Auditable
audit, audit, audit
 
Methods inherited from interface com.rubecula.darwin.core.CensusibleCollection
enumerateCollection
 

Method Detail

add

boolean add(Organism organism)

addListener

void addListener(PopulationListener listener)
Add a listener to population change events.

Parameters:
listener - an implementer of PopulationListener.

createIdentifier

String createIdentifier()
Method to yield an unique identifier within this population.

Returns:
a string which is represents the next integer in a sequence. TODO use the generation number for id

getEnvironment

Environment getEnvironment()
Method to get the environment in which this population thrives.

Returns:
the environment.

getFitness

Fitness getFitness()
Method to get an application-supplied fitness function for this population. This is a convenience method which is equivalent to: getPhenome().getFitnessFunction()

Returns:
an implementation of Fitness. TODO consider removing this convenience method.

getGenome

Genome getGenome()
Method to get the genome for this population.

Returns:
the genome for this population's system.

getPhenome

Phenome getPhenome()
Method to get the phenome for this population.

Returns:
Darwinian.getPhenome() for this population's system. TODO consider removing this convenience method.

getSaturation

double getSaturation()
Method to determine the population saturation. One of the Eco Factors is the ideal population which the environment can support.

Returns:
current population divided by ideal population (unless the latter is undefined in which case the value 1 is returned).

getSystem

Darwinian getSystem()
Method to get the Darwinian system to which this population belongs.

Returns:
this population's Darwinian system.

isIsolated

boolean isIsolated()
Returns:
the value of the isolated flag. True if females from this population cannot find mates in other populations.

iterator

Iterator<Organism> iterator()
Returns:
an Iterator on all Organisms in this Population

pairUp

Mating pairUp(Random random,
              MateChoice chooser,
              Organism_Sexual female)
Create a pair bond.

Parameters:
random - a random number source
chooser - an implementer of MateChoice
female - an Organism_Sexual which will choose a male
Returns:
a new instance of Mating with female as the female part of the pair.

seedGeneration

void seedGeneration(int organisms)
Method to seed a population which a certain number of organisms.

Parameters:
organisms - the number of organisms to be seeded.

setIsolated

void setIsolated(boolean isolated)
Parameters:
isolated - the isolated to set

size

int size()
Returns:
the number of Organisms in this population.