Search in sources :

Example 26 with Units

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);
}
Also used : ExponentialSawtoothModel(dr.evomodel.coalescent.demographicmodel.ExponentialSawtoothModel) Parameter(dr.inference.model.Parameter) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits)

Example 27 with 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);
}
Also used : Parameter(dr.inference.model.Parameter) LogisticGrowthModel(dr.evomodel.coalescent.demographicmodel.LogisticGrowthModel) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits)

Example 28 with Units

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);
}
Also used : Parameter(dr.inference.model.Parameter) PeakAndDeclineModel(dr.evomodel.coalescent.demographicmodel.PeakAndDeclineModel) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits)

Example 29 with 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);
}
Also used : Parameter(dr.inference.model.Parameter) PowerLawGrowthModel(dr.evomodel.coalescent.demographicmodel.PowerLawGrowthModel) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits)

Example 30 with 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);
}
Also used : DemographicModel(dr.evomodel.coalescent.demographicmodel.DemographicModel) TwoEpochDemographicModel(dr.evomodel.coalescent.demographicmodel.TwoEpochDemographicModel) Parameter(dr.inference.model.Parameter) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits) TwoEpochDemographicModel(dr.evomodel.coalescent.demographicmodel.TwoEpochDemographicModel)

Aggregations

Units (dr.evolution.util.Units)70 XMLUnits (dr.evoxml.util.XMLUnits)65 Parameter (dr.inference.model.Parameter)62 TreeModel (dr.evomodel.tree.TreeModel)4 Date (dr.evolution.util.Date)3 MultiEpochExponential (dr.evolution.coalescent.MultiEpochExponential)2 ConstantPopulationSizeModel (dr.evomodel.coalescent.ConstantPopulationSizeModel)2 ExponentialPopulationSizeModel (dr.evomodel.coalescent.ExponentialPopulationSizeModel)2 BirthDeathGernhard08Model (dr.evomodel.speciation.BirthDeathGernhard08Model)2 BirthDeathSerialSamplingModel (dr.evomodel.speciation.BirthDeathSerialSamplingModel)2 TreePriorParameterizationType (dr.app.beauti.types.TreePriorParameterizationType)1 TreePriorType (dr.app.beauti.types.TreePriorType)1 ExponentialExponential (dr.evolution.coalescent.ExponentialExponential)1 ExponentialGrowth (dr.evolution.coalescent.ExponentialGrowth)1 Importer (dr.evolution.io.Importer)1 NewickImporter (dr.evolution.io.NewickImporter)1 SimpleNode (dr.evolution.tree.SimpleNode)1 SimpleTree (dr.evolution.tree.SimpleTree)1 Tree (dr.evolution.tree.Tree)1 Taxon (dr.evolution.util.Taxon)1