public class SplitPolicyExcludedMiddlePartitioning extends SplitPolicy
The policy is fully defined by:
LocalAbstractObject
pivot
float
radius and
float
rho
The parameter rho
defines a ring of the 2rho width centered at the distance radius
from the pivot.
All objects that have distances to the pivot smaller or equal to the radius minus rho form one partition,
object having the distances greater than the radius plus rho form the second partitiong. The remaining objects falls to
the excluded one (third partition). The matcher
returns 1 for objects outside farer than the ring, 0 for objects closer than the ring, and 2 for objects within the ring.
SplitPolicy.ParameterField
Modifier and Type | Field and Description |
---|---|
protected float |
dist
The distance to the pivot computed by the last call to match(Region).
|
static int |
PART_ID_EXCLUDED
Identification of the outer partition.
|
static int |
PART_ID_INNER
Identification of the inner partition.
|
static int |
PART_ID_OUTER
Identification of the outer partition.
|
protected LocalAbstractObject |
pivot
Policy parameter pivot
|
protected float |
radius
Policy parameter radius
|
protected float |
rho
Policy parameter rho
|
PART_ID_ANY
Constructor and Description |
---|
SplitPolicyExcludedMiddlePartitioning()
Creates a new instance of SplitPolicyExcludedMiddlePartitioning
|
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 |
getRadius()
Returns the radius for ball partitioning.
|
float |
getRho()
Returns the rho for excluded-middle partitioning.
|
int |
match(BallRegion region)
Returns the group (partition) to which the whole ball region belongs.
|
int |
match(LocalAbstractObject object)
Returns 1 for objects outside the ball partition defined by this policy and 0 for objects belonging to the partition.
|
void |
setPivot(LocalAbstractObject pivot)
Sets the pivot for ball partitioning.
|
void |
setRadius(float radius)
Sets the radius for ball partitioning.
|
void |
setRho(float rho)
Sets the rho for excluded-middle partitioning.
|
getBucketBallRegion, getParameter, getParameterNames, getParameterType, isComplete, isParameterFilled, isParameterLocked, lockParameter, match, setParameter
protected LocalAbstractObject pivot
protected float radius
protected float rho
protected float dist
public static final int PART_ID_INNER
0
public static final int PART_ID_OUTER
1
public static final int PART_ID_EXCLUDED
2
public SplitPolicyExcludedMiddlePartitioning()
public void setPivot(LocalAbstractObject pivot)
pivot
- the pivotpublic LocalAbstractObject getPivot()
public void setRadius(float radius)
radius
- the radiuspublic float getRadius()
public void setRho(float rho)
rho
- the rho valuepublic float getRho()
public float getDistanceToPivot()
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