diff --git a/src/mhtree/MHTree.java b/src/mhtree/MHTree.java index ae8d9b3c7b5605b16fcccf33e46c7b158d56f67a..2ecf55054b4aeef9350bb4d7023eace5fc3be66d 100644 --- a/src/mhtree/MHTree.java +++ b/src/mhtree/MHTree.java @@ -53,7 +53,7 @@ public class MHTree extends Algorithm implements Serializable { super("MH-Tree"); leafCapacity = builder.leafCapacity; - arity = builder.nodeDegree; + arity = builder.arity; bucketDispatcher = builder.bucketDispatcher; insertType = builder.insertType; @@ -235,7 +235,7 @@ public class MHTree extends Algorithm implements Serializable { /** * Maximal degree of internal node. */ - private final int nodeDegree; + private final int arity; /** * Specifies which method to use when adding a new object. @@ -253,17 +253,17 @@ public class MHTree extends Algorithm implements Serializable { private BucketDispatcher bucketDispatcher; /** - * Specifies how should the nodes be merged together. + * Specifies the merging strategy. */ private MergeType mergeType; /** - * Precomputed objects distances. + * Precomputed object distances. */ private AbstractRepresentation.PrecomputedDistances objectDistances; /** - * Stores leaf nodes and subsequently internal nodes. + * Stores intermediate nodes. */ private Node[] nodes; @@ -282,10 +282,10 @@ public class MHTree extends Algorithm implements Serializable { */ private Node root; - public Builder(List<LocalAbstractObject> objects, int leafCapacity, int nodeDegree) { + public Builder(List<LocalAbstractObject> objects, int leafCapacity, int arity) { this.objects = objects; this.leafCapacity = leafCapacity; - this.nodeDegree = nodeDegree; + this.arity = arity; this.insertType = InsertType.GREEDY; this.objectToNodeDistance = ObjectToNodeDistance.NEAREST; @@ -336,7 +336,7 @@ public class MHTree extends Algorithm implements Serializable { nodeDistances = new PrecomputedNodeDistances(); - root = createRoot(nodeDegree); + root = createRoot(arity); objectDistances = null; System.gc(); @@ -393,7 +393,7 @@ public class MHTree extends Algorithm implements Serializable { notProcessedObjectIndices.clear(furthestIndex); objectIndices.add(furthestIndex); - // Select the rest of the objects up to the total of leafCapacity + // Select the rest of the objects up to the total of leafCapacity with respect to the building of a hull objectIndices.addAll(findClosestItems(this::findClosestObjectIndex, furthestIndex, leafCapacity - 1, notProcessedObjectIndices)); List<LocalAbstractObject> objects = objectIndices diff --git a/src/mhtree/Utils.java b/src/mhtree/Utils.java index 65982f67d3c1f1c9d4f072e8d1525225434be982..a2f5754da402260419f313b506ada38561ebb157 100644 --- a/src/mhtree/Utils.java +++ b/src/mhtree/Utils.java @@ -1,5 +1,7 @@ package mhtree; +import messif.objects.LocalAbstractObject; + import java.util.BitSet; import java.util.function.BiPredicate;