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

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

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

Computes the number of vertices in a topology as a GraphMetric. This is an overly complicated way of obtaining graph.vertexSet().size() but it is necessary to treat this graph attribute as any other graph metric.

Author:
Juan Segovia S.

Constructor Summary
VertexSetSize()
          Default constructor.
VertexSetSize(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 vertices in the topology.
 java.lang.String getLabel()
          Returns "Number of vertices".
 boolean isApplicableTo(MetricTarget m)
          Returns true if m is MetricTarget.GRAPH.
 
Methods inherited from class bcds.phison.gm.GraphMetricBase
dump, getEdgeMetric, getEnviron, getEnvParams, getGraph, getGraphMetricStdev, getName, getNodeMetric, run, setup
 
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, setup
 
Methods inherited from interface bcds.phison.WithEnvParams
getEnviron, getEnvParams, getName
 

Constructor Detail

VertexSetSize

public VertexSetSize()
Default constructor.


VertexSetSize

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

Method Detail

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 vertices 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 vertices".

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>