Search in sources :

Example 1 with CategorySiteModel

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);
}
Also used : CategorySiteModel(dr.oldevomodel.sitemodel.CategorySiteModel) Parameter(dr.inference.model.Parameter) SubstitutionModel(dr.oldevomodel.substmodel.SubstitutionModel)

Aggregations

Parameter (dr.inference.model.Parameter)1 CategorySiteModel (dr.oldevomodel.sitemodel.CategorySiteModel)1 SubstitutionModel (dr.oldevomodel.substmodel.SubstitutionModel)1