use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.
the class TreeBitRandomWalkOperatorParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
String trait1 = null;
String trait2 = null;
if (xo.hasAttribute(INDICTATOR_TRAIT))
trait1 = xo.getStringAttribute(INDICTATOR_TRAIT);
if (xo.hasAttribute(TRAIT2))
trait2 = xo.getStringAttribute(TRAIT2);
int k = xo.getAttribute("k", 1);
boolean swapTrait2 = xo.getAttribute(SWAP_TRAIT2, true);
return new TreeBitRandomWalkOperator(treeModel, trait1, trait2, weight, k, swapTrait2);
}
use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.
the class GibbsSubtreeSwapParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
final boolean pruned = xo.getAttribute("pruned", true);
return new GibbsSubtreeSwap(treeModel, pruned, weight);
}
use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.
the class ImportancePruneAndRegraftParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
int samples = xo.getIntegerAttribute("samples");
return new ImportancePruneAndRegraft(treeModel, weight, samples);
}
use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.
the class ImportanceSubtreeSwapParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
final TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
final int samples = xo.getIntegerAttribute("samples");
return new ImportanceSubtreeSwap(treeModel, weight, samples);
}
use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.
the class TraceCorrelationAssert method createSpecifiedTree.
protected void createSpecifiedTree(String t) throws Exception {
// Tree.Utils.newick(tree)
//create tree
NewickImporter importer = new NewickImporter(t);
Tree tree = importer.importTree(null);
//treeModel
treeModel = new TreeModel(tree);
}
Aggregations