|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.tostring0.AToString com.rubecula.darwin.domain.genetics.Mortality_
public abstract class Mortality_
Abstract class which defines the base methods and fields needed to implement
the Mortality
interface.
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
LOG
The logger for this class. |
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 | |
---|---|
protected |
Mortality_(org.apache.commons.math.random.RandomGenerator random)
Protected primary constructor. |
Method Summary | |
---|---|
protected double |
calculateAgeViabilityFactor(int age)
Subclasses where viability depends on age must override this method. |
double |
calculateMortality(int age,
double fitness,
double saturation)
Method to calculate the mortality for an organism as 1 less the simple value of calculateViability(int, double, double) , given the age,
fitness and saturation. |
protected double |
calculateViability(int age,
double fitness,
double saturation)
|
boolean |
equals(java.lang.Object obj)
|
protected double |
getBias()
|
protected org.apache.commons.math.random.RandomGenerator |
getRandom()
|
int |
hashCode()
|
boolean |
isMarked(double mortality)
|
void |
setBias(double bias)
Set the value of bias. |
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 |
---|
protected static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
protected Mortality_(org.apache.commons.math.random.RandomGenerator random)
random
- a random number generatorMethod Detail |
---|
public double calculateMortality(int age, double fitness, double saturation)
calculateViability(int, double, double)
, given the age,
fitness and saturation. The viability factor (VF) = (1-IM) if age=0 where
IM is the infant mortality (20%, by default) otherwise, VF =
(1-AF)^(age+1) where AF is the actuarial factor (10%, by default). The
sustainabilityIndex (SI) = 1 if saturation less than 1; else SI = (1 -
saturation)^2.
calculateMortality
in interface Mortality
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.
Mortality.calculateMortality(int,double,double)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean isMarked(double mortality)
isMarked
in interface Mortality
mortality
- the probability that an organism will die before the next
generation (a value between 0 and 1).
public void setBias(double bias)
bias
- a value between 0 and 1. If 0 then most organisms will
probably die, while if 1 then few organisms are likely to die.protected double calculateAgeViabilityFactor(int age)
age
-
protected double calculateViability(int age, double fitness, double saturation)
age
- fitness
- saturation
-
protected double getBias()
protected org.apache.commons.math.random.RandomGenerator getRandom()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |