|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Clusterer<V,E>
Defines methods that clustering algorithms must implement. Essentially, a clustering algorithm maps each node to a cluster id (a zero-based integer). The clustering is assumed to be based on an arbitrary numeric edge weight (for example, distance, volume of traffic).
Note, however, that only nodes are clustered; edges' membership to clusters is not taken into account by this interface.
The initialization of a Clusterer must be performed in the
method setup(SimGraph, Map, Environ)
, and a default
(nullary) construictor should be explicitly provided.
This convention follows that of RoutingAlg
.
Please see that interface for further details.
Method Summary | |
---|---|
java.util.Map<V,java.lang.Integer> |
getNodeMapping()
Returns a reference of the clustering map that was produced by run(). |
java.util.Map<java.lang.Integer,java.util.List<V>> |
groupByClusterId()
Returns a map that groups nodes by their cluster id. |
java.util.Map<V,java.lang.Integer> |
run()
Executes the clustering algorithm and returns the node to cluster-id mapping. |
void |
setNodeMapping(java.util.Map<V,java.lang.Integer> m)
Saves a reference to the map m as the node mapping. |
void |
setup(SimGraph<V,E> g,
java.util.Map<E,? extends java.lang.Number> edge_cost,
Environ env)
Performs initialization of a new instance. |
Methods inherited from interface bcds.phison.WithEnvParams |
---|
getEnviron, getEnvParams, getName |
Method Detail |
---|
void setup(SimGraph<V,E> g, java.util.Map<E,? extends java.lang.Number> edge_cost, Environ env)
WithEnvParams.getEnvParams()
for details about the
expected format of the names in env
.
java.util.Map<V,java.lang.Integer> run()
java.util.Map<V,java.lang.Integer> getNodeMapping()
void setNodeMapping(java.util.Map<V,java.lang.Integer> m)
m
as the node mapping. Thus,
overrides the result produced by run.
java.util.Map<java.lang.Integer,java.util.List<V>> groupByClusterId()
[0] -> (N3, N5, Nx, Ny) [1] -> (N0, Nw, ...) ...The elements Nx, Ny, ..., Nz are sorted lexically in ascending order, using their "natural" ordering.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |