public class NetworkTopology
extends java.lang.Object
The topology file may contain more nodes the the number of entities in the simulation. It allows for users to increase the scale of the simulation without changing the topology file. Nevertheless, each CloudSim entity must be mapped to one (and only one) BRITE node to allow proper work of the network simulation. Each BRITE node can be mapped to only one entity at a time.
| Modifier and Type | Field and Description |
|---|---|
protected static double[][] |
bwMatrix |
protected static DelayMatrix_Float |
delayMatrix |
protected static TopologicalGraph |
graph |
protected static java.util.Map<java.lang.Integer,java.lang.Integer> |
map |
protected static int |
nextIdx |
| Constructor and Description |
|---|
NetworkTopology() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addLink(int srcId,
int destId,
double bw,
double lat)
Adds a new link in the network topology
|
static void |
buildNetworkTopology(java.lang.String fileName)
Creates the network topology if file exists and if file can be succesfully parsed.
|
static double |
getDelay(int srcID,
int destID)
Calculates the delay between two nodes
|
static boolean |
isNetworkEnabled()
This method returns true if network simulation is working.
|
static void |
mapNode(int cloudSimEntityID,
int briteID)
Maps a CloudSim entity to a node in the network topology
|
static void |
unmapNode(int cloudSimEntityID)
Unmaps a previously mapped CloudSim entity to a node in the network topology
|
protected static int nextIdx
protected static DelayMatrix_Float delayMatrix
protected static double[][] bwMatrix
protected static TopologicalGraph graph
protected static java.util.Map<java.lang.Integer,java.lang.Integer> map
public static void buildNetworkTopology(java.lang.String fileName)
fileName - name of the BRITE filepublic static void addLink(int srcId,
int destId,
double bw,
double lat)
srcId - ID of the link's sourcedestId - ID of the link's destinationbw - Link's bandwidthlat - link's latencypublic static void mapNode(int cloudSimEntityID,
int briteID)
cloudSimEntityID - ID of the entity being mappedbriteID - ID of the BRITE node that corresponds to the CloudSim entitypublic static void unmapNode(int cloudSimEntityID)
cloudSimEntityID - ID of the entity being unmappedpublic static double getDelay(int srcID,
int destID)
srcID - ID of the source nodedestID - ID of the destination nodepublic static boolean isNetworkEnabled()