Search in sources :

Example 1 with MulTreeNodeSlide

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);
}
Also used : MulTreeNodeSlide(dr.evomodel.alloppnet.operators.MulTreeNodeSlide) MulSpeciesBindings(dr.evomodel.alloppnet.speciation.MulSpeciesBindings) MulSpeciesTreeModel(dr.evomodel.alloppnet.speciation.MulSpeciesTreeModel)

Example 2 with MulTreeNodeSlide

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;
    }
}
Also used : MulTreeNodeSlide(dr.evomodel.alloppnet.operators.MulTreeNodeSlide)

Aggregations

MulTreeNodeSlide (dr.evomodel.alloppnet.operators.MulTreeNodeSlide)2 MulSpeciesBindings (dr.evomodel.alloppnet.speciation.MulSpeciesBindings)1 MulSpeciesTreeModel (dr.evomodel.alloppnet.speciation.MulSpeciesTreeModel)1