Commits

Yiliang Xiong committed 3de4250

track type, length and speed are defined on E (eastbound)

Comments (0)

Files changed (2)

 param maxspeedwest;
 param maxspeedsl;
 param maxspeedsw;
-param edgetype {E} symbolic;
-param edgeleng {E};
-param tracktype {(r,s) in A} symbolic := if r < s then edgetype[r,s] else edgetype[s,r];
-param trackleng {(r,s) in A} := if r < s then edgeleng[r,s] else edgeleng[s,r];
-param trainspeed {i in T, (r,s) in A} :=
-     if r < s and edgetype[r,s] == "0"  then 1/60 * speedmult[i] * maxspeedeast
-else if r < s and edgetype[r,s] == "S"  then 1/60 * speedmult[i] * maxspeedsl
-else if r < s and edgetype[r,s] == "SW" then 1/60 * speedmult[i] * maxspeedsw
-else if r > s and edgetype[s,r] == "0"  then 1/60 * speedmult[i] * maxspeedwest
-else if r > s and edgetype[s,r] == "S"  then 1/60 * speedmult[i] * maxspeedsl
-else if r > s and edgetype[s,r] == "SW" then 1/60 * speedmult[i] * maxspeedsw;
+param tracktype {(r,s) in E} symbolic;
+param trackleng {(r,s) in E};
+param trainspeed {i in T, (r,s) in E} :=
+     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;
 
 # if i immediately precedes j on track (r,s)
 var x {i in T, j in T, (r,s) in E: i <> j} binary;
 param maxspeedwest := 70;
 param maxspeedsl   := 20;
 param maxspeedsw   := 15;
-param: E: edgetype edgeleng :=
+param: E: tracktype trackleng :=
     0  1    "0"     18
     1  2    SW      .3
     1  3    "0"     1