bcds.phison.gm
Class EdgeSetSize<V,E>

java.lang.Object
  extended by bcds.phison.gm.GraphMetricBase<V,E>
      extended by bcds.phison.gm.EdgeSetSize<V,E>
All Implemented Interfaces:
GraphMetric<V,E>, WithEnvParams

public class EdgeSetSize<V,E>
extends GraphMetricBase<V,E>
implements GraphMetric<V,E>

Computes the number of undirected edges in a topology as a GraphMetric. Note that this implementation works only with topologies in which links are present in both directions. If that is not the case, an IllegalArgumentException is thrown.

Author:
Juan Segovia S.

Constructor Summary
EdgeSetSize()
          Default constructor.
EdgeSetSize(SimGraph<V,E> g, Environ env)
          Creates a new instance and calls setup to complete the initialization.
 
Method Summary
 java.lang.String getDescription()
          Returns a string describing the metric, for example, article where it has been published, URL where to find reference implementation, etc.
 double getGraphMetric()
          Returns the number of undirected edges in the topology.
 java.lang.String getLabel()
          Returns "Number of undir. edges".
 boolean isApplicableTo(MetricTarget m)
          Returns true if m is MetricTarget.GRAPH.
 void setup(SimGraph<V,E> g, Environ env)
          Makes sure all links in the topology are bi-directional.
 
Methods inherited from class bcds.phison.gm.GraphMetricBase
dump, getEdgeMetric, getEnviron, getEnvParams, getGraph, getGraphMetricStdev, getName, getNodeMetric, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bcds.phison.gm.GraphMetric
dump, getEdgeMetric, getGraphMetricStdev, getNodeMetric, run
 
Methods inherited from interface bcds.phison.WithEnvParams
getEnviron, getEnvParams, getName
 

Constructor Detail

EdgeSetSize

public EdgeSetSize()
Default constructor.


EdgeSetSize

public EdgeSetSize(SimGraph<V,E> g,
                   Environ env)
Creates a new instance and calls setup to complete the initialization.

Method Detail

setup

public void setup(SimGraph<V,E> g,
                  Environ env)
Makes sure all links in the topology are bi-directional.

Specified by:
setup in interface GraphMetric<V,E>
Overrides:
setup in class GraphMetricBase<V,E>
Throws:
java.lang.IllegalArgumentException - if there a exists a link with only one direction.

isApplicableTo

public boolean isApplicableTo(MetricTarget m)
Returns true if m is MetricTarget.GRAPH.

Specified by:
isApplicableTo in interface GraphMetric<V,E>
Overrides:
isApplicableTo in class GraphMetricBase<V,E>

getGraphMetric

public double getGraphMetric()
Returns the number of undirected edges in the topology.

Specified by:
getGraphMetric in interface GraphMetric<V,E>
Overrides:
getGraphMetric in class GraphMetricBase<V,E>

getLabel

public java.lang.String getLabel()
Returns "Number of undir. edges".

Specified by:
getLabel in interface GraphMetric<V,E>

getDescription

public java.lang.String getDescription()
Description copied from interface: GraphMetric
Returns a string describing the metric, for example, article where it has been published, URL where to find reference implementation, etc.

Specified by:
getDescription in interface GraphMetric<V,E>