geneticWedge.gp
Class DemicPopulation

java.lang.Object
  extended by geneticWedge.gp.AbstractPopulation
      extended by geneticWedge.gp.Population
          extended by geneticWedge.gp.DemicPopulation

public class DemicPopulation
extends Population

DemicPopulation is an extension of Population that allows only local breeding, and tournaments are perfomed within a local 'deme'. The concept of a 'location' therefore exists for an Individual within a DemicPopulation.

When using a multi-objective fitnessFunction, a DemicPopulation may not behave in the expected way. The population size of a DemicPopulation is always maintained, so setting keepDominatedIndividuals to false has no effect. Instead, the number of Individuals in the whole population by which an Individual is dominated is used as the fitness function.

In a similar way, the DIVERSITY_DISTANCE measure finds the average distance of an Individual to the whole population, not just to the Individuals within its deme. On the other hand, performanceFunctions that do not depend on other members of the population do not have to consider Individuals outside the Individual's deme.


Nested Class Summary
 
Nested classes/interfaces inherited from class geneticWedge.gp.Population
Population.PerformanceFunction
 
Nested classes/interfaces inherited from class geneticWedge.gp.AbstractPopulation
AbstractPopulation.FitnessFunction, AbstractPopulation.SelectionMethod
 
Field Summary
 
Fields inherited from class geneticWedge.gp.Population
evolutionNumber, printInfo
 
Fields inherited from class geneticWedge.gp.AbstractPopulation
allFitnesses, aurocSampleSize, averageTrainFitness, averageValidationFitness, bestIndex, bestTrainFitness, bestTrainFitnessSoFar, bestValidationFitness, bestValidationFitnessSoFar, fitnessFunction, generationNumber, maxGenerations, popDescriptor, popSize, recFitnessFunction, startingPopSize, tournamentSize
 
Constructor Summary
DemicPopulation(int width, int length, int demeSize, PopulationDescriptor desc)
          DemicPopulations have restricted breeding between nearby Individuals.
 
Method Summary
 boolean evolve(boolean steadyState, AbstractPopulation.SelectionMethod selectMethod, double[][] inputs, double[] targetOutputs, double[][] validationInputs, double[] validationTargetOutputs, StoppingCriterion stopCriterion)
          DemicPopulation is designed to be used with tournament selection in steady state mode.
 boolean evolve(boolean steadyState, double[][] inputs, double[] targetOutputs, double[][] validationInputs, double[] validationTargetOutputs, StoppingCriterion stopCriterion)
          If this method is called, the selection method will be deduced from the value of steadyState.
protected  void evolveOneGeneration(boolean steadyState, AbstractPopulation.SelectionMethod selectMethod, double[][] inputs, double[] targetOutputs)
           
 int[] getDimensions()
          Returns the width and length of this population.
 
Methods inherited from class geneticWedge.gp.Population
collectTransmissionInfo, getAllCutDepthCorrelations, getAllSquaredDistances, getAverageComplexity, getAverageCutDepthCorrelation, getAverageFitness, getAverageIndividualLength, getAverageSquaredDistance, getAverageSquaredDistance, getAverageSquaredDistance, getAverageTrainingFitness, getAverageValidationFitness, getBestIndividual, getBestTrainingFitness, getBestValidatedIndividual, getBestValidationFitness, getBroodUse, getCrossover, getDiversity, getFitnesses, getFitnessFunction, getFitnessShare, getIndividuals, getKeepDominated, getMaximumIndividualDepth, getMaximumIndividualLength, getMultiObjective, getMutation, getPerformanceFunctions, getRankGradient, getShareType, getShareWeightings, getSquaredDistances, getTransmissionInfo, hasNoDiversity, removeDominatedIndividuals, removeDuplicatedIndividuals, savePopulation, setBroodUse, setCrossover, setFitnessFunction, setFitnessShare, setKeepDominated, setMaximumIndividualDepth, setMaximumIndividualLength, setMutation, setPerformanceFunctions, setPrintStatus, setRankGradient, setShareWeightings, setSingleObjectiveRatio, setTransmissionWritingParameters, setTruncationParameters, ShellSortIndividuals, ShellSortIndividuals, ShellSortIndividuals, ShellSortIndividuals
 
Methods inherited from class geneticWedge.gp.AbstractPopulation
getAUROCSampleSize, getGenerationNumber, getInitialPopulationSize, getMaxGenerations, getPopulationDescriptor, getPopulationSize, getRECFitnessFunction, getTournamentSize, setAUROCSampleSize, setMaxGenerations, setRECFitnessFunction, setTournamentSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DemicPopulation

public DemicPopulation(int width,
                       int length,
                       int demeSize,
                       PopulationDescriptor desc)
DemicPopulations have restricted breeding between nearby Individuals. Each Individual therefore has a notional geographical location. A DemicPopulation is arranged in a torus, with Individuals at the 'edges' of the population able to breed with Individuals on the opposite 'edge'. The total population size is equal to the width multiplied by the length. DemicPopulation is designed for use with RANDOM or TOURNAMENT selection. These use local tournaments to determine which Individuals to remove and which will parent the replacement Individual. Other selection methods use a roulette wheel to select the Individual to be removed and then perform local tournaments to select the parents of the replacement offspring.

Parameters:
width - the width of the population
length - the length of the population
demeSize - the height and width of a deme used to select breeding parents.
Method Detail

evolve

public boolean evolve(boolean steadyState,
                      double[][] inputs,
                      double[] targetOutputs,
                      double[][] validationInputs,
                      double[] validationTargetOutputs,
                      StoppingCriterion stopCriterion)
If this method is called, the selection method will be deduced from the value of steadyState. If true, the selection method will be set to TOURNAMENT. If false the selection method will be set to FITNESS_PROPORTIONAL.

Overrides:
evolve in class Population

evolve

public boolean evolve(boolean steadyState,
                      AbstractPopulation.SelectionMethod selectMethod,
                      double[][] inputs,
                      double[] targetOutputs,
                      double[][] validationInputs,
                      double[] validationTargetOutputs,
                      StoppingCriterion stopCriterion)
DemicPopulation is designed to be used with tournament selection in steady state mode. It is possible to run this method with alternative inputs, but this may not give the desired output.

EXAMPLE

If this method is called in steadyState mode with a selectMethod that uses roulette wheel selection (FITNESS_PROPORTIONAL, RANK or FUSS), elitist selection will not occur, even if an elite size has been set. In order to acieve elitist selection with these methods, generational evolution must be applied. However, as Individuals are added into the next generation there is no guarantee that offspring bred from nearby parents will be near to each other, if using generational mode.

Overrides:
evolve in class Population

evolveOneGeneration

protected void evolveOneGeneration(boolean steadyState,
                                   AbstractPopulation.SelectionMethod selectMethod,
                                   double[][] inputs,
                                   double[] targetOutputs)
Overrides:
evolveOneGeneration in class Population

getDimensions

public int[] getDimensions()
Returns the width and length of this population. The overall size of this DemicPopulation is width * length.