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

java.lang.Object
  extended by bcds.phison.clustering.ClustererBase<V,E>
      extended by bcds.phison.clustering.ZoneAsCluster<V,E>
All Implemented Interfaces:
Clusterer<V,E>, WithEnvParams

public class ZoneAsCluster<V,E>
extends ClustererBase<V,E>
implements Clusterer<V,E>

ZoneAsCluster recasts zones in a ZoneMap object into clusters, that is, it adapts to the Clusterer interface an existing clustering arrangement.

The nodes in the default zone of the zonemap are always assigned to the cluster number 0.

Author:
Juan Segovia S.

Constructor Summary
ZoneAsCluster()
          Default constructor.
ZoneAsCluster(SimGraph<V,E> g, java.util.Map<E,? extends java.lang.Number> edge_cost, ZoneMap<V,E> za)
          Creates a new instance.
 
Method Summary
 java.util.Map<V,java.lang.Integer> run()
          Executes the clustering algorithm and returns the node to cluster-id mapping.
 void setup(SimGraph<V,E> g, java.util.Map<E,? extends java.lang.Number> edge_cost, Environ env)
          Initializes this instance.
 
Methods inherited from class bcds.phison.clustering.ClustererBase
dump, getEnviron, getEnvParams, getName, getNodeMapping, groupByClusterId, setNodeMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bcds.phison.clustering.Clusterer
getNodeMapping, groupByClusterId, setNodeMapping
 
Methods inherited from interface bcds.phison.WithEnvParams
getEnviron, getEnvParams, getName
 

Constructor Detail

ZoneAsCluster

public ZoneAsCluster()
Default constructor.


ZoneAsCluster

public ZoneAsCluster(SimGraph<V,E> g,
                     java.util.Map<E,? extends java.lang.Number> edge_cost,
                     ZoneMap<V,E> za)
Creates a new instance. The parameter za is put into a new instance environment and passed to setup.

Method Detail

setup

public void setup(SimGraph<V,E> g,
                  java.util.Map<E,? extends java.lang.Number> edge_cost,
                  Environ env)
Initializes this instance. All three parameters must be non-null. The parameter env must contain a key named zonemap whose value must be an instance of ZoneMap. Note that the key is simply zonemap,without the prefix "ZoneAsCluster.".

Specified by:
setup in interface Clusterer<V,E>
Overrides:
setup in class ClustererBase<V,E>

run

public java.util.Map<V,java.lang.Integer> run()
Description copied from interface: Clusterer
Executes the clustering algorithm and returns the node to cluster-id mapping. The first cluster id is 1.

Specified by:
run in interface Clusterer<V,E>