Class ConstantPopulation

  • All Implemented Interfaces:
    DemographicFunction
    Direct Known Subclasses:
    ExponentialGrowth

    public class ConstantPopulation
    extends java.lang.Object
    implements DemographicFunction
    This class models coalescent intervals for a constant population (parameter: N0=present-day population size).
    If time units are set to Units.EXPECTED_SUBSTITUTIONS then the N0 parameter will be interpreted as N0 * mu.
    Also note that if you are dealing with a diploid population N0 will be out by a factor of 2.
    Version:
    $Id: ConstantPopulation.java 390 2006-07-20 14:33:51Z rambaut $
    Author:
    Andrew Rambaut, Alexei Drummond
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstantPopulation()
      Construct demographic model with default settings
      ConstantPopulation​(double N0)
      Construct demographic model with given settings
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getArgument​(int n)
      Returns the value of the nth argument of this function.
      int getArgumentCount()
      Returns the number of arguments for this function.
      java.lang.String getArgumentName​(int n)
      Returns the name of the nth argument of this function.
      double getDemographic​(double t)
      Gets the value of the demographic function N(t) at time t.
      double getIntegral​(double start, double finish)
      Calculates the integral 1/N(x) dx between start and finish.
      double getIntensity​(double t)
      Returns value of demographic intensity function at time t (= integral 1/N(x) dx from 0 to t).
      double getInverseIntensity​(double x)
      Returns value of inverse demographic intensity function (returns time, needed for simulation of coalescent intervals).
      double getLowerBound​(int n)
      Returns the lower bound of the nth argument of this function.
      double getN0()
      returns initial population size.
      double getUpperBound​(int n)
      Returns the upper bound of the nth argument of this function.
      boolean hasIntegral()
      returns whether an analytical expression for the integral is implemented
      void setArgument​(int n, double value)
      Sets the value of the nth argument of this function.
      void setN0​(double N0)
      sets initial population size.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConstantPopulation

        public ConstantPopulation()
        Construct demographic model with default settings
      • ConstantPopulation

        public ConstantPopulation​(double N0)
        Construct demographic model with given settings
    • Method Detail

      • getN0

        public double getN0()
        returns initial population size.
      • setN0

        public void setN0​(double N0)
        sets initial population size.
      • getIntensity

        public double getIntensity​(double t)
        Description copied from interface: DemographicFunction
        Returns value of demographic intensity function at time t (= integral 1/N(x) dx from 0 to t).
        Specified by:
        getIntensity in interface DemographicFunction
      • getInverseIntensity

        public double getInverseIntensity​(double x)
        Description copied from interface: DemographicFunction
        Returns value of inverse demographic intensity function (returns time, needed for simulation of coalescent intervals).
        Specified by:
        getInverseIntensity in interface DemographicFunction
      • hasIntegral

        public boolean hasIntegral()
        Description copied from interface: DemographicFunction
        returns whether an analytical expression for the integral is implemented
        Specified by:
        hasIntegral in interface DemographicFunction
        Returns:
        a boolean
      • getIntegral

        public double getIntegral​(double start,
                                  double finish)
        Calculates the integral 1/N(x) dx between start and finish. The inherited function in DemographicFunction.Abstract calls a numerical integrater which is unecessary.
        Specified by:
        getIntegral in interface DemographicFunction