1. Yiliang Xiong
  2. RAS2012

Commits

Yiliang Xiong  committed ce228fe

fixbug: node latency should be defined for eastbound and west bound separately

  • Participants
  • Parent commits a3654b8
  • Branches master

Comments (0)

Files changed (2)

File dispatching.mod

View file
  • Ignore whitespace
 # kinetic equations
 s.t. link_latency {i in T, (r,s) in E}: 
     d[i,r,s] - a[i,r,s] = trackleng[r,s]/trainspeed[i,r,s];
-s.t. node_latency {i in T, (r,s) in E, (u,v) in E: u == s}: 
+# EASTBOUND
+s.t. node_latency_east {i in I, (r,s) in E, (u,v) in E: u == s}: 
+    a[i,u,v] - d[i,r,s] - (y[i,r,s] + y[i,u,v] - 2) * M >= 0;
+s.t. wait_lower_east {i in I, (r,s) in E, (u,v) in E: u == s}: 
+    a[i,u,v] - d[i,r,s] + (y[i,r,s] + y[i,u,v] - 2) * M <= b[i,r,s];
+s.t. wait_upper_east {i in I, (r,s) in E, (u,v) in E: u == s}: 
+    a[i,u,v] - d[i,r,s] - (y[i,r,s] + y[i,u,v] - 2) * M >= b[i,r,s];
+# WESTBOUND
+s.t. node_latency_west {i in J, (r,s) in E, (u,v) in E: v == r}: 
     a[i,u,v] - d[i,r,s] - (y[i,r,s] + y[i,u,v] - 2) * M >= 0;
-s.t. wait_lower {i in T, (r,s) in E, (u,v) in E: u == s}: 
+s.t. wait_lower_west {i in J, (r,s) in E, (u,v) in E: v == r}: 
     a[i,u,v] - d[i,r,s] + (y[i,r,s] + y[i,u,v] - 2) * M <= b[i,r,s];
-s.t. wait_upper {i in T, (r,s) in E, (u,v) in E: u == s}: 
+s.t. wait_upper_west {i in J, (r,s) in E, (u,v) in E: v == r}: 
     a[i,u,v] - d[i,r,s] - (y[i,r,s] + y[i,u,v] - 2) * M >= b[i,r,s];
 # block signal sections
 # var mileage {I,A};

File plotroute.m

View file
  • Ignore whitespace
-function plotroute(leng, route, atime, dtime, orig, dest)
+function plotroute(cumleng, route, atime, dtime, orig, dest)
 
 % cummulative track length
-leng1 = leng(1:end-1)';
-leng2 = leng(2:end)';
+leng1 = cumleng(1:end-1)';
+leng2 = cumleng(2:end)';
 % route-specified points
 if orig < dest
     ax = leng1(route==1);
     dx = leng2(route==1);
 else
-    ax = fliplr(leng2(route==1));
-    dx = fliplr(leng1(route==1));
+    ax = (leng2(route==1));
+    dx = (leng1(route==1));
 end
 at = atime(route==1);
 dt = dtime(route==1);