本文整理匯總了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());
}
}