net.sourceforge.jabm.evolution
Class FitnessProportionateBreeder
java.lang.Object
net.sourceforge.jabm.evolution.FitnessProportionateBreeder
- All Implemented Interfaces:
- Breeder
public class FitnessProportionateBreeder
- extends java.lang.Object
- implements Breeder
A breeder which implements Fitness-proportionate reproduction. Agents are
selected for inclusion in the next generation with a probability
proportionate to their fitness, as defined by an exogenous fitness function.
When agents reproduce they do so via an ImitationOperator
which
specifies how agents are copied from one generation to the next.
-
-
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fitnessFunction
protected FitnessFunction fitnessFunction
- The fitness function which specifies the fitness of each agent.
imitationFunction
protected ImitationOperator imitationFunction
prng
protected cern.jet.random.engine.RandomEngine prng
totalFitness
protected double totalFitness
imitationProbability
protected double imitationProbability
FitnessProportionateBreeder
public FitnessProportionateBreeder()
reproduce
public AgentList reproduce(AgentList currentGeneration)
- Description copied from interface:
Breeder
- Compute the next generation of agents.
- Specified by:
reproduce
in interface Breeder
- Parameters:
currentGeneration
- The agents comprising the current generation.
- Returns:
- An AgentList representing the next generation after reproduction
has occurred.
choose
public int choose(double[] cummulativeFitnesses)
reproduce
public void reproduce(Agent child,
Agent parent)
cummulativeFitnesses
public double[] cummulativeFitnesses(AgentList agents)
getFitness
public double getFitness(Agent i)
getFitnessFunction
public FitnessFunction getFitnessFunction()
setFitnessFunction
public void setFitnessFunction(FitnessFunction fitnessFunction)
getPrng
public cern.jet.random.engine.RandomEngine getPrng()
setPrng
public void setPrng(cern.jet.random.engine.RandomEngine prng)
getImitationOperator
public ImitationOperator getImitationOperator()
setImitationOperator
public void setImitationOperator(ImitationOperator imitationFunction)
getImitationProbability
public double getImitationProbability()
setImitationProbability
public void setImitationProbability(double imitationProbability)