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);
}
Aggregations