Search in sources :

Example 1 with SwapOperator

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

the class SwapOperatorParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    Parameter parameter = (Parameter) xo.getChild(Parameter.class);
    double weight = xo.getDoubleAttribute("weight");
    int size = xo.getIntegerAttribute("size");
    boolean autoOptimize = xo.getBooleanAttribute("autoOptimize");
    if (autoOptimize)
        throw new XMLParseException("swapOperator can't be optimized!");
    System.out.println("Creating swap operator for parameter " + parameter.getParameterName() + " (weight=" + weight + ")");
    SwapOperator so = new SwapOperator(parameter, size);
    so.setWeight(weight);
    return so;
}
Also used : SwapOperator(dr.inference.operators.SwapOperator) Parameter(dr.inference.model.Parameter)

Aggregations

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