bcds.phison.clustering
Class ClustererBase<V,E>

java.lang.Object
  extended by bcds.phison.clustering.ClustererBase<V,E>
Direct Known Subclasses:
Dummy, NoackLinLog, ZoneAsCluster

public class ClustererBase<V,E>
extends java.lang.Object

Provides default implementation of methods (not all) defined in Clusterer as well as additional methods useful for clustering algorithms.

Author:
Juan Segovia S.

Constructor Summary
ClustererBase()
           
 
Method Summary
 void dump()
          For debugging.
 Environ getEnviron()
          Returns a reference to the environment object.
 java.lang.Object[] getEnvParams()
          Returns an zero-length, empty array, suitable for clusterers that do not need addtional environment parameters.
 java.lang.String getName()
          Returns the simple (unqualified) name of this object.
 java.util.Map<V,java.lang.Integer> getNodeMapping()
          See Clusterer.getNodeMapping().
 java.util.Map<java.lang.Integer,java.util.List<V>> groupByClusterId()
          See Clusterer.groupByClusterId().
 void setNodeMapping(java.util.Map<V,java.lang.Integer> m)
          See Clusterer.setNodeMapping(java.util.Map).
 void setup(SimGraph<V,E> g, java.util.Map<E,? extends java.lang.Number> edge_cost, Environ env)
          Saves all the parameters received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClustererBase

public ClustererBase()
Method Detail

setup

public void setup(SimGraph<V,E> g,
                  java.util.Map<E,? extends java.lang.Number> edge_cost,
                  Environ env)
Saves all the parameters received. If env is null, a new instace is created for this object. Finally, calls this.env.adaptTypes(getEnvParams()).


getNodeMapping

public java.util.Map<V,java.lang.Integer> getNodeMapping()
See Clusterer.getNodeMapping().


setNodeMapping

public void setNodeMapping(java.util.Map<V,java.lang.Integer> m)
See Clusterer.setNodeMapping(java.util.Map).


groupByClusterId

public java.util.Map<java.lang.Integer,java.util.List<V>> groupByClusterId()
See Clusterer.groupByClusterId().


getEnvParams

public java.lang.Object[] getEnvParams()
Returns an zero-length, empty array, suitable for clusterers that do not need addtional environment parameters.


getEnviron

public Environ getEnviron()
Returns a reference to the environment object.


dump

public void dump()
For debugging. For each cluster, prints its id, size, and the list of nodes belonging to that cluster.


getName

public java.lang.String getName()
Returns the simple (unqualified) name of this object.