当前位置: 首页>>代码示例>>Java>>正文


Java MutableTree.InvalidTreeException方法代码示例

本文整理汇总了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;
}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:24,代码来源:TreeUniform.java

示例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;
}
 
开发者ID:whdc,项目名称:ieo-beast,代码行数:24,代码来源:TreeUniform.java

示例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());
		}
	}
 
开发者ID:beast-dev,项目名称:beast-mcmc,代码行数:48,代码来源:ARGExchangeOperator.java

示例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());
		}
	}
 
开发者ID:whdc,项目名称:ieo-beast,代码行数:48,代码来源:ARGExchangeOperator.java


注:本文中的dr.evolution.tree.MutableTree.InvalidTreeException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。