use of dr.evolution.util.Units in project beast-mcmc by beast-dev.
the class ExponentialSawtoothModelParser 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_RATE);
Parameter rParam = (Parameter) cxo.getChild(Parameter.class);
cxo = xo.getChild(WAVELENGTH);
Parameter wavelengthParam = (Parameter) cxo.getChild(Parameter.class);
cxo = xo.getChild(OFFSET);
Parameter tParam = (Parameter) cxo.getChild(Parameter.class);
return new ExponentialSawtoothModel(N0Param, rParam, wavelengthParam, tParam, units);
}
use of dr.evolution.util.Units in project beast-mcmc by beast-dev.
the class LogisticGrowthModelParser 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);
boolean usingGrowthRate = true;
Parameter rParam;
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;
}
cxo = xo.getChild(TIME_50);
Parameter cParam = (Parameter) cxo.getChild(Parameter.class);
return new LogisticGrowthModel(N0Param, rParam, cParam, 0.5, units, usingGrowthRate);
}
use of dr.evolution.util.Units in project beast-mcmc by beast-dev.
the class PeakAndDeclineModelParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
Units.Type units = XMLUnits.Utils.getUnitsAttr(xo);
XMLObject cxo = xo.getChild(PEAK_VALUE);
Parameter peakValueParam = (Parameter) cxo.getChild(Parameter.class);
Parameter rParam;
cxo = xo.getChild(SHAPE);
rParam = (Parameter) cxo.getChild(Parameter.class);
cxo = xo.getChild(PEAK_TIME);
Parameter peakTimeParam = (Parameter) cxo.getChild(Parameter.class);
return new PeakAndDeclineModel(peakValueParam, rParam, peakTimeParam, units);
}
use of dr.evolution.util.Units in project beast-mcmc by beast-dev.
the class PowerLawGrowthModelParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
Units.Type units = XMLUnits.Utils.getUnitsAttr(xo);
XMLObject cxo = xo.getChild(N0);
Parameter N0Param = (Parameter) cxo.getChild(Parameter.class);
Parameter rParam;
cxo = xo.getChild(POWER);
rParam = (Parameter) cxo.getChild(Parameter.class);
return new PowerLawGrowthModel(N0Param, rParam, units);
}
use of dr.evolution.util.Units in project beast-mcmc by beast-dev.
the class TwoEpochDemographicModelParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
Units.Type units = XMLUnits.Utils.getUnitsAttr(xo);
XMLObject cxo = xo.getChild(EPOCH_1);
DemographicModel demo1 = (DemographicModel) cxo.getChild(DemographicModel.class);
cxo = xo.getChild(EPOCH_2);
DemographicModel demo2 = (DemographicModel) cxo.getChild(DemographicModel.class);
cxo = xo.getChild(TRANSITION_TIME);
Parameter timeParameter = (Parameter) cxo.getChild(Parameter.class);
return new TwoEpochDemographicModel(demo1, demo2, timeParameter, units);
}
Aggregations