com.rubecula.darwin.examples.travelingsalesman
Class Mortality_TS

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.genetics.Mortality_
          extended by com.rubecula.darwin.examples.travelingsalesman.Mortality_TS
All Implemented Interfaces:
Mortality, net.sf.tostring0.IToString

public class Mortality_TS
extends Mortality_

Author:
Robin Hillyard

Field Summary
static double $InfantMortalityDefault
          0.2
 
Fields inherited from class com.rubecula.darwin.domain.genetics.Mortality_
LOG
 
Fields inherited from interface net.sf.tostring0.IToString
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE
 
Constructor Summary
Mortality_TS(org.apache.commons.math.random.RandomGenerator random, double infantMortality)
           
 
Method Summary
 double calculateMortality(int age, double fitness, double saturation)
          Method to calculate the mortality for an organism as 1 less the simple product of viabilityFactor, fitness and sustainabilityIndex.
 
Methods inherited from class com.rubecula.darwin.domain.genetics.Mortality_
calculateAgeViabilityFactor, calculateViability, equals, getBias, getRandom, hashCode, isMarked, setBias
 
Methods inherited from class net.sf.tostring0.AToString
toString, toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

$InfantMortalityDefault

public static final double $InfantMortalityDefault
0.2

See Also:
Constant Field Values
Constructor Detail

Mortality_TS

public Mortality_TS(org.apache.commons.math.random.RandomGenerator random,
                    double infantMortality)
Parameters:
random -
infantMortality - probability of infants dying immediately
Method Detail

calculateMortality

public double calculateMortality(int age,
                                 double fitness,
                                 double saturation)
Method to calculate the mortality for an organism as 1 less the simple product of viabilityFactor, fitness and sustainabilityIndex. The viability factor (VF) = (1-IM)^(age+1) where IM is the infant mortality (20%). The sustainabilityIndex (SI) = 1 if saturation less than 1; else SI = (1 - saturation)^2.

Specified by:
calculateMortality in interface Mortality
Overrides:
calculateMortality in class Mortality_
Parameters:
age - the age of the organism in generations.
fitness - the fitness of the organism for an environment.
saturation - a measure of the current population saturation (1 corresponds to the ideal population supportable by the environment.
Returns:
the probability of death before the next generation (between 0 and 1). TODO consider inlining this into isMarked (ie. pass in age, fitness, saturation, and return boolean)
See Also:
Mortality.calculateMortality(int,double,double)


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.