com.rubecula.darwin.domain.genetics
Class Fecundity_Saturated

java.lang.Object
  extended by com.rubecula.darwin.domain.genetics.Fecundity_
      extended by com.rubecula.darwin.domain.genetics.Fecundity_Saturated
All Implemented Interfaces:
Fecundity

public final class Fecundity_Saturated
extends Fecundity_

Lifespan: permanent. Default implementation of Fecundity. Fecundity is defined according to population saturation. See the saturation thresholds: $DefaultSaturationThresholds. TODO extend this type with Fecundity_RK which conforms to the RK selection theory model.

Version:
$Revision: 1.20 $
Author:
Robin Hillyard

Field Summary
static double[] $DefaultSaturationThresholds
          If less than 30% saturated, then fecundity = 4; else if less than 75% saturated, then fecundity = 3; else if less than 100% saturated, then fecundity = 2; else if less than 200% saturated, then fecundity = 1; else fecundity = 0;
 
Fields inherited from class com.rubecula.darwin.domain.genetics.Fecundity_
LOG
 
Constructor Summary
Fecundity_Saturated()
          Constructor using default saturation thresholds, viz.
Fecundity_Saturated(double[] saturationThresholds)
          Constructor using default saturation thresholds, viz.
 
Method Summary
 int getFecundity(Colony colony)
          Get the fecundity for a population whose saturation is given by saturation.
 int getFecundity(double saturation)
          TODO reduce visibility to default.
protected  double[] getSaturationThresholds()
          TEST
 void setSaturationThresholds(double[] thresholds)
          Typically set by bean properties (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

$DefaultSaturationThresholds

public static final double[] $DefaultSaturationThresholds
If less than 30% saturated, then fecundity = 4; else if less than 75% saturated, then fecundity = 3; else if less than 100% saturated, then fecundity = 2; else if less than 200% saturated, then fecundity = 1; else fecundity = 0;

Constructor Detail

Fecundity_Saturated

public Fecundity_Saturated()
Constructor using default saturation thresholds, viz. $DefaultSaturationThresholds.


Fecundity_Saturated

public Fecundity_Saturated(double[] saturationThresholds)
Constructor using default saturation thresholds, viz. $DefaultSaturationThresholds.

Parameters:
saturationThresholds - This is the array of saturation thresholds for calculating fecundity. The number of possible non-zero fecundity values which may result is equal to the number of thresholds in the array. The thresholds must be ordered from highest saturation to lowest saturation. A saturation value which is higher than the 0th element will result in a zero fecundity.
Method Detail

getFecundity

public int getFecundity(Colony colony)
Get the fecundity for a population whose saturation is given by saturation. The fecundity is determined by a lookup table of thresholds which may be set via _SaturationThresholds and which defaults to $DefaultSaturationThresholds.

Parameters:
colony - the colony to which the progeny will be born.
Returns:
a number greater than 0
See Also:
Fecundity.getFecundity(com.rubecula.darwin.domain.helper.Colony)

getFecundity

public int getFecundity(double saturation)
TODO reduce visibility to default.

Parameters:
saturation -
Returns:
a number greater than 0

setSaturationThresholds

public void setSaturationThresholds(double[] thresholds)
Typically set by bean properties (i.e. reflection, dependency injection).

Parameters:
thresholds -

getSaturationThresholds

protected double[] getSaturationThresholds()
TEST

Returns:
the array of saturation thresholds as set by setSaturationThresholds(double[]).


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