Search in sources :

Example 1 with MultipleRandomWalkIntegerOperator

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);
}
Also used : MultipleRandomWalkIntegerOperator(dr.inference.operators.MultipleRandomWalkIntegerOperator) Parameter(dr.inference.model.Parameter)

Aggregations

Parameter (dr.inference.model.Parameter)1 MultipleRandomWalkIntegerOperator (dr.inference.operators.MultipleRandomWalkIntegerOperator)1