use of dr.inference.operators.MultipleRandomWalkIntegerOperator in project beast-mcmc by beast-dev.
the class MultipleRandomWalkIntegerOperatorParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
double w = xo.getDoubleAttribute(RandomWalkIntegerOperatorParser.WINDOW_SIZE);
if (w != Math.floor(w)) {
throw new XMLParseException("The window size of a randomWalkIntegerOperator should be an integer");
}
double s = xo.getDoubleAttribute(SAMPLE_SIZE);
if (s != Math.floor(s)) {
throw new XMLParseException("The window size of a randomWalkIntegerOperator should be an integer");
}
int windowSize = (int) w;
int sampleSize = (int) s;
Parameter parameter = (Parameter) xo.getChild(Parameter.class);
return new MultipleRandomWalkIntegerOperator(parameter, windowSize, sampleSize, weight);
}
Aggregations