Skip to content

Commit 154584f

Browse files
committed
Constant distance node sampling
1 parent 141e5ed commit 154584f

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

src/consoperators/InConstantDistanceOperator.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public double proposal() {
105105
// avoid fake nodes used to connect direct ancestors into tree.
106106
node = this.sampleNode(tree);
107107
if (node == null) return Double.NEGATIVE_INFINITY;
108-
node = getTargetNode();
109108

110109
// the number of this node
111110
int nodeNr = node.getNr();
@@ -313,20 +312,9 @@ else if (rateDistribution instanceof PiecewiseLinearDistribution) {
313312
return hastingsRatio;
314313
}
315314

316-
protected Node getTargetNode() {
317-
Node node;
318-
Tree tree = treeInput.get();
319-
int nodeCount = tree.getNodeCount();
320-
do {
321-
final int nodeNr = nodeCount / 2 + 1 + Randomizer.nextInt(nodeCount / 2);
322-
node = tree.getNode(nodeNr);
323-
} while (node.isRoot() || node.isLeaf() || node.isFake());
324-
// TODO Auto-generated method stub
325-
return node;
326-
}
327315

328316

329-
private Node sampleNode(Tree tree) {
317+
protected Node sampleNode(Tree tree) {
330318
Node node = null;
331319
int nodeCount = tree.getNodeCount();
332320

0 commit comments

Comments
 (0)