public class SplitPolicyMultiWayBallPartitioning extends SplitPolicy
The policy is fully defined by:
LocalAbstractObject
pivot
float[]
list of radii
radii
array incremented by one.
The values of radii define the boundaries between two partitiongs. So, the first partition will
contain objects within this range of distances from pivot: [0,radii[0]]. The second partition will
contain objects within this range of distances from pivot: (radii[0],radii[1]]. Finally, the last
partition will contain objects within this range of distances from pivot: (radii[last],infinity).
The matcher
returns the index of the corresponding partition starting from zero.
SplitPolicy.ParameterField
Modifier and Type | Field and Description |
---|---|
protected float |
dist
The distance to the pivot computed by the last call to match(Region).
|
protected LocalAbstractObject |
pivot
Policy parameter pivot
|
protected float[] |
radii
Policy parameter radius
|
PART_ID_ANY
Constructor and Description |
---|
SplitPolicyMultiWayBallPartitioning()
Creates a new instance of SplitPolicyBallPartitioning
|
Modifier and Type | Method and Description |
---|---|
float |
getDistanceToPivot()
Returns the distance to the pivot which might have been computed
by the last call to match(Region).
|
int |
getPartitionsCount()
Returns the number of partitions of this policy.
|
LocalAbstractObject |
getPivot()
Returns the pivot for ball partitioning.
|
float[] |
getRadii()
Returns the array of radii used for the multi-way ball partitioning.
|
int |
match(BallRegion region)
Returns the index of partition to which the whole ball region belongs.
|
int |
match(LocalAbstractObject object)
Returns the index of partition to which the
object belongs. |
void |
setPivot(LocalAbstractObject pivot)
Sets the pivot for ball partitioning.
|
void |
setRadii(float[] radii)
Sets the radii for multi-way ball partitioning.
|
getBucketBallRegion, getParameter, getParameterNames, getParameterType, isComplete, isParameterFilled, isParameterLocked, lockParameter, match, setParameter
protected LocalAbstractObject pivot
protected float[] radii
protected float dist
public SplitPolicyMultiWayBallPartitioning()
public void setPivot(LocalAbstractObject pivot)
pivot
- the pivotpublic LocalAbstractObject getPivot()
public void setRadii(float[] radii)
radii
- the array of radiipublic float[] getRadii()
public float getDistanceToPivot()
LocalAbstractObject.UNKNOWN_DISTANCE
, the distance
was not evaluated.public int match(LocalAbstractObject object)
object
belongs.match
in interface ObjectMatcher<LocalAbstractObject>
match
in class SplitPolicy
object
- an object that is tested for partitionpublic int getPartitionsCount()
getPartitionsCount
in class SplitPolicy
public int match(BallRegion region)
match(LocalAbstractObject)
method.match
in class SplitPolicy
region
- a ball region that is tested for the matching condition