$darkmode
DENOPTIM
|
A cluster with a centroid that can be updated after definition of the cluster. More...
Public Member Functions | |
DynamicCentroidCluster () | |
Constructor that defines an empty cluster. More... | |
DynamicCentroidCluster (ClusterableFragment centroid) | |
Constructor that defines the current centroid to be a clone of the given fragment and adds the given fragment as a member of the cluster. More... | |
ClusterableFragment | getCentroid () |
Get the point chosen to be the centroid of this cluster. More... | |
ClusterableFragment | getNearestToCentroid (DistanceMeasure measure) |
Gets the original data that upon clustering is closest to the cluster centroid according to the given distance metrics. More... | |
void | addPoint (ClusterableFragment point) |
Add a new member of this cluster. More... | |
void | removeAll (Collection< ClusterableFragment > points) |
Remove the given cluster member, if it is a member of this cluster. More... | |
List< ClusterableFragment > | getPoints () |
Get the points contained in the cluster. More... | |
Private Attributes | |
List< ClusterableFragment > | points |
The points contained in this cluster. More... | |
ClusterableFragment | centroid |
Current centroid. More... | |
boolean | updateCentroid = false |
Flag requesting the update of the centroid. More... | |
A cluster with a centroid that can be updated after definition of the cluster.
The centroid is updated every time we request to get the centroid and there has been an operation that changed the members (i.e., a points in the cluster) of this cluster (i.e., addition or removal of members).
Definition at line 19 of file DynamicCentroidCluster.java.
denoptim.fragmenter.DynamicCentroidCluster.DynamicCentroidCluster | ( | ) |
Constructor that defines an empty cluster.
Centroid will be defined in the first call of addPoint(ClusterableFragment)
as a clone of the added fragment.
Definition at line 44 of file DynamicCentroidCluster.java.
denoptim.fragmenter.DynamicCentroidCluster.DynamicCentroidCluster | ( | ClusterableFragment | centroid | ) |
Constructor that defines the current centroid to be a clone of the given fragment and adds the given fragment as a member of the cluster.
centroid | the current centroid. |
Definition at line 56 of file DynamicCentroidCluster.java.
References denoptim.fragmenter.DynamicCentroidCluster.centroid, and denoptim.fragmenter.ClusterableFragment.clone().
void denoptim.fragmenter.DynamicCentroidCluster.addPoint | ( | ClusterableFragment | point | ) |
Add a new member of this cluster.
point | the member to add. |
Definition at line 123 of file DynamicCentroidCluster.java.
References denoptim.fragmenter.DynamicCentroidCluster.centroid, denoptim.fragmenter.ClusterableFragment.clone(), denoptim.fragmenter.DynamicCentroidCluster.points, and denoptim.fragmenter.DynamicCentroidCluster.updateCentroid.
Referenced by denoptim.fragmenter.FragmentClusterer.mergeClusters(), denoptim.fragmenter.DynamicCentroidClusterTest.testGetCentroid(), and denoptim.fragmenter.DynamicCentroidClusterTest.testGetNearestToCentroid().
ClusterableFragment denoptim.fragmenter.DynamicCentroidCluster.getCentroid | ( | ) |
Get the point chosen to be the centroid of this cluster.
Definition at line 69 of file DynamicCentroidCluster.java.
References denoptim.fragmenter.DynamicCentroidCluster.centroid, denoptim.utils.MathUtils.centroidOf(), denoptim.fragmenter.ClusterableFragment.getPoint(), denoptim.fragmenter.DynamicCentroidCluster.getPoints(), denoptim.fragmenter.ClusterableFragment.setCoordsVector(), and denoptim.fragmenter.DynamicCentroidCluster.updateCentroid.
Referenced by denoptim.fragmenter.DynamicCentroidCluster.getNearestToCentroid(), denoptim.fragmenter.FragmentClusterer.mergeClusters(), and denoptim.fragmenter.DynamicCentroidClusterTest.testGetCentroid().
ClusterableFragment denoptim.fragmenter.DynamicCentroidCluster.getNearestToCentroid | ( | DistanceMeasure | measure | ) |
Gets the original data that upon clustering is closest to the cluster centroid according to the given distance metrics.
measure | the distance metrics to use to determine which data is closest to the centroid. |
Definition at line 96 of file DynamicCentroidCluster.java.
References denoptim.fragmenter.DynamicCentroidCluster.centroid, denoptim.fragmenter.DynamicCentroidCluster.getCentroid(), denoptim.fragmenter.ClusterableFragment.getPoint(), and denoptim.fragmenter.DynamicCentroidCluster.points.
Referenced by denoptim.fragmenter.DynamicCentroidClusterTest.testGetNearestToCentroid().
List< ClusterableFragment > denoptim.fragmenter.DynamicCentroidCluster.getPoints | ( | ) |
Get the points contained in the cluster.
Definition at line 153 of file DynamicCentroidCluster.java.
References denoptim.fragmenter.DynamicCentroidCluster.points.
Referenced by denoptim.fragmenter.DynamicCentroidCluster.getCentroid(), and denoptim.fragmenter.FragmentClusterer.mergeClusters().
void denoptim.fragmenter.DynamicCentroidCluster.removeAll | ( | Collection< ClusterableFragment > | points | ) |
Remove the given cluster member, if it is a member of this cluster.
points | the member to remove. |
Definition at line 141 of file DynamicCentroidCluster.java.
References denoptim.fragmenter.DynamicCentroidCluster.points, and denoptim.fragmenter.DynamicCentroidCluster.updateCentroid.
Referenced by denoptim.fragmenter.FragmentClusterer.mergeClusters().
|
private |
Current centroid.
Definition at line 29 of file DynamicCentroidCluster.java.
Referenced by denoptim.fragmenter.DynamicCentroidCluster.addPoint(), denoptim.fragmenter.DynamicCentroidCluster.DynamicCentroidCluster(), denoptim.fragmenter.DynamicCentroidCluster.getCentroid(), and denoptim.fragmenter.DynamicCentroidCluster.getNearestToCentroid().
|
private |
The points contained in this cluster.
Definition at line 24 of file DynamicCentroidCluster.java.
Referenced by denoptim.fragmenter.DynamicCentroidCluster.addPoint(), denoptim.fragmenter.DynamicCentroidCluster.getNearestToCentroid(), denoptim.fragmenter.DynamicCentroidCluster.getPoints(), and denoptim.fragmenter.DynamicCentroidCluster.removeAll().
|
private |
Flag requesting the update of the centroid.
Turns true
when we modify the list of members of this cluster.
Definition at line 35 of file DynamicCentroidCluster.java.
Referenced by denoptim.fragmenter.DynamicCentroidCluster.addPoint(), denoptim.fragmenter.DynamicCentroidCluster.getCentroid(), and denoptim.fragmenter.DynamicCentroidCluster.removeAll().