use of dr.evomodel.coalescent.GMRFSkygridLikelihood in project beast-mcmc by beast-dev.
the class GMRFSkygridBlockUpdateOperatorParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
AdaptationMode mode = AdaptationMode.parseMode(xo);
if (mode == AdaptationMode.DEFAULT)
mode = AdaptationMode.ADAPTATION_ON;
double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
double scaleFactor = xo.getDoubleAttribute(SCALE_FACTOR);
if (scaleFactor == 1.0) {
mode = AdaptationMode.ADAPTATION_OFF;
}
if (scaleFactor < 1.0) {
throw new XMLParseException("scaleFactor must be greater than or equal to 1.0");
}
int maxIterations = xo.getAttribute(MAX_ITERATIONS, 200);
double stopValue = xo.getAttribute(STOP_VALUE, 0.01);
GMRFSkygridLikelihood gmrfSkygridLikelihood = (GMRFSkygridLikelihood) xo.getChild(GMRFSkygridLikelihood.class);
return new GMRFSkygridBlockUpdateOperator(gmrfSkygridLikelihood, weight, mode, scaleFactor, maxIterations, stopValue);
}
Aggregations