use of dr.oldevomodel.sitemodel.DiscretizedLociRates in project beast-mcmc by beast-dev.
the class DiscretizedLociRatesParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
final boolean normalize = xo.getAttribute(NORMALIZE, false);
final double normalizeBranchRateTo = xo.getAttribute(NORMALIZE_MEAN_LOCI_RATE_TO, Double.NaN);
final int categoryCount = xo.getIntegerAttribute(CATEGORY_COUNT);
CompoundParameter lociRates = (CompoundParameter) xo.getElementFirstChild(LOCI_RATES);
Parameter rateCategoryParameter = (Parameter) xo.getElementFirstChild(RATE_CATEGORIES);
ParametricDistributionModel distributionModel = (ParametricDistributionModel) xo.getElementFirstChild(DISTRIBUTION);
Logger.getLogger("dr.evomodel").info("Using discretized loci rates model.");
Logger.getLogger("dr.evomodel").info("Number of categories: " + categoryCount);
Logger.getLogger("dr.evomodel").info(" parametric model = " + distributionModel.getModelName());
if (normalize) {
Logger.getLogger("dr.evomodel").info(" mean rate is normalized to " + normalizeBranchRateTo);
}
return new DiscretizedLociRates(lociRates, rateCategoryParameter, distributionModel, normalize, normalizeBranchRateTo, categoryCount);
}
Aggregations