Class TopologicalGraph
java.lang.Object
org.cloudbus.cloudsim.network.topologies.TopologicalGraph
public class TopologicalGraph extends Object
This class represents a graph containing vertices (nodes) and edges (links),
used for input with a network-layer.
Graphical-Output Restrictions:
- EdgeColors: GraphicalProperties.getColorEdge
- NodeColors: GraphicalProperties.getColorNode
- Since:
- CloudSim Toolkit 1.0
- Author:
- Thomas Hohnstein
-
Constructor Summary
Constructors Constructor Description TopologicalGraph()
Creates an empty graph-object. -
Method Summary
Modifier and Type Method Description void
addLink(TopologicalLink edge)
Adds an link between two topological nodes.void
addNode(TopologicalNode node)
Adds an Topological Node to this graph.List<TopologicalLink>
getLinksList()
Gets a read-only List of all network-graph links.List<TopologicalNode>
getNodeList()
Gets a read-only list of nodes of the network graph.int
getNumberOfLinks()
Gets the number of links contained inside the topological-graph.int
getNumberOfNodes()
Gets the number of nodes contained inside the topological-graph.String
toString()
-
Constructor Details
-
TopologicalGraph
public TopologicalGraph()Creates an empty graph-object.
-
-
Method Details
-
addLink
Adds an link between two topological nodes.- Parameters:
edge
- the topological link
-
addNode
Adds an Topological Node to this graph.- Parameters:
node
- the topological node to add
-
getNumberOfNodes
public int getNumberOfNodes()Gets the number of nodes contained inside the topological-graph.- Returns:
- number of nodes
-
getNumberOfLinks
public int getNumberOfLinks()Gets the number of links contained inside the topological-graph.- Returns:
- number of links
-
getLinksList
Gets a read-only List of all network-graph links.- Returns:
- the List of network-graph links
-
toString
-
getNodeList
Gets a read-only list of nodes of the network graph.
-