use of dr.inference.model.ExpressionStatistic in project beast-mcmc by beast-dev.
the class ExpressionStatisticParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
XMLObject cxo = xo.getChild(EXPRESSION);
String expression = cxo.getStringChild(0);
ExpressionStatistic expStatistic = new ExpressionStatistic(EXPRESSION_STATISTIC, expression);
System.out.println("Expression: " + expression);
System.out.println(" variables:");
cxo = xo.getChild(VARIABLES);
for (int i = 0; i < cxo.getChildCount(); i++) {
Object child = cxo.getChild(i);
if (child instanceof Statistic) {
Statistic stat = (Statistic) child;
expStatistic.addStatistic(stat);
System.out.println(" " + stat.getStatisticName() + "=" + stat.getStatisticValue(0));
} else {
throw new XMLParseException("Unknown element found in " + getParserName() + " element:" + child);
}
}
System.out.println(" value: " + expStatistic.getStatisticValue(0));
return expStatistic;
}
Aggregations