本文整理汇总了Java中dr.evolution.tree.MutableTree.InvalidTreeException方法的典型用法代码示例。如果您正苦于以下问题:Java MutableTree.InvalidTreeException方法的具体用法?Java MutableTree.InvalidTreeException怎么用?Java MutableTree.InvalidTreeException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dr.evolution.tree.MutableTree
的用法示例。
在下文中一共展示了MutableTree.InvalidTreeException方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doOperation
import dr.evolution.tree.MutableTree; //导入方法依赖的package包/类
public double doOperation() {
if( tree.getInternalNodeCount() < 2 ) {
throw new RuntimeException("no node found");
}
tree.beginTreeEdit();
switch( nodesToMove ) {
case 2: move2(); break;
case 3: move3(); break;
}
tree.endTreeEdit();
// AR not sure whether this check is needed...
try {
tree.checkTreeIsValid();
} catch( MutableTree.InvalidTreeException ite ) {
throw new RuntimeException(ite.toString());
}
return 0;
}
示例2: doOperation
import dr.evolution.tree.MutableTree; //导入方法依赖的package包/类
public double doOperation() throws OperatorFailedException {
if( tree.getInternalNodeCount() < 2 ) {
throw new OperatorFailedException("no node found");
}
tree.beginTreeEdit();
switch( nodesToMove ) {
case 2: move2(); break;
case 3: move3(); break;
}
tree.endTreeEdit();
// AR not sure whether this check is needed...
try {
tree.checkTreeIsValid();
} catch( MutableTree.InvalidTreeException ite ) {
throw new OperatorFailedException(ite.toString());
}
return 0;
}
示例3: eupdateARG
import dr.evolution.tree.MutableTree; //导入方法依赖的package包/类
private void eupdateARG(NodeRef i, NodeRef j, NodeRef iP, NodeRef jP) throws ARGOperatorFailedException {
// There are three different cases:
// 1) neither i nor j are reassortments, 2) either i or j are reassortments, 3) both i and j are reassortments
tree.beginTreeEdit();
boolean iBifurcation = tree.isBifurcation(i);
boolean jBifurcation = tree.isBifurcation(j);
if (iBifurcation && jBifurcation) {
tree.removeChild(iP, i);
tree.removeChild(jP, j);
tree.addChild(jP, i);
tree.addChild(iP, j);
} else if (!iBifurcation && !jBifurcation) {
// tree.singleRemoveChild(iP, i);
// tree.singleRemoveChild(jP, j);
// tree.singleAddChild(jP, i);
// tree.singleAddChild(iP, j);
} else {
if (jBifurcation) {
// one reassortment; force i to be bifurcation and j to be reassortment
NodeRef t = i;
NodeRef tP = iP;
i = j;
iP = jP;
j = t;
jP = tP;
}
// System.err.println(tree.toGraphString());
// ARGModel.Node iNode = (ARGModel.Node) i;
// ARGModel.Node jNode = (ARGModel.Node) j;
// System.err.println("i = "+iNode.number+" : j = "+jNode.number);
/* tree.removeChild(iP, i);
tree.singleRemoveChild(jP, j);
tree.addChild(jP, i);
tree.singleAddChild(iP, j);*/
}
tree.endTreeEdit();
try {
tree.checkTreeIsValid();
} catch (MutableTree.InvalidTreeException ite) {
throw new ARGOperatorFailedException(ite.toString());
}
}
示例4: eupdateARG
import dr.evolution.tree.MutableTree; //导入方法依赖的package包/类
private void eupdateARG(NodeRef i, NodeRef j, NodeRef iP, NodeRef jP) throws OperatorFailedException {
// There are three different cases:
// 1) neither i nor j are reassortments, 2) either i or j are reassortments, 3) both i and j are reassortments
tree.beginTreeEdit();
boolean iBifurcation = tree.isBifurcation(i);
boolean jBifurcation = tree.isBifurcation(j);
if (iBifurcation && jBifurcation) {
tree.removeChild(iP, i);
tree.removeChild(jP, j);
tree.addChild(jP, i);
tree.addChild(iP, j);
} else if (!iBifurcation && !jBifurcation) {
// tree.singleRemoveChild(iP, i);
// tree.singleRemoveChild(jP, j);
// tree.singleAddChild(jP, i);
// tree.singleAddChild(iP, j);
} else {
if (jBifurcation) {
// one reassortment; force i to be bifurcation and j to be reassortment
NodeRef t = i;
NodeRef tP = iP;
i = j;
iP = jP;
j = t;
jP = tP;
}
// System.err.println(tree.toGraphString());
// ARGModel.Node iNode = (ARGModel.Node) i;
// ARGModel.Node jNode = (ARGModel.Node) j;
// System.err.println("i = "+iNode.number+" : j = "+jNode.number);
/* tree.removeChild(iP, i);
tree.singleRemoveChild(jP, j);
tree.addChild(jP, i);
tree.singleAddChild(iP, j);*/
}
tree.endTreeEdit();
try {
tree.checkTreeIsValid();
} catch (MutableTree.InvalidTreeException ite) {
throw new OperatorFailedException(ite.toString());
}
}