public class SplitPolicyGeneralizedHyperplane extends SplitPolicy
SplitPolicy.ParameterField
Modifier and Type | Field and Description |
---|---|
protected float |
halfPivotDistance
The distance between the pivots divided by two.
|
protected float |
leftDist
The distance to the left pivot computed by the last call to match(Region).
|
protected LocalAbstractObject |
leftPivot
Policy parameter left pivot
|
static int |
PART_ID_LEFT
Identification of the left partition.
|
static int |
PART_ID_RIGHT
Identification of the right partition.
|
protected float |
rightDist
The distance to the right pivot computed by the last call to match(Region).
|
protected LocalAbstractObject |
rightPivot
Policy parameter right pivot
|
PART_ID_ANY
Constructor and Description |
---|
SplitPolicyGeneralizedHyperplane()
Creates a new instance of SplitPolicyBallPartitioning
|
Modifier and Type | Method and Description |
---|---|
float |
getDistanceToLeftPivot()
Returns the distance to the left pivot which might have been computed
by the last call to match(Region).
|
float |
getDistanceToRightPivot()
Returns the distance to the right pivot which might have been computed
by the last call to match(Region).
|
LocalAbstractObject |
getLeftPivot()
Returns the first pivot for generalized hyperplane partitioning.
|
int |
getPartitionsCount()
Returns the number of partitions of this policy.
|
LocalAbstractObject |
getRightPivot()
Returns the second pivot for generalized hyperplane partitioning.
|
int |
match(BallRegion region)
Returns the group (partition) to which the whole ball region belongs.
|
int |
match(LocalAbstractObject object)
Returns 0 for objects near the left pivot defined by this policy (or exactly in the middle) and 1 for objects near the right pivot.
|
void |
setLeftPivot(LocalAbstractObject leftPivot)
Sets the first pivot for generalized hyperplane partitioning.
|
void |
setParameter(java.lang.String parameter,
java.lang.Object value)
Use this method to set the policy parameter.
|
void |
setRightPivot(LocalAbstractObject rightPivot)
Sets the second pivot for generalized hyperplane partitioning.
|
getBucketBallRegion, getParameter, getParameterNames, getParameterType, isComplete, isParameterFilled, isParameterLocked, lockParameter, match
protected LocalAbstractObject leftPivot
protected LocalAbstractObject rightPivot
protected float halfPivotDistance
LocalAbstractObject.UNKNOWN_DISTANCE
is held.protected float leftDist
protected float rightDist
public static final int PART_ID_LEFT
0
public static final int PART_ID_RIGHT
1
public SplitPolicyGeneralizedHyperplane()
public void setLeftPivot(LocalAbstractObject leftPivot)
leftPivot
- the pivotpublic LocalAbstractObject getLeftPivot()
public void setRightPivot(LocalAbstractObject rightPivot)
rightPivot
- the pivotpublic LocalAbstractObject getRightPivot()
public void setParameter(java.lang.String parameter, java.lang.Object value) throws java.lang.IllegalStateException, java.util.NoSuchElementException, java.lang.NullPointerException
setParameter
in class SplitPolicy
parameter
- the name of the policy parametervalue
- new value for the parameterjava.lang.IllegalStateException
- if the specified parameter is lockedjava.util.NoSuchElementException
- if there is no parameter for the specified namejava.lang.NullPointerException
- if the specified value is nullpublic float getDistanceToLeftPivot()
LocalAbstractObject.UNKNOWN_DISTANCE
, the distance
was not evaluated.public float getDistanceToRightPivot()
LocalAbstractObject.UNKNOWN_DISTANCE
, the distance
was not evaluated.public int match(LocalAbstractObject object)
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(messif.objects.LocalAbstractObject)
method.match
in class SplitPolicy
region
- a ball region that is tested for the matching condition