use of dr.inference.operators.RandomWalkIntegerOperator in project beast-mcmc by beast-dev.
the class RandomWalkIntegerOperatorParser 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_INTEGER_OPERATOR + " should be an integer");
}
int windowSize = (int) d;
Variable parameter = (Variable) xo.getChild(Variable.class);
return new RandomWalkIntegerOperator(parameter, windowSize, weight);
}
Aggregations