use of dr.inference.model.LogarithmStatistic in project beast-mcmc by beast-dev.
the class LogarithmStatisticParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
LogarithmStatistic logStatistic;
// base 0.0 means natural logarithm, the default base
double base = xo.getAttribute(BASE, 0.0);
if (base <= 1.0 && base != 0.0) {
throw new XMLParseException("Error parsing " + getParserName() + " element: base attribute should be > 1");
}
Object child = xo.getChild(0);
if (child instanceof Statistic) {
logStatistic = new LogarithmStatistic(LOGARITHM_STATISTIC, (Statistic) child, base);
} else {
throw new XMLParseException("Unknown element found in " + getParserName() + " element:" + child);
}
return logStatistic;
}
Aggregations