本文整理汇总了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);
}
}
示例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;
}
示例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();
}
示例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);
}
}
示例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();
}
示例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);
}
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}