use of dr.oldevomodel.sitemodel.CategorySiteModel in project beast-mcmc by beast-dev.
the class CategorySiteModelParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
XMLObject cxo = xo.getChild(SUBSTITUTION_MODEL);
SubstitutionModel substitutionModel = (SubstitutionModel) cxo.getChild(SubstitutionModel.class);
cxo = xo.getChild(MUTATION_RATE);
Parameter muParam = (Parameter) cxo.getChild(Parameter.class);
cxo = xo.getChild(RATE_PARAMETER);
Parameter rateParam = null;
int relativeTo = 0;
if (cxo != null) {
rateParam = (Parameter) cxo.getChild(Parameter.class);
relativeTo = cxo.getIntegerAttribute(RELATIVE_TO);
}
cxo = xo.getChild(CATEGORIES);
String categories = "";
String states = "";
if (cxo != null) {
categories = cxo.getStringAttribute(CATEGORY_STRING);
states = cxo.getStringAttribute(CATEGORY_STATES);
}
return new CategorySiteModel(substitutionModel, muParam, rateParam, categories, states, relativeTo);
}
Aggregations