Yiliang Xiong avatar Yiliang Xiong committed a3654b8

S is the set of sliding tracks and apply the constraints to all trains in T

Comments (0)

Files changed (1)

      if tracktype[r,s] == "0"  then 1/60 * speedmult[i] * maxspeedeast
 else if tracktype[r,s] == "S"  then 1/60 * speedmult[i] * maxspeedsl
 else if tracktype[r,s] == "SW" then 1/60 * speedmult[i] * maxspeedsw;
+set S := {(r,s) in E: tracktype[r,s] == "S"};
 
 # if i immediately precedes j on track (r,s)
 var x {i in T, j in T, (r,s) in E: i <> j} binary;
 s.t. entry_time_east {i in I, (r,s) in E: r == orig[i]}: a[i,r,s] >= entrytime[i];
 s.t. entry_time_west {i in J, (r,s) in W: r == orig[i]}: a[i,s,r] >= entrytime[i];
 # long train and sliding track
-s.t. long_train {i in I, (r,s) in E: tracktype[r,s] == "S"}: 
+s.t. long_train {i in T, (r,s) in S}: 
     trackleng[r,s] >= trainleng[i] - (1 - y[i,r,s]) * L;
 # inhalation hazard train
-s.t. hazard_train {i in I, (r,s) in E: hazard[i] == 1 and tracktype[r,s] == "S"}: y[i,r,s] = 0;
+s.t. hazard_train {i in T, (r,s) in S: hazard[i] == 1}: y[i,r,s] = 0;
 
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.