use of dr.evomodel.operators.RandomWalkIntegerSetSizeWeightedOperator in project beast-mcmc by beast-dev.
the class RandomWalkIntegerSetSizeWeightedOperatorParser 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_SET_SIZE_WGT_OP + " should be an integer");
}
double baseSetSize = xo.getDoubleAttribute(BASE_SET_SIZE);
int windowSize = (int) d;
Parameter parameter = (Parameter) xo.getChild(Parameter.class);
MicrosatelliteSamplerTreeModel msatSampleTreeModel = (MicrosatelliteSamplerTreeModel) xo.getChild(MicrosatelliteSamplerTreeModel.class);
return new RandomWalkIntegerSetSizeWeightedOperator(parameter, windowSize, weight, msatSampleTreeModel, baseSetSize);
}
Aggregations