cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/network/DelayMatrix.java
private void createDelayMatrix(TopologicalGraph graph, boolean directed) {

		// number of nodes inside the network
		mTotalNodeNum = graph.getNumberOfNodes();

		mDelayMatrix = new double[mTotalNodeNum][mTotalNodeNum];

		// cleanup the complete distance-matrix with "0"s
		for (int row = 0; row < mTotalNodeNum; ++row) {
			for (int col = 0; col < mTotalNodeNum; ++col) {
				mDelayMatrix[row][col] = Double.MAX_VALUE;
			}
		}


        for (final TopologicalLink edge : graph.getLinksList()) {
			mDelayMatrix[edge.getSrcNodeID()][edge.getDestNodeID()] = edge.getLinkDelay();
			if (!directed) {
				// according to symmetry to all communication-paths
				mDelayMatrix[edge.getDestNodeID()][edge.getSrcNodeID()] = edge.getLinkDelay();
			}
		}
	}
/**
	 * Creates all internal necessary network-distance structures from the given graph.
         * For similarity, we assume all communication-distances are symmetrical,
         * thus leading to an undirected network.
	 *
	 * @param graph the network topological graph
	 * @param directed indicates if an directed matrix should be computed (true) or not (false)
	 */
Creates all internal necessary network-distance structures from the given graph.
For similarity, we assume all communication-distances are symmetrical,
thus leading to an undirected network.

@param graph the network topological graph
@param directed indicates if an directed matrix should be computed (true) or not (false)
Creates all internal necessary network - distance structures from the given graph . For similarity we assume all communication - distances are symmetrical thus leading to an undirected network . @param graph the network topological graph @param directed indicates if an directed matrix should be computed ( true ) or not ( false )
private void createDelayMatrix(TopologicalGraph graph, boolean directed) {
		mTotalNodeNum = graph.getNumberOfNodes();
		mDelayMatrix = new double[mTotalNodeNum][mTotalNodeNum];
		for (int row = 0; row < mTotalNodeNum; ++row) {
			for (int col = 0; col < mTotalNodeNum; ++col) {
				mDelayMatrix[row][col] = Double.MAX_VALUE;
			}
		}
        for (final TopologicalLink edge : graph.getLinksList()) {
			mDelayMatrix[edge.getSrcNodeID()][edge.getDestNodeID()] = edge.getLinkDelay();
			if (!directed) {
				mDelayMatrix[edge.getDestNodeID()][edge.getSrcNodeID()] = edge.getLinkDelay();
			}
		}
	}
private void createDelayMatrix ( TopologicalGraph graph , boolean directed ) { mTotalNodeNum = graph . getNumberOfNodes ( ) ; mDelayMatrix = new double [ mTotalNodeNum ] [ mTotalNodeNum ] ; for ( int row = 0 ; row < mTotalNodeNum ; ++ row ) { for ( int col = 0 ; col < mTotalNodeNum ; ++ col ) { mDelayMatrix [ row ] [ col ] = Double . MAX_VALUE ; } } for ( final TopologicalLink edge : graph . getLinksList ( ) ) { mDelayMatrix [ edge . getSrcNodeID ( ) ] [ edge . getDestNodeID ( ) ] = edge . getLinkDelay ( ) ; if ( ! directed ) { mDelayMatrix [ edge . getDestNodeID ( ) ] [ edge . getSrcNodeID ( ) ] = edge . getLinkDelay ( ) ; } } }
Creates all internal necessary network-distance structures from the given graph.
Creates all internal necessary network - distance structures from the given graph .
// number of nodes inside the network // cleanup the complete distance-matrix with "0"s // according to symmetry to all communication-paths