From 86774f0aeb7b45b7276a20624746293e0478d381 Mon Sep 17 00:00:00 2001
From: Yiliang Xiong
Date: Sat, 2 Jun 2012 23:53:32 +0800
Subject: [PATCH] define flow for eastbound and westbound separately
---
dispatching.mod | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dispatching.mod b/dispatching.mod
index fa97796..dc46c19 100644
--- a/dispatching.mod
+++ b/dispatching.mod
@@ -50,7 +50,7 @@ else if r > s and edgetype[s,r] == "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;
# if i travel from r to s on track (r,s)
-var f {i in T, (r,s) in A} binary;
+var f {i in T, (r,s) in A: i in I and (r,s) in E or i in J and (r,s) in W} binary;
# if i uses track (r,s) in E
var y {i in T, (r,s) in E} binary;
# if i go through track (r,s) before MOW
@@ -86,7 +86,8 @@ s.t. flow_cons_west {j in J, n in V: n <> orig[j] and n <> dest[j]}:
s.t. flow_orig_west {j in J}: sum {(r,s) in W: r == orig[j]} f[j,r,s] = 1;
s.t. flow_dest_west {j in J}: sum {(r,s) in W: s == dest[j]} f[j,r,s] = 1;
# toal track flow
-s.t. flow_total {i in T, (r,s) in E}: y[i,r,s] = f[i,r,s] + f[i,s,r];
+s.t. flow_total_east {i in I, (r,s) in E}: y[i,r,s] = f[i,r,s];
+s.t. flow_total_west {i in J, (r,s) in E}: y[i,r,s] = f[i,s,r];
# traffic flow and order
s.t. flow_row {j in T, (r,s) in E}: sum {i in T: i <> j} x[i,j,r,s] <= y[j,r,s];
s.t. flow_col {j in T, (r,s) in E}: sum {k in T: k <> j} x[j,k,r,s] <= y[j,r,s];
--
2.1.1.1.g1fb337f