Search in sources :

Example 1 with ConstantPopulationSizeModel

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

the class ConstantPopulationModelParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    Units.Type units = XMLUnits.Utils.getUnitsAttr(xo);
    XMLObject cxo = xo.getChild(POPULATION_SIZE);
    boolean logSpace = cxo.getAttribute(LOG_SPACE, false);
    Parameter N0Param = (Parameter) cxo.getChild(Parameter.class);
    if (logSpace) {
        // ConstantPopulationSizeModel provides a model with N0 in log space
        return new ConstantPopulationSizeModel(N0Param, units);
    } else {
        return new ConstantPopulationModel(N0Param, units);
    }
}
Also used : ConstantPopulationModel(dr.evomodel.coalescent.demographicmodel.ConstantPopulationModel) ConstantPopulationSizeModel(dr.evomodel.coalescent.ConstantPopulationSizeModel) Parameter(dr.inference.model.Parameter) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits)

Example 2 with ConstantPopulationSizeModel

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

the class ConstantPopulationSizeModelParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    Units.Type units = XMLUnits.Utils.getUnitsAttr(xo);
    Parameter N0Param = null;
    if (xo.hasChildNamed(LOG_POPULATION_SIZE)) {
        N0Param = (Parameter) xo.getElementFirstChild(LOG_POPULATION_SIZE);
    }
    return new ConstantPopulationSizeModel(N0Param, units);
}
Also used : ConstantPopulationSizeModel(dr.evomodel.coalescent.ConstantPopulationSizeModel) Parameter(dr.inference.model.Parameter) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits)

Aggregations

Units (dr.evolution.util.Units)2 ConstantPopulationSizeModel (dr.evomodel.coalescent.ConstantPopulationSizeModel)2 XMLUnits (dr.evoxml.util.XMLUnits)2 Parameter (dr.inference.model.Parameter)2 ConstantPopulationModel (dr.evomodel.coalescent.demographicmodel.ConstantPopulationModel)1