|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbcds.phison.gm.GraphMetricBase<V,E>
bcds.phison.gm.AvgTwoTermReliability<V,E>
public class AvgTwoTermReliability<V,E>
Computes the average two-terminal reliability coefficient of a graph.
This coefficient is defined as f/t where:
- f is the number of node-pairs (u,v) for which
there is a path from u to v,
- t is the total number of possible paths when
the graph is connected.
Constructor Summary | |
---|---|
AvgTwoTermReliability()
Default constructor. |
|
AvgTwoTermReliability(SimGraph<V,E> g,
Environ env)
Creates a new instance. |
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 Avg. 2-term. reliability. |
java.lang.String |
getLabel()
Returns "Avg. 2-term. reliability". |
boolean |
isApplicableTo(MetricTarget m)
Returns true if m is MetricTarget.GRAPH . |
void |
run()
Computes the average two-terminal reliability. |
void |
setup(SimGraph<V,E> g,
Environ env)
Saves the parameters for future use. |
Methods inherited from class bcds.phison.gm.GraphMetricBase |
---|
dump, getEdgeMetric, getEnviron, getEnvParams, getGraph, getGraphMetricStdev, getName, getNodeMetric |
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 |
Methods inherited from interface bcds.phison.WithEnvParams |
---|
getEnviron, getEnvParams, getName |
Constructor Detail |
---|
public AvgTwoTermReliability()
setup(SimGraph, Environ)
must be called.
public AvgTwoTermReliability(SimGraph<V,E> g, Environ env)
setup(bcds.phison.SimGraph, bcds.tools.Environ)
to complete the
inialization.
Method Detail |
---|
public void setup(SimGraph<V,E> g, Environ env)
GraphMetricBase
g
must
not be null. If env
is null, a new empty environment
is created. Default values are incorporated by calling
getEnvParams and the types of already-present
values are adapted, if possible.
setup
in interface GraphMetric<V,E>
setup
in class GraphMetricBase<V,E>
public boolean isApplicableTo(MetricTarget m)
m
is MetricTarget.GRAPH
.
isApplicableTo
in interface GraphMetric<V,E>
isApplicableTo
in class GraphMetricBase<V,E>
public void run()
sum = 0 for each strongly_connected_component C in g: sum += |C| * (|C|-1) end return sum / (|V| * (|V|-1))Note that the numerator, the denominator or both above may be zero.
run
in interface GraphMetric<V,E>
run
in class GraphMetricBase<V,E>
public double getGraphMetric()
getGraphMetric
in interface GraphMetric<V,E>
getGraphMetric
in class GraphMetricBase<V,E>
public java.lang.String getLabel()
getLabel
in interface GraphMetric<V,E>
public java.lang.String getDescription()
GraphMetric
getDescription
in interface GraphMetric<V,E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |