use of dr.evolution.io.TreeTrace in project beast-mcmc by beast-dev.
the class WeightedMultiplicativeBinary method getTree.
/**
* get the i'th tree of the trace
*
* @param index
* @return the i'th tree of the trace
*/
public final Tree getTree(int index) {
int oldTreeCount = 0;
int newTreeCount = 0;
for (TreeTrace trace : traces) {
newTreeCount += trace.getTreeCount(burnin * trace.getStepSize());
if (index < newTreeCount) {
return trace.getTree(index - oldTreeCount, burnin * trace.getStepSize());
}
oldTreeCount = newTreeCount;
}
throw new RuntimeException("Couldn't find tree " + index);
}
Aggregations