# Commits

committed 9e4bf03

plot the MOW track window

• Participants
• Parent commits 421ae0b
• Branches master

# File exportsol.run

` # export the solution to MATLAB`
` `
`+### export the input data`
` # origin and destination`
` printf "OD = [\n" > sol.m;`
` for {i in T} {`
`     printf "%d\t%d\t%f\n", r, s, trackleng[r,s] > sol.m;`
` }`
` printf "];\n\n" > sol.m;`
`+# MOW`
`+printf "MOW = [\n" > sol.m;`
`+for {(r,s) in F} {`
`+    printf "%d\t%d\t%d\t%d", r, s, mowstart[r,s], mowend[r,s] > sol.m;`
`+}`
`+printf "];\n\n" > sol.m;`
`+`
`+### export solution`
` # route choice`
` for {i in T} {`
`     printf "y(%d,:,:) = [\n", i > sol.m;`

# File plotmow.m

`+function plotmow(edge, cumleng, mowedge, mowtime)`
`+% plot MOW track window`
`+`
`+    function drawrectangle(x1, x2, y1, y2)`
`+        line([x1;x2], [y1;y1])`
`+        line([x1;x2], [y2;y2])`
`+        line([x1;x1], [y1;y2])`
`+        line([x2;x2], [y1;y2])`
`+    end`
`+`
`+for i = 1:size(mowedge,1)`
`+    j = find(edge(:,1)==mowedge(i,1) & edge(:,2)==mowedge(i,2));`
`+    x1 = cumleng(j);`
`+    x2 = cumleng(j+1);`
`+    t1 = mowtime(i,1);`
`+    t2 = mowtime(i,2);`
`+    drawrectangle(x1, x2, t1, t2)`
`+end`
`+end`

# File runplot.m

`+% import solution`
` run ./sol.m`
`-`
` edge = E(:,1:2);`
` leng = E(:,3);`
`+mowedge = MOW(:,1:2);`
`+mowtime = MOW(:,3:4);`
`+`
`+% plot schedules`
` figure; hold on; grid on`
`-cumleng = plotedge(edge, leng);`
`+[cumleng ax1 ax2] = plotaxes(edge, leng);`
`+plotmow(edge, cumleng, mowedge, mowtime);`
` for i = 1:size(a,1)`
`     route = y(i,:,3);`
`     atime = a(i,:,4);`