diff --git a/src/mhtree/MHTree.java b/src/mhtree/MHTree.java index fb71ff51bf0a9e87376f225d2c67e97a79dd07c8..8ed418d64b3d42f3c2afceacdd2fc80c307d6c62 100644 --- a/src/mhtree/MHTree.java +++ b/src/mhtree/MHTree.java @@ -88,7 +88,7 @@ public class MHTree extends Algorithm implements Serializable { } } else { for (Node child : ((InternalNode) node).getChildren()) { - searchState.queue.add(new ObjectToNodeDistanceRank(searchState.queryObject, child)); + searchState.queue.add(new ObjectToNodeDistanceRank(searchState.queryObject, child, operation.getK())); } } } @@ -100,7 +100,7 @@ public class MHTree extends Algorithm implements Serializable { LocalAbstractObject queryObject = operation.getQueryObject(); PriorityQueue<ObjectToNodeDistanceRank> queue = new PriorityQueue<>(); - queue.add(new ObjectToNodeDistanceRank(queryObject, root)); + queue.add(new ObjectToNodeDistanceRank(queryObject, root, operation.getK())); while (!queue.isEmpty()) { if (approxState != null && approxState.stop()) { @@ -121,7 +121,7 @@ public class MHTree extends Algorithm implements Serializable { } } else { for (Node child : ((InternalNode) node).getChildren()) { - queue.add(new ObjectToNodeDistanceRank(queryObject, child)); + queue.add(new ObjectToNodeDistanceRank(queryObject, child, operation.getK())); } } } diff --git a/src/mhtree/benchmarking/SearchState.java b/src/mhtree/benchmarking/SearchState.java index f3a5dcf248eb84ad72c8f3da308d42d60aaf9957..eccc12112f433139bd4e4c357212c8e44993f36c 100644 --- a/src/mhtree/benchmarking/SearchState.java +++ b/src/mhtree/benchmarking/SearchState.java @@ -16,7 +16,7 @@ public class SearchState { public SearchState(MHTree tree, ApproxKNNQueryOperation operation) { this.queue = new PriorityQueue<>(); - this.queue.add(new ObjectToNodeDistanceRank(operation.getQueryObject(), tree.getRoot())); + this.queue.add(new ObjectToNodeDistanceRank(operation.getQueryObject(), tree.getRoot(), operation.getK())); this.queryObject = operation.getQueryObject(); this.approxState = ApproxState.create(operation, tree); this.recall = 0d;