use of dr.evomodel.alloppnet.operators.MulTreeNodeSlide in project beast-mcmc by beast-dev.
the class MulTreeNodeSlideParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
MulSpeciesBindings species = (MulSpeciesBindings) xo.getChild(MulSpeciesBindings.class);
MulSpeciesTreeModel tree = (MulSpeciesTreeModel) xo.getChild(MulSpeciesTreeModel.class);
final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
//final boolean oo = xo.getAttribute("outgroup", false);
return new MulTreeNodeSlide(tree, species, /*, oo*/
weight);
}
use of dr.evomodel.alloppnet.operators.MulTreeNodeSlide in project beast-mcmc by beast-dev.
the class MulSpeciesTreeModel method scale.
public int scale(double scaleFactor, int nDims, boolean testBounds) {
assert scaleFactor > 0;
if (nDims <= 0) {
// actually when in an up down with operators on the gene trees the flags
// may indicate a change
//storeState(); // just checks assert really
beginTreeEdit();
final int count = getInternalNodeCount();
for (int i = 0; i < count; ++i) {
final NodeRef n = getInternalNode(i);
setNodeHeight(n, getNodeHeight(n) * scaleFactor);
}
endTreeEdit();
fireModelChanged(this, 1);
return count;
} else {
if (nDims != 1) {
throw new UnsupportedOperationException("not implemented for count != 1");
}
if (internalTreeOP == null) {
internalTreeOP = new MulTreeNodeSlide(this, mulspb, 1);
}
internalTreeOP.operateOneNode(scaleFactor);
fireModelChanged(this, 1);
return nDims;
}
}
Aggregations