Q.) GAMS the 2-stage model with penalty given only 3 scenarios: all activities together 1 day shorter than expected, 1 day longer or on target. Remember this applies to activities A, B, C and D, but not E.
Sol:
Sets
W Scenarios /w1 * w12/
F Values /F1 * F5/
T Cases /T1 * T3/ ;
prob(W) scenarios probability
/
w1 0.1111
w2 0.1111
w3 0.1111
w4 0.1111
w5 0.1111
w6 0.1111
w7 0.1111
w8 0.1111
w9 0.1111
w10 0.1111
w11 0.1111
w12 0.1111
/;
Table PFmax (F,T) “Costs for Cases”
T1 T2 T3
F1 5 6 7
F2 2 3 4
F3 5 6 7
F4 2 3 4
F5 1 1 1
variables
z Objective Function;
First-Stage Variables
PF(F,T) durations of each scenario;
Second-Stage Variables
ya, yb, yc, yd, ye, x1, x2, x3, x4, x5, ys ;
equations
obj objective function
con1 A
con2 B
con3 C
con4 D
con5 E
con6 1i
con7 2
con8 3
con9 4
con10 5
con11 5i
con12 4i
Con13 ts (How to denote For lateness in scenario s?)
;
obj… z =E= 100ya + 150yb + 200yc + 175yd + 250ye + 3.395061 ;
con1…ya =L= 3 ;
con2…yb =L= 1 ;
con3…yc =L= 2 ;
con4…yd =L= 2 ;
con5…ye =L= 1 ;
con6…x1 =E= 0 ;
con7…x2 =G= x1 + 7 - ya ;
con8…x3 =G= x1 + 6 - yc ;
con9…x4 =G= x2 + 3 - yb ;
con10… x5 =G= x4 + 2 - ye ;
con11… x5 =L= 10 ;
con12… x4 =G= x2 + 3 - yb ;
model Overhaul /all/;
solve Overhaul using LP minimizing z;