com.rubecula.darwin.domain.genetics
Class Mortality_Reaper

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

public final class Mortality_Reaper
extends Mortality_

Lifespan: permanent. This default implementation of Mortality provides a basic and reasonable calculation of mortality. The infant mortality can be specified through the constructor (it defaults to 20%).

Version:
$Revision: 1.22 $
Author:
Robin Hillyard

Field Summary
static double INFANT_MORTALITY_DEFAULT
          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_Reaper(org.apache.commons.math.random.RandomGenerator random)
          Secondary constructor using random for random numbers and invoking the constructor Mortality_Reaper(RandomGenerator, double).
Mortality_Reaper(org.apache.commons.math.random.RandomGenerator random, double infantMortality)
          Secondary constructor using random for random numbers and invoking the constructor Mortality_Reaper(RandomGenerator, Number, Number).
Mortality_Reaper(org.apache.commons.math.random.RandomGenerator random, java.lang.Number infantMortality, java.lang.Number actuarialFactor)
          Primary constructor.
 
Method Summary
protected  double calculateAgeViabilityFactor(int age)
          Subclasses where viability depends on age must override this method.
 
Methods inherited from class com.rubecula.darwin.domain.genetics.Mortality_
calculateMortality, 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

INFANT_MORTALITY_DEFAULT

public static final double INFANT_MORTALITY_DEFAULT
0.2

See Also:
Constant Field Values
Constructor Detail

Mortality_Reaper

public Mortality_Reaper(org.apache.commons.math.random.RandomGenerator random)
Secondary constructor using random for random numbers and invoking the constructor Mortality_Reaper(RandomGenerator, double).

Parameters:
random -

Mortality_Reaper

public Mortality_Reaper(org.apache.commons.math.random.RandomGenerator random,
                        double infantMortality)
Secondary constructor using random for random numbers and invoking the constructor Mortality_Reaper(RandomGenerator, Number, Number).

Parameters:
random -
infantMortality -

Mortality_Reaper

public Mortality_Reaper(org.apache.commons.math.random.RandomGenerator random,
                        java.lang.Number infantMortality,
                        java.lang.Number actuarialFactor)
Primary constructor.

Parameters:
random - the random number generator to use
infantMortality - this is the probability of dying in the first year.
actuarialFactor - this is the factor by which the probability of dying increases annually.
Method Detail

calculateAgeViabilityFactor

protected double calculateAgeViabilityFactor(int age)
Description copied from class: Mortality_
Subclasses where viability depends on age must override this method. TEST

Overrides:
calculateAgeViabilityFactor in class Mortality_
Parameters:
age -
Returns:
if age==0 then 1 - infantMortality
else if age==1 then 1
else e ^ ((1-age) * actuarialFactor


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