Commits

Yiliang Xiong committed 7685a7c

define latency for link and node

also ensure that the arrival time of the next edge is greater or equal to the departure time the previous edge

  • Participants
  • Parent commits 86774f0

Comments (0)

Files changed (1)

 s.t. flow_sum {(r,s) in E}: 
     sum {i in T, j in T: i <> j} x[i,j,r,s] = sum {k in T} y[k,r,s] - 1;
 # kinetic equations
-s.t. train_stop {i in T, (r,s) in E}: 
-    b[i,r,s] = d[i,r,s] - a[i,r,s] - trackleng[r,s]/trainspeed[i,r,s];
-s.t. train_move {i in T, (r,s) in E}: b[i,r,s] >= (y[i,r,s] - 1) * M;
+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}: 
+    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}: 
+    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}: 
+    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};
 # s.t. train_mileage {i in I, (s,t) in A, r in V: (r,s) in A}: