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

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}: 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.