|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.pivotselection.AbstractPivotChooser
messif.pivotselection.CoveragePivotChooser
public class CoveragePivotChooser
This pivot chooser selects the pivots in a way that a good coverage of data by ball regions with centers in pivots and radius equal
to a fixed value (threshold) is ensured.
The fixed valus, so-called threshold on radius, is passed to the constructor of this class.
The coverage is done by putting the balls over the data in a way that the balls do not intersect. This implies
that some objects might not have been covered by a ball.
The procedure starts by defining a ball for each object. The first output ball is the most populated ball (the ball containing the
highest number of objects). Next, all balls that intersect are eliminated. The second output ball is the most populated ball again.
This procedure is repeated until there are some non-eliminated balls.
Because we eliminated all balls that intersect, so the population of a ball (number of objects in the ball) is computed
as with the radius equal to double value of the threshold. This implies that the most populated ball leads to elimination of the most
other balls.
CAVEAT: This pivot chooser ignores the parameter count
passed in all selectPivot(int, messif.objects.util.AbstractObjectIterator extends messif.objects.LocalAbstractObject>)
methods.
Nested Class Summary | |
---|---|
protected class |
CoveragePivotChooser.Ball
Class encapsulating info about each cluster (ball region). |
protected class |
CoveragePivotChooser.PrecomputedDistances
A cache for distances between a pair of objects |
Field Summary | |
---|---|
protected float |
clusterDiameter
Ball size multiplied by two |
protected float |
clusterRadius
Ball size -- radius of the cluster. |
static int |
SAMPLE_SET_SIZE
Size of the data sample used to create clusters. |
Fields inherited from class messif.pivotselection.AbstractPivotChooser |
---|
counterBucketReadBuckets, counterObjectDistComp, counterPivotDistComp, counterPivotReadBuckets, preselectedPivots, sampleProviders |
Constructor Summary | |
---|---|
CoveragePivotChooser(float radius)
Creates a new instance of CoveragePivotChooser. |
Method Summary | |
---|---|
void |
filterAfterAdd(LocalAbstractObject object,
LocalBucket bucket)
Filter object after its insertion into a bucket. |
void |
filterAfterRemove(LocalAbstractObject object,
LocalBucket bucket)
Filter object after its removal from a bucket. |
protected void |
selectPivot(int count,
AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
This method carries out the actual pivot selection and must be implemented by subclasses. |
Methods inherited from class messif.pivotselection.AbstractPivotChooser |
---|
addPivot, clear, deregisterSampleProvider, getLastPivot, getNextPivot, getPivot, getPivot, iterator, registerSampleProvider, removeLastPivot, selectPivot, selectPivot, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int SAMPLE_SET_SIZE
protected final float clusterRadius
protected final float clusterDiameter
Constructor Detail |
---|
public CoveragePivotChooser(float radius)
radius
- radius of clusters (balls) used to create the coverageMethod Detail |
---|
protected void selectPivot(int count, AbstractObjectIterator<? extends LocalAbstractObject> sampleSetIterator)
AbstractPivotChooser
addPivot
method.
selectPivot
in class AbstractPivotChooser
count
- Number of pivots to generatesampleSetIterator
- Iterator over the sample set of objects to choose new pivots frompublic void filterAfterAdd(LocalAbstractObject object, LocalBucket bucket)
BucketFilterAfterAdd
filterAfterAdd
in interface BucketFilterAfterAdd
object
- the inserted objectbucket
- bucket, where the object is storedpublic void filterAfterRemove(LocalAbstractObject object, LocalBucket bucket)
BucketFilterAfterRemove
filterAfterRemove
in interface BucketFilterAfterRemove
object
- the removed objectbucket
- bucket, where the object has been stored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |