Search in sources :

Example 1 with RandomWalkIntegerOperator

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

Aggregations

Variable (dr.inference.model.Variable)1 RandomWalkIntegerOperator (dr.inference.operators.RandomWalkIntegerOperator)1