messif.buckets.split.impl
Class SplitPolicyExcludedMiddlePartitioning

java.lang.Object
  extended by messif.buckets.split.SplitPolicy
      extended by messif.buckets.split.impl.SplitPolicyExcludedMiddlePartitioning
All Implemented Interfaces:
ObjectMatcher<LocalAbstractObject>

public class SplitPolicyExcludedMiddlePartitioning
extends SplitPolicy

This class an excluded-middle ball-partitioning policy for bucket splitting.

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.


Nested Class Summary
 
Nested classes/interfaces inherited from class messif.buckets.split.SplitPolicy
SplitPolicy.ParameterField
 
Field Summary
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
 
Fields inherited from class messif.buckets.split.SplitPolicy
PART_ID_ANY
 
Constructor Summary
SplitPolicyExcludedMiddlePartitioning()
          Creates a new instance of SplitPolicyExcludedMiddlePartitioning
 
Method Summary
 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.
 
Methods inherited from class messif.buckets.split.SplitPolicy
getBucketBallRegion, getParameter, getParameterNames, getParameterType, isComplete, isParameterFilled, isParameterLocked, lockParameter, match, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pivot

protected LocalAbstractObject pivot
Policy parameter pivot


radius

protected float radius
Policy parameter radius


rho

protected float rho
Policy parameter rho


dist

protected float dist
The distance to the pivot computed by the last call to match(Region).


PART_ID_INNER

public static final int PART_ID_INNER
Identification of the inner partition. Equal to 0

See Also:
Constant Field Values

PART_ID_OUTER

public static final int PART_ID_OUTER
Identification of the outer partition. Equal to 1

See Also:
Constant Field Values

PART_ID_EXCLUDED

public static final int PART_ID_EXCLUDED
Identification of the outer partition. Equal to 2

See Also:
Constant Field Values
Constructor Detail

SplitPolicyExcludedMiddlePartitioning

public SplitPolicyExcludedMiddlePartitioning()
Creates a new instance of SplitPolicyExcludedMiddlePartitioning

Method Detail

setPivot

public void setPivot(LocalAbstractObject pivot)
Sets the pivot for ball partitioning.

Parameters:
pivot - the pivot

getPivot

public LocalAbstractObject getPivot()
Returns the pivot for ball partitioning.

Returns:
the pivot for ball partitioning

setRadius

public void setRadius(float radius)
Sets the radius for ball partitioning.

Parameters:
radius - the radius

getRadius

public float getRadius()
Returns the radius for ball partitioning.

Returns:
the radius for ball partitioning

setRho

public void setRho(float rho)
Sets the rho for excluded-middle partitioning.

Parameters:
rho - the rho value

getRho

public float getRho()
Returns the rho for excluded-middle partitioning.

Returns:
the rho for excluded-middle partitioning

getDistanceToPivot

public float getDistanceToPivot()
Returns the distance to the pivot which might have been computed by the last call to match(Region). If it is equal to LocalAbstractObject.UNKNOWN_DISTANCE, the distance was not evaluated.

Returns:
the distance to the pivot

match

public int match(LocalAbstractObject object)
Returns 1 for objects outside the ball partition defined by this policy and 0 for objects belonging to the partition.

Specified by:
match in interface ObjectMatcher<LocalAbstractObject>
Specified by:
match in class SplitPolicy
Parameters:
object - an object that is tested for partition
Returns:
1 for objects outside the ball partition defined by this policy and 0 for objects belonging to the partition

getPartitionsCount

public int getPartitionsCount()
Returns the number of partitions of this policy.

Specified by:
getPartitionsCount in class SplitPolicy
Returns:
the number of partitions of this policy

match

public int match(BallRegion region)
Returns the group (partition) to which the whole ball region belongs. Returns -1 if not all objects from the specified ball region fall into just one partition or if this policy cannot decide. In that case, the ball region must be searched one object by one using the match(messif.objects.LocalAbstractObject) method.

Specified by:
match in class SplitPolicy
Parameters:
region - a ball region that is tested for the matching condition
Returns:
the group (partition) to which the whole ball region belongs or -1 if it is uncertain