Package ons.util
Class WeightedGraphMultiWeight
java.lang.Object
ons.util.WeightedGraphMultiWeight
public class WeightedGraphMultiWeight
extends java.lang.Object
This graphs shows the reach of each node in each modulation level to all nodes in topology.
If the node is unreachable in modulation level then the edge's weight is 0.
-
Constructor Summary
Constructors Constructor Description WeightedGraphMultiWeight(int n, int levels)WeightedGraphMultiWeight(WeightedGraphMultiWeight g) -
Method Summary
Modifier and Type Method Description voidaddEdge(int source, int target, double w, int level)doublegetClusteringCoefficient(int node, int level)Retrieves the clustering coefficient of this node.WeightedGraphMultiWeightEdgegetEdge(int src, int dst)doublegetGraphDiameter(int level)Retrieves the diameter of this graph.intgetLevels()doublegetWeight(int source, int target, int level)booleanisEdge(int source, int target, int level)int[]neighbors(int vertex, int level)voidremoveEdge(int source, int target, int level)voidremoveNode(int node)voidremoveNodeEdge(int node)voidremoveNodeEdge(int node, int level)intsize()java.lang.StringtoString()
-
Constructor Details
-
WeightedGraphMultiWeight
public WeightedGraphMultiWeight(int n, int levels) -
WeightedGraphMultiWeight
-
-
Method Details
-
size
public int size() -
getLevels
public int getLevels() -
addEdge
public void addEdge(int source, int target, double w, int level) -
isEdge
public boolean isEdge(int source, int target, int level) -
removeEdge
public void removeEdge(int source, int target, int level) -
getWeight
public double getWeight(int source, int target, int level) -
getEdge
-
neighbors
public int[] neighbors(int vertex, int level) -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
removeNodeEdge
public void removeNodeEdge(int node, int level) -
removeNodeEdge
public void removeNodeEdge(int node) -
removeNode
public void removeNode(int node) -
getGraphDiameter
public double getGraphDiameter(int level)Retrieves the diameter of this graph.- Parameters:
level- the edge level- Returns:
- the longest of all the calculated shortest paths in a network
-
getClusteringCoefficient
public double getClusteringCoefficient(int node, int level)Retrieves the clustering coefficient of this node. The clustering coefficient of a node is the ratio of existing links connecting a node's neighbors to each other to the maximum possible number of such links.- Parameters:
node- the nodelevel- the modulation level- Returns:
- the clustering coefficient
-