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


Java Tree.IS_FILTHY属性代码示例

本文整理汇总了Java中beast.evolution.tree.Tree.IS_FILTHY属性的典型用法代码示例。如果您正苦于以下问题:Java Tree.IS_FILTHY属性的具体用法?Java Tree.IS_FILTHY怎么用?Java Tree.IS_FILTHY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在beast.evolution.tree.Tree的用法示例。


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

示例1: initCore

protected void initCore() {
    final int nodeCount = treeInput.get().getNodeCount();
    likelihoodCore.initialize(
            nodeCount,
            dataInput.get().getPatternCount(),
            m_siteModel.getCategoryCount(),
            true, m_useAmbiguities.get()
    );

    final int extNodeCount = nodeCount / 2 + 1;
    final int intNodeCount = nodeCount / 2;

    if (m_useAmbiguities.get() || m_useTipLikelihoods.get()) {
        setPartials(treeInput.get().getRoot(), dataInput.get().getPatternCount());
    } else {
        setStates(treeInput.get().getRoot(), dataInput.get().getPatternCount());
    }
    hasDirt = Tree.IS_FILTHY;
    for (int i = 0; i < intNodeCount; i++) {
        likelihoodCore.createNodePartials(extNodeCount + i);
    }
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:22,代码来源:TreeLikelihood.java

示例2: calculateLogP

@Override
    public double calculateLogP() {
        if (beagle != null) {
            logP = beagle.calculateLogP();
            return logP;
        }
        final TreeInterface tree = treeInput.get();

        try {
        	if (traverse(tree.getRoot()) != Tree.IS_CLEAN)
        		calcLogP();
        }
        catch (ArithmeticException e) {
        	return Double.NEGATIVE_INFINITY;
        }
        m_nScale++;
        if (logP > 0 || (likelihoodCore.getUseScaling() && m_nScale > X)) {
//            System.err.println("Switch off scaling");
//            m_likelihoodCore.setUseScaling(1.0);
//            m_likelihoodCore.unstore();
//            m_nHasDirt = Tree.IS_FILTHY;
//            X *= 2;
//            traverse(tree.getRoot());
//            calcLogP();
//            return logP;
        } else if (logP == Double.NEGATIVE_INFINITY && m_fScale < 10 && !scaling.get().equals(Scaling.none)) { // && !m_likelihoodCore.getUseScaling()) {
            m_nScale = 0;
            m_fScale *= 1.01;
            Log.warning.println("Turning on scaling to prevent numeric instability " + m_fScale);
            likelihoodCore.setUseScaling(m_fScale);
            likelihoodCore.unstore();
            hasDirt = Tree.IS_FILTHY;
            traverse(tree.getRoot());
            calcLogP();
            return logP;
        }
        return logP;
    }
 
开发者ID:CompEvol,项目名称:beast2,代码行数:38,代码来源:TreeLikelihood.java

示例3: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    if (beagle != null) {
        return beagle.requiresRecalculation();
    }
    hasDirt = Tree.IS_CLEAN;

    if (dataInput.get().isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        return true;
    }
    if (m_siteModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        return true;
    }
    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        //m_nHasDirt = Tree.IS_DIRTY;
        return true;
    }
    return treeInput.get().somethingIsDirty();
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:24,代码来源:TreeLikelihood.java

示例4: initCore

protected void initCore() {
    final int nodeCount = tree.getNodeCount();
    likelihoodCore.initialize(
            nodeCount,
            data.getPatternCount(),
            m_siteModel.getCategoryCount(),
            true, useAmbiguities
    );

    final int extNodeCount = nodeCount / 2 + 1;
    final int intNodeCount = nodeCount / 2;

    if (useAmbiguities) {
        setPartials(tree.getRoot(), data.getPatternCount());
    } else {
        setStates(tree.getRoot(), data.getPatternCount());
    }
    hasDirt = Tree.IS_FILTHY;
    for (int i = 0; i < intNodeCount; i++) {
        likelihoodCore.createNodePartials(extNodeCount + i);
    }
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:22,代码来源:QuietTreeLikelihood.java

示例5: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    if (beagle != null) {
        return beagle.requiresRecalculation();
    }
    hasDirt = Tree.IS_CLEAN;

    if (data.isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        return true;
    }
    if (m_siteModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        return true;
    }
    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        return true;
    }
    return tree.somethingIsDirty();
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:24,代码来源:QuietTreeLikelihood.java

示例6: initCore

protected void initCore() {
    final int nodeCount = tree.getNodeCount();
    m_likelihoodCore.initialize(
            nodeCount,
            data.getPatternCount(),
            m_siteModel.getCategoryCount(),
            true, useAmbiguities
    );

    final int extNodeCount = nodeCount / 2 + 1;
    final int intNodeCount = nodeCount / 2;
    //System.out.println("m_likelihoodCore: "+(m_likelihoodCore == null));
    if (useAmbiguities) {
        setPartials(tree.getRoot(), data.getPatternCount());
    } else {
        setStates(tree.getRoot(), data.getPatternCount());
    }
    hasDirt = Tree.IS_FILTHY;
    for (int i = 0; i < intNodeCount; i++) {
        m_likelihoodCore.createNodePartials(extNodeCount + i);
    }
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:22,代码来源:NewWVTreeLikelihood.java

示例7: calculateLogP

@Override
    public double calculateLogP() {
        if (beagle != null) {
            logP = beagle.calculateLogP();
            return logP;
        }

        traverse(tree.getRoot());
        calcLogP();

        m_nScale++;
        if (logP > 0 || (likelihoodCore.getUseScaling() && m_nScale > X)) {
//            System.err.println("Switch off scaling");
//            m_likelihoodCore.setUseScaling(1.0);
//            m_likelihoodCore.unstore();
//            m_nHasDirt = Tree.IS_FILTHY;
//            X *= 2;
//            traverse(tree.getRoot());
//            calcLogP();
//            return logP;
        } else if (logP == Double.NEGATIVE_INFINITY && m_fScale < 10) { // && !m_likelihoodCore.getUseScaling()) {
            m_nScale = 0;
            m_fScale *= 1.01;
            System.err.println("Turning on scaling to prevent numeric instability " + m_fScale);
            likelihoodCore.setUseScaling(m_fScale);
            likelihoodCore.unstore();
            hasDirt = Tree.IS_FILTHY;
            traverse(tree.getRoot());
            calcLogP();
            return logP;
        }
        return logP;
    }
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:33,代码来源:QuietTreeLikelihood.java

示例8: calculateLogP

@Override
public double calculateLogP() {
	/*if (m_beagle != null) {
		logP =  m_beagle.calculateLogP();
		return logP;
	}*/
    Tree tree = (Tree) treeInput.get();
    //System.err.println("m_nHasDirt: "+m_nHasDirt);
    if(hasDirt > -1){
   	    traverse(tree.getRoot());
    }

    calcLogP();

    m_nScale++;
    if (logP > 0 || (likelihoodCore.getUseScaling() && m_nScale > X)) {
        //System.err.println("Switch off scaling");
        likelihoodCore.setUseScaling(1.0);
        likelihoodCore.unstore();
        hasDirt = Tree.IS_FILTHY;
        X *= 2;
       	traverse(tree.getRoot());
        calcLogP();
        return logP;
    } else if (logP == Double.NEGATIVE_INFINITY && m_fScale < 10) { // && !m_likelihoodCore.getUseScaling()) {
    	m_nScale = 0;
    	m_fScale *= 1.01;
        System.err.println("Turning on scaling to prevent numeric instability " + m_fScale);
        likelihoodCore.setUseScaling(m_fScale);
        likelihoodCore.unstore();
        hasDirt = Tree.IS_FILTHY;
       	traverse(tree.getRoot());
        calcLogP();
        //System.err.println(getID()+": "+logP);
        return logP;
    }

    //System.err.println(getID()+": "+logP);
    return logP;
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:40,代码来源:WVTreeLikelihood.java

示例9: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    //System.err.println("flag1");
	/*if (m_beagle != null) {
		return m_beagle.requiresRecalculation();
	} */
    hasDirt = Tree.IS_CLEAN;

    if(weightsChanged){
        hasDirt = -1;
        //System.err.println("flag2");
        return true;            
    }

    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        //System.err.println("flag3");
        return true;
    }

    if (dataInput.get().isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        //System.err.println("flag4");
        return true;
    }

    if (m_siteModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        //System.err.println("flag5");
        return true;
    }

    return treeInput.get().somethingIsDirty();
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:37,代码来源:WVTreeLikelihood.java

示例10: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    hasDirt = Tree.IS_CLEAN;
    
    double[] categoryRates = m_siteModel.getCategoryRates(null);
    if (constantPattern != null) {
        double [] tmp = new double [categoryRates.length - 1];
        for (int k = 0; k < invariantCategory; k++) {
        	tmp[k] = categoryRates[k];
        }
        for (int k = invariantCategory + 1; k < categoryRates.length; k++) {
        	tmp[k-1] = categoryRates[k];
        }
        categoryRates = tmp;
    }
    for (int i = 0; i < categoryRates.length; i++) {
    	if (categoryRates[i] != currentCategoryRates[i]) {
    		updateSiteModel = true;
    		break;
    	}
    }
    //updateSiteModel |= m_siteModel.isDirtyCalculation();

    if (substitutionModel instanceof CalculationNode) {
    	updateSubstitutionModel |= ((CalculationNode) substitutionModel).isDirtyCalculation();
    }
    
    if (dataInput.get().isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        return true;
    }
    if (m_siteModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        return true;
    }
    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        //m_nHasDirt = Tree.IS_FILTHY;
        return true;
    }

    return treeInput.get().somethingIsDirty();
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:45,代码来源:BeagleTreeLikelihood.java

示例11: calculateLogP

@Override
public double calculateLogP() {

    //System.out.println("rate ID: "+((SiteModel)m_siteModel).getRateParameter().getIDNumber());
    //System.out.println("model ID: "+((SwitchingNtdBMA)((SiteModel)m_siteModel).getSubstitutionModel()).getIDNumber());
    substitutionModel = m_siteModel.substModelInput.get();
    hasDirt = Tree.IS_FILTHY;



   	traverse(tree.getRoot());
    calcLogP();



    m_nScale++;
    if (logP > 0 || (likelihoodCore.getUseScaling() && m_nScale > X)) {
        //System.err.println("Switch off scaling");
        likelihoodCore.setUseScaling(1.0);
        likelihoodCore.unstore();
        hasDirt = Tree.IS_FILTHY;
        X *= 2;
       	traverse(tree.getRoot());
        calcLogP();
    } else if (logP == Double.NEGATIVE_INFINITY && m_fScale < 10) { // && !m_likelihoodCore.getUseScaling()) {
    	m_nScale = 0;
    	m_fScale *= 1.01;
        //System.err.println("Turning on scaling to prevent numeric instability " + m_fScale);
        likelihoodCore.setUseScaling(m_fScale);
        likelihoodCore.unstore();
        hasDirt = Tree.IS_FILTHY;
       	traverse(tree.getRoot());
        calcLogP();
    }
    /*if(Double.isNaN(logP)){
        ((BeerLikelihoodCore)m_likelihoodCore).printDetails();
        ((SwitchingNtdBMA)m_substitutionModel).printDetails();
        tree.log(-1,System.out);
        System.out.println();
        printPatternLogLik();
        System.out.println(((SiteModel)m_siteModel).getRateParameter());
        throw new RuntimeException("Prob: "+logP);
    }*/
    return logP;

}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:46,代码来源:TempSiteTreeLikelihood.java

示例12: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    //printThings();

    hasDirt = Tree.IS_CLEAN;

    if(weightsChanged){

        if(addedPatternIdCount > 0){
            hasDirt = Tree.IS_FILTHY;
        }else{
            hasDirt = -1;
        }

        if (m_siteModel.isDirtyCalculation()) {
             hasDirt = Tree.IS_DIRTY;
            valueChanged = true;
        }
        //System.out.println("flag2");
        return true;
    }

    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        //System.out.println("flag3");
        return true;
    }

    if (data.isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        //System.out.println("flag4");
        return true;
    }

    if (m_siteModel.isDirtyCalculation()) {
        valueChanged = true;
        hasDirt = Tree.IS_DIRTY;
        //System.out.println("flag5");
        return true;
    }

    return tree.somethingIsDirty();
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:46,代码来源:NewWVTreeLikelihood.java

示例13: calculateLogP

@Override
public double calculateLogP() {
    /*boolean[] unmasked = m_likelihoodCore.getUnmasked();
    for(int i = 0; i < patternWeights.length; i++){
        System.out.print(unmasked[i]+" ");
    }
        System.out.println();*/

    Tree tree = (Tree) treeInput.get();
    //System.err.println("m_nHasDirt: "+m_nHasDirt);
    hasDirt = Tree.IS_FILTHY;
   	traverse(tree.getRoot());


    calcLogP();

    m_nScale++;
    if (logP > 0 || (m_likelihoodCore.getUseScaling() && m_nScale > X)) {
        //System.err.println("Switch off scaling");
        m_likelihoodCore.setUseScaling(1.0);
        m_likelihoodCore.unstore();
        hasDirt = Tree.IS_FILTHY;
        X *= 2;
       	traverse(tree.getRoot());
        calcLogP();
        return logP;
    } else if (logP == Double.NEGATIVE_INFINITY && m_fScale < 10) { // && !m_likelihoodCore.getUseScaling()) {
    	m_nScale = 0;
    	m_fScale *= 1.01;
        System.err.println("Turning on scaling to prevent numeric instability " + m_fScale);
        m_likelihoodCore.setUseScaling(m_fScale);
        m_likelihoodCore.unstore();
        hasDirt = Tree.IS_FILTHY;
       	traverse(tree.getRoot());
        calcLogP();
        //System.err.println(getID()+": "+logP);
        return logP;
    }

    //System.err.println(getID()+": "+logP);
    return logP;
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:42,代码来源:TempWVTreeLikelihood.java

示例14: calculateLogP

public double calculateLogP() {
    substitutionModel = m_siteModel.substModelInput.get();
    /*boolean[] unmasked = m_likelihoodCore.getUnmasked();
    for(int i = 0; i < patternWeights.length; i++){
        System.out.print(unmasked[i]+" ");
    }
        System.out.println();   */

    Tree tree = (Tree) treeInput.get();
    //System.err.println("m_nHasDirt: "+m_nHasDirt);
    hasDirt = Tree.IS_FILTHY;
   	traverse(tree.getRoot());


    calcLogP();

    m_nScale++;
    /*if (logP > 0 || (m_likelihoodCore.getUseScaling() && m_nScale > X)) {
        //System.err.println("Switch off scaling");
        m_likelihoodCore.setUseScaling(1.0);
        m_likelihoodCore.unstore();
        m_nHasDirt = Tree.IS_FILTHY;
        X *= 2;
       	traverse(tree.getRoot());
        calcLogP();
        //return logP;
    } else if (logP == Double.NEGATIVE_INFINITY && m_fScale < 10) { // && !m_likelihoodCore.getUseScaling()) {
    	m_nScale = 0;
    	m_fScale *= 1.01;
        System.err.println("Turning on scaling to prevent numeric instability " + m_fScale);
        m_likelihoodCore.setUseScaling(m_fScale);
        m_likelihoodCore.unstore();
        m_nHasDirt = Tree.IS_FILTHY;
       	traverse(tree.getRoot());
        calcLogP();
        //System.err.println(getID()+": "+logP);
        //return logP;
    }*/

    //System.err.println(getID()+": "+logP);
    return logP;
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:42,代码来源:SepTempWVTreeLikelihood.java


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