Commits

Yiliang Xiong committed 6c7d798

define terminal want time period

Comments (0)

Files changed (1)

 param hazard {T};
 param initdelay {T};
 param termtime {T};
+param twtstart {i in T} := termtime[i] - 60;
+param twtend {i in T} := termtime[i] + 180;
 param schedtime {T,V};
 set I := {i in T: traindir[i] == "EASTBOUND"};
 set J := {i in T: traindir[i] == "WESTBOUND"};
 s.t. mow_early {i in T, (r,s) in F}: d[i,r,s] <= mowstart[r,s] + (1 - g[i,r,s]) * M;
 s.t. mow_later {i in T, (r,s) in F}: a[i,r,s] >= mowstart[r,s] - g[i,r,s] * M;
 # terminal want time deviance
-s.t. terminal_early {(i,r,s) in LAST}: early[i,r,s] >= termtime[i] - 60 - a[i,r,s] + (1 - y[i,r,s]) * M;
-s.t. terminal_late  {(i,r,s) in LAST}: late[i,r,s]  >= a[i,r,s] - termtime[i] - 180 + (1 - y[i,r,s]) * M;
+s.t. terminal_early {(i,r,s) in LAST}: early[i,r,s] >= twtstart[i] - a[i,r,s] + (1 - y[i,r,s]) * M;
+s.t. terminal_late  {(i,r,s) in LAST}: late[i,r,s]  >= a[i,r,s] - twtend[i] + (1 - y[i,r,s]) * M;