bath_exp.mod 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # MODEL PARAMETERS
  2. param P ;
  3. param K ;
  4. param vf ;
  5. param M0 ;
  6. param Mbar ;
  7. param TMAX ;
  8. param L ;
  9. param T0 := M0 / vf ;
  10. param n ;
  11. param q ;
  12. # APPROXIMATION GRID
  13. param B {i in 1..n+q};
  14. param q0 ;
  15. # EXPONENTIAL UTILITY FUNCTION
  16. param A0 ;
  17. param a1 ;
  18. param B0 ;
  19. param b1 ;
  20. # A SMALL VALUE
  21. param eps ;
  22. # GENERATE INITIAL SOLUTION WITH UNIFORM ENTRIES
  23. var e {i in 1..n} >= 0.0 ;
  24. var k { i in 1..n+q-1 } # traffic density
  25. = sum {j in max(1,i-q+1)..min(i,n)} e[j];
  26. var v { i in 1..n+q-1 } # traffic speed
  27. = vf * (1 - P * k[i] / K );
  28. var Dt { i in 1..n+q-1 } # travel time from B[i] to B[i+1]
  29. = ( B[i+1] - B[i] ) / v[i];
  30. var t { i in 1..n+q } = # clock time at B[i]
  31. if i = 1 then T0
  32. else t[i-1] + Dt[i-1] ;
  33. # EXPONENTIAL UTILITY FUNCTION
  34. var ue_exp {i in 1..n}
  35. = (A0/a1) * ( 1 - exp (-a1 * t[i] ) );
  36. var ux_exp {i in 1..n}
  37. = (B0/b1) * ( 1 -exp (- b1 * ( TMAX - t[i+q] ) ) );
  38. maximize util_exp: sum{i in 1..n} ( ue_exp[i] + ux_exp[i] ) * e[i] * P ;
  39. # MINIMIZE THE SHORTEST END TIME OF THE RUSH HOUR
  40. minimize last_arrival_time: t[n+q] ;
  41. # CONSTRAINTS OF THE PROBLEM
  42. # 1. All agents enter the bathtub
  43. subject to entry : sum{i in 1..n} e[i] == 1.0 ;
  44. # 2. Jam capacity should not be reached
  45. subject to capacity { i in q .. n } : k[i] <= K / P - eps ;