use of dr.inference.operators.FactorTreeGibbsOperator in project beast-mcmc by beast-dev.
the class FactorTreeGibbsOperatorParser method parseXMLObject.
@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
String weightTemp = (String) xo.getAttribute(WEIGHT);
double weight = Double.parseDouble(weightTemp);
LatentFactorModel lfm = (LatentFactorModel) xo.getChild(LatentFactorModel.class);
GibbsSampleFromTreeInterface tree = (GibbsSampleFromTreeInterface) xo.getChild(GibbsSampleFromTreeInterface.class);
GibbsSampleFromTreeInterface workingTree = null;
if (xo.getChild(WORKING_PRIOR) != null) {
workingTree = (GibbsSampleFromTreeInterface) xo.getChild(WORKING_PRIOR).getChild(GibbsSampleFromTreeInterface.class);
}
boolean randomScan = xo.getAttribute(RANDOM_SCAN, true);
return new FactorTreeGibbsOperator(weight, lfm, tree, randomScan);
}
Aggregations