com.rubecula.darwin.core
Class Fecundity_Default

java.lang.Object
  extended by com.rubecula.darwin.core.Fecundity_Abstract
      extended by com.rubecula.darwin.core.Fecundity_Default
All Implemented Interfaces:
Fecundity

public final class Fecundity_Default
extends Fecundity_Abstract

Default implementation of Fecundity. Fecundity is defined according to population saturation. See the saturation thresholds: $DefaultSaturationThresholds.

Version:
$Revision: 1.2 $
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.core.Fecundity_Abstract
log
 
Constructor Summary
Fecundity_Default()
          Constructor using default saturation thresholds, viz.
Fecundity_Default(double[] saturationThresholds)
          Constructor using default saturation thresholds, viz.
 
Method Summary
 int getFecundity(double saturation)
          Get the fecundity for a population whose saturation is given by saturation.
 
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_Default

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


Fecundity_Default

public Fecundity_Default(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(double saturation)
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:
saturation - the fraction of the sustainable population which the population currently numbers. A population at the sustainable limit has a saturation of 1.
Returns:
a number greater than 0
See Also:
Fecundity.getFecundity(double)