Search in sources :

Example 1 with LogRandomWalkOperator

use of dr.inference.operators.LogRandomWalkOperator in project beast-mcmc by beast-dev.

the class LogRandomWalkOperatorParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    CoercionMode mode = CoercionMode.parseMode(xo);
    final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
    final double size = xo.getDoubleAttribute(WINDOW_SIZE);
    final boolean scaleAll = xo.getAttribute(SCALE_ALL, false);
    final boolean scaleAllInd = xo.getAttribute(SCALE_ALL_IND, false);
    if (size <= 0.0) {
        throw new XMLParseException("size must be positive");
    }
    final Parameter parameter = (Parameter) xo.getChild(Parameter.class);
    return new LogRandomWalkOperator(parameter, size, mode, weight, scaleAll, scaleAllInd);
}
Also used : LogRandomWalkOperator(dr.inference.operators.LogRandomWalkOperator) Parameter(dr.inference.model.Parameter) CoercionMode(dr.inference.operators.CoercionMode)

Aggregations

Parameter (dr.inference.model.Parameter)1 CoercionMode (dr.inference.operators.CoercionMode)1 LogRandomWalkOperator (dr.inference.operators.LogRandomWalkOperator)1