use of dr.evomodel.operators.RandomWalkIntegerNodeHeightWeightedOperator in project beast-mcmc by beast-dev.
the class RandomWalkIntegerNodeHeightWeightedOperatorParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
double d = xo.getDoubleAttribute(WINDOW_SIZE);
if (d != Math.floor(d)) {
throw new XMLParseException("The window size of a " + RANDOM_WALK_INT_NODE_HEIGHT_WGT_OP + " should be an integer");
}
int windowSize = (int) d;
Parameter parameter = (Parameter) xo.getChild(Parameter.class);
Parameter internalNodeHeights = (Parameter) xo.getElementFirstChild(INTERNAL_NODE_HEIGHTS);
return new RandomWalkIntegerNodeHeightWeightedOperator(parameter, windowSize, weight, internalNodeHeights);
}
Aggregations