Search in sources :

Example 1 with BirthDeathCollapseModel

use of dr.evomodel.alloppnet.speciation.BirthDeathCollapseModel in project beast-mcmc by beast-dev.

the class BirthDeathCollapseModelParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    final Units.Type units = XMLUnits.Utils.getUnitsAttr(xo);
    final double collH = xo.getDoubleAttribute(COLLAPSE_HEIGHT);
    XMLObject cxo = xo.getChild(TREE);
    final Tree tree = (Tree) cxo.getChild(Tree.class);
    final Parameter birthMinusDeath = (Parameter) xo.getElementFirstChild(BIRTHDIFF_RATE);
    final Parameter relativeDeathRate = (Parameter) xo.getElementFirstChild(RELATIVE_DEATH_RATE);
    final Parameter originHeight = (Parameter) xo.getElementFirstChild(ORIGIN_HEIGHT);
    final Parameter collapseWeight = (Parameter) xo.getElementFirstChild(COLLAPSE_WEIGHT);
    final String modelName = xo.getId();
    return new BirthDeathCollapseModel(modelName, tree, units, birthMinusDeath, relativeDeathRate, originHeight, collapseWeight, collH);
}
Also used : Tree(dr.evolution.tree.Tree) Parameter(dr.inference.model.Parameter) BirthDeathCollapseModel(dr.evomodel.alloppnet.speciation.BirthDeathCollapseModel) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits)

Example 2 with BirthDeathCollapseModel

use of dr.evomodel.alloppnet.speciation.BirthDeathCollapseModel in project beast-mcmc by beast-dev.

the class BirthDeathCollapseNClustersStatisticParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    xo.getAttribute("name");
    final XMLObject spptreexo = xo.getChild(SPECIES_TREE);
    SpeciesTreeModel spptree = (SpeciesTreeModel) spptreexo.getChild(SpeciesTreeModel.class);
    final XMLObject cmxo = xo.getChild(COLLAPSE_MODEL);
    BirthDeathCollapseModel bdcm = (BirthDeathCollapseModel) cmxo.getChild(BirthDeathCollapseModel.class);
    return new BirthDeathCollapseNClustersStatistic(spptree, bdcm);
}
Also used : BirthDeathCollapseNClustersStatistic(dr.evomodel.alloppnet.speciation.BirthDeathCollapseNClustersStatistic) BirthDeathCollapseModel(dr.evomodel.alloppnet.speciation.BirthDeathCollapseModel) SpeciesTreeModel(dr.evomodel.speciation.SpeciesTreeModel)

Aggregations

BirthDeathCollapseModel (dr.evomodel.alloppnet.speciation.BirthDeathCollapseModel)2 Tree (dr.evolution.tree.Tree)1 Units (dr.evolution.util.Units)1 BirthDeathCollapseNClustersStatistic (dr.evomodel.alloppnet.speciation.BirthDeathCollapseNClustersStatistic)1 SpeciesTreeModel (dr.evomodel.speciation.SpeciesTreeModel)1 XMLUnits (dr.evoxml.util.XMLUnits)1 Parameter (dr.inference.model.Parameter)1