Search in sources :

Example 1 with ConstantExponentialModel

use of dr.evomodel.coalescent.ConstantExponentialModel in project beast-mcmc by beast-dev.

the class ConstantExponentialModelParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    Units.Type units = XMLUnits.Utils.getUnitsAttr(xo);
    XMLObject cxo = xo.getChild(POPULATION_SIZE);
    Parameter N0Param = (Parameter) cxo.getChild(Parameter.class);
    cxo = xo.getChild(GROWTH_PHASE_START_TIME);
    Parameter timeParam = (Parameter) cxo.getChild(Parameter.class);
    Parameter rParam;
    boolean usingGrowthRate = true;
    if (xo.getChild(GROWTH_RATE) != null) {
        cxo = xo.getChild(GROWTH_RATE);
        rParam = (Parameter) cxo.getChild(Parameter.class);
    } else {
        cxo = xo.getChild(DOUBLING_TIME);
        rParam = (Parameter) cxo.getChild(Parameter.class);
        usingGrowthRate = false;
    }
    return new ConstantExponentialModel(N0Param, timeParam, rParam, units, usingGrowthRate);
}
Also used : ConstantExponentialModel(dr.evomodel.coalescent.ConstantExponentialModel) Parameter(dr.inference.model.Parameter) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits)

Aggregations

Units (dr.evolution.util.Units)1 ConstantExponentialModel (dr.evomodel.coalescent.ConstantExponentialModel)1 XMLUnits (dr.evoxml.util.XMLUnits)1 Parameter (dr.inference.model.Parameter)1