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


Java ReadTree类代码示例

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


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

示例1: setTreeString

import pal.tree.ReadTree; //导入依赖的package包/类
public void setTreeString(String tree) throws TreeParseException {
	this.treeString = tree;

	if (tree == null)
		throw new TreeParseException("Attempting to set a null tree");
	StringReader sr = new StringReader(tree);
	this.tree = new ReadTree(new PushbackReader(sr));
}
 
开发者ID:ddarriba,项目名称:jmodeltest2,代码行数:9,代码来源:Model.java

示例2: doConsense

import pal.tree.ReadTree; //导入依赖的package包/类
/**
 * This method represents the application code that we'd like to run on a
 * separate thread.
 */
// Object doConsense()
private Consensus doConsense() {

	List<WeightedTree> treeList = new ArrayList<WeightedTree>();

	for (Model m : confidenceModels) {

		try {
			// parse tree
			String tree = m.getTreeString();
			StringReader sr = new StringReader(tree);
			Tree t = new ReadTree(new PushbackReader(sr));

			double weight;
			// set criterion
			switch (criterion.getType()) {
			case InformationCriterion.IC_AIC:
				weight = m.getAICw();
				break;
			case InformationCriterion.IC_AICc:
				weight = m.getAICcw();
				break;
			case InformationCriterion.IC_BIC:
				weight = m.getBICw();
				break;
			case InformationCriterion.IC_DT:
				weight = m.getDTw();
				break;
			default:
				weight = 0.0d;
			}

			treeList.add(new WeightedTree(t, weight));

		} catch (TreeParseException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}

	double consensusThreshold;
	if (consensusType.equals("strict")) {
		consensusThreshold = 0.99999999d;
	} else {
		consensusThreshold = 0.5d;
	}
	;
	Consensus consensus = new Consensus(treeList, consensusThreshold,
			Consensus.BRANCH_LENGTHS_MEDIAN);

	return consensus;
}
 
开发者ID:ddarriba,项目名称:jmodeltest2,代码行数:57,代码来源:RunConsense.java


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