Search in sources :

Example 6 with ConstantPopulation

use of dr.evolution.coalescent.ConstantPopulation in project beast-mcmc by beast-dev.

the class PartitionData method createDemographicFunction.

public DemographicFunction createDemographicFunction() {
    DemographicFunction demographicFunction = null;
    if (this.demographicModelIndex == 0) {
    // No model
    // do nothing
    } else if (this.demographicModelIndex == 1) {
        // Constant Population
        demographicFunction = new ConstantPopulation(Units.Type.YEARS);
        ((ConstantPopulation) demographicFunction).setN0(demographicParameterValues[0]);
    } else if (this.demographicModelIndex == 2) {
        // Exponential Growth (Growth Rate)
        demographicFunction = new ExponentialGrowth(Units.Type.YEARS);
        ((ExponentialGrowth) demographicFunction).setN0(demographicParameterValues[1]);
        ((ExponentialGrowth) demographicFunction).setGrowthRate(demographicParameterValues[2]);
    } else if (this.demographicModelIndex == 3) {
        // Exponential Growth (Doubling Time)
        demographicFunction = new ExponentialGrowth(Units.Type.YEARS);
        ((ExponentialGrowth) demographicFunction).setN0(demographicParameterValues[3]);
        ((ExponentialGrowth) demographicFunction).setDoublingTime(demographicParameterValues[4]);
    //		} else if (this.demographicModelIndex == 4) {// Logistic Growth (Growth Rate)
    //			
    //			demographicFunction = new LogisticGrowth(Units.Type.YEARS);
    //            ((LogisticGrowth) demographicFunction).setN0(demographicParameterValues[5]);
    //            ((LogisticGrowth) demographicFunction).setGrowthRate(demographicParameterValues[6]);
    //            ((LogisticGrowth) demographicFunction).setTime50(demographicParameterValues[7]);
    //			
    //		} else if (this.demographicModelIndex == 5) {// Logistic Growth (Doubling Time)
    //			
    //			demographicFunction = new LogisticGrowth(Units.Type.YEARS);
    //            ((LogisticGrowth) demographicFunction).setN0(demographicParameterValues[8]);
    //            ((LogisticGrowth) demographicFunction).setDoublingTime(demographicParameterValues[9]);
    //            ((LogisticGrowth) demographicFunction).setTime50(demographicParameterValues[10]);
    //			
    //		} else if (this.demographicModelIndex == 6) {// Expansion (Growth Rate)
    //			
    //			demographicFunction = new Expansion(Units.Type.YEARS);
    //            ((Expansion) demographicFunction).setN0(demographicParameterValues[11]);
    //            ((Expansion) demographicFunction).setProportion(demographicParameterValues[12]);
    //            ((Expansion) demographicFunction).setGrowthRate(demographicParameterValues[13]);
    //			
    //		} else if (this.demographicModelIndex == 7) {// Expansion (Doubling Time)
    //			
    //			demographicFunction = new Expansion(Units.Type.YEARS);
    //            ((Expansion) demographicFunction).setN0(demographicParameterValues[14]);
    //            ((Expansion) demographicFunction).setProportion(demographicParameterValues[15]);
    //            ((Expansion) demographicFunction).setDoublingTime(demographicParameterValues[16]);
    } else {
        System.out.println("Not yet implemented");
    }
    return demographicFunction;
}
Also used : ConstantPopulation(dr.evolution.coalescent.ConstantPopulation) ExponentialGrowth(dr.evolution.coalescent.ExponentialGrowth) DemographicFunction(dr.evolution.coalescent.DemographicFunction)

Example 7 with ConstantPopulation

use of dr.evolution.coalescent.ConstantPopulation in project beast-mcmc by beast-dev.

the class TraceCorrelationAssert method createRandomInitialTree.

protected ConstantPopulationModel createRandomInitialTree(Parameter popSize) {
    ConstantPopulationModel startingTree = new ConstantPopulationModel(popSize, Units.Type.YEARS);
    ConstantPopulation constant = (ConstantPopulation) startingTree.getDemographicFunction();
    createTreeModel(constant);
    return startingTree;
}
Also used : ConstantPopulationModel(dr.evomodel.coalescent.ConstantPopulationModel) ConstantPopulation(dr.evolution.coalescent.ConstantPopulation)

Example 8 with ConstantPopulation

use of dr.evolution.coalescent.ConstantPopulation in project beast-mcmc by beast-dev.

the class TraceCorrelationAssert method createRandomInitialTree.

protected void createRandomInitialTree(double popSize) throws Exception {
    ConstantPopulation constant = new ConstantPopulation(Units.Type.YEARS);
    // popSize
    constant.setN0(popSize);
    createTreeModel(constant);
}
Also used : ConstantPopulation(dr.evolution.coalescent.ConstantPopulation)

Aggregations

ConstantPopulation (dr.evolution.coalescent.ConstantPopulation)8 DemographicFunction (dr.evolution.coalescent.DemographicFunction)2 ExponentialGrowth (dr.evolution.coalescent.ExponentialGrowth)2 Arguments (dr.app.util.Arguments)1 ExponentialBSPGrowth (dr.evolution.coalescent.ExponentialBSPGrowth)1 ConstantPopulationModel (dr.evomodel.coalescent.ConstantPopulationModel)1 LogisticGrowthN0 (dr.evomodel.epidemiology.LogisticGrowthN0)1