• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java StateNodeInitialiser类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中beast.core.StateNodeInitialiser的典型用法代码示例。如果您正苦于以下问题:Java StateNodeInitialiser类的具体用法?Java StateNodeInitialiser怎么用?Java StateNodeInitialiser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

StateNodeInitialiser类属于beast.core包,在下文中一共展示了StateNodeInitialiser类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: baseType

点赞 2

import beast.core.StateNodeInitialiser; //导入依赖的package包/类
@Override
public Class<?> baseType() {
	return StateNodeInitialiser.class;
}
 

开发者ID:CompEvol,
项目名称:beast2,
代码行数:5,
代码来源:StateNodeInitialiserListInputEditor.java

示例2: initAndValidate

点赞 2

import beast.core.StateNodeInitialiser; //导入依赖的package包/类
@Override
public void initAndValidate() {
    if (m_initial.get() != null && !(this instanceof StateNodeInitialiser)) {
        final Tree other = m_initial.get();
        root = other.root.copy();
        nodeCount = other.nodeCount;
        internalNodeCount = other.internalNodeCount;
        leafNodeCount = other.leafNodeCount;
    }

    if (nodeCount < 0) {
        if (m_taxonset.get() != null) {
            // make a caterpillar
            final List<String> sTaxa = m_taxonset.get().asStringList();
            Node left = newNode();
            left.labelNr = 0;
            left.height = 0;
            left.setID(sTaxa.get(0));
            for (int i = 1; i < sTaxa.size(); i++) {
                Node right = newNode();
                right.labelNr = i;
                right.height = 0;
                right.setID(sTaxa.get(i));
                Node parent = newNode();
                parent.labelNr = sTaxa.size() + i - 1;
                parent.height = i;
                left.parent = parent;
                parent.setLeft(left);
                right.parent = parent;
                parent.setRight(right);
                left = parent;
            }
            root = left;
            leafNodeCount = sTaxa.size();
            nodeCount = leafNodeCount * 2 - 1;
            internalNodeCount = leafNodeCount - 1;

        } else {
            // make dummy tree with a single root node
            root = newNode();
            root.labelNr = 0;
            root.height = 0;
            root.m_tree = this;
            nodeCount = 1;
            internalNodeCount = 0;
            leafNodeCount = 1;
        }
    }

    if (nodeCount >= 0) {
        initArrays();
    }

    if (leafNodeCount < 0) {
        leafNodeCount = getLeafNodeCount();
    }
    if (internalNodeCount < 0) {
        internalNodeCount = getInternalNodeCount();
    }


    processTraits(m_traitList.get());

    // Ensure tree is compatible with time trait.
    if (timeTraitSet != null)
        adjustTreeNodeHeights(root);


}
 

开发者ID:CompEvol,
项目名称:sampled-ancestors,
代码行数:70,
代码来源:ZeroBranchSATree.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)