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