BoundablePair class

A pair of {@link Boundable}s, whose leaf items support a distance metric between them. Used to compute the distance between the members, and to expand a member relative to the other in order to produce new branches of the Branch-and-Bound evaluation tree. Provides an ordering based on the distance between the members, which allows building a priority queue by minimum distance.

@author Martin Davis

Implemented types

Constructors

BoundablePair(Boundable boundable1, Boundable boundable2, ItemDistance itemDistance)

Properties

boundable1 Boundable
getter/setter pair
boundable2 Boundable
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
itemDistance ItemDistance
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(dynamic o) int
Compares two pairs based on their minimum distances
override
distance() double
Computes the distance between the {@link Boundable}s in this pair. The boundables are either composites or leaves. If either is composite, the distance is computed as the minimum distance between the bounds. If both are leaves, the distance is computed by {@link #itemDistance(ItemBoundable, ItemBoundable)}.
expand(Boundable bndComposite, Boundable bndOther, bool isFlipped, PriorityQueue priQ, double minDistance) → void
expandToQueue(PriorityQueue priQ, double minDistance) → void
For a pair which is not a leaf (i.e. has at least one composite boundable) computes a list of new pairs from the expansion of the larger boundable with distance less than minDistance and adds them to a priority queue.
getBoundable(int i) Boundable
Gets one of the member {@link Boundable}s in the pair (indexed by 0, 1).
getDistance() double
Gets the minimum possible distance between the Boundables in this pair. If the members are both items, this will be the exact distance between them. Otherwise, this distance will be a lower bound on the distances between the items in the members.
isLeaves() bool
Tests if both elements of the pair are leaf nodes
maximumDistance() double
Computes the maximum distance between any two items in the pair of nodes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

area(Boundable b) double
isComposite(Object item) bool