News forum

Explanation about the use of "gplotdc.m" for lab 1

 
Picture of Isik Ilber Sirmatel
Explanation about the use of "gplotdc.m" for lab 1
by Isik Ilber Sirmatel - Sunday, 7 October 2018, 3:11 PM
 

Dear students,

The function "gplotdc.m" is for plotting a single link, given x and y coordinates for its starting node and ending node, and its occupancy. To plot the whole network, you need to use "gplotdc.m" inside a for loop, with the for loop over the number of links in the network, with the number of links equal to 1570 for the given network.

When using "gplotdc.m", you can fix the adjacency matrix A as A=[0 1;0 0] (and use this A for all 1570 links). What you need to be careful about is that, each link has a specific link ID, starting node ID, and ending node ID (all given in the matrix "links"). Furthermore, each node ID has an associated x and y coordinate (given in the matrix "nodes"). The occupancy of a link is given in the matrix "occupancy", where each column is associated with an individual link with the link ID contained in the first row.

For "time = 75 minutes", you should get a figure similar to the one attached. Note that you are being asked about the snapshots at times 60, 90, and 120 minutes.

Best regards,

Your TAs