hello, am having problems with my phase I iteration if someone could help me,here are my model, data and run
### SUBPROBLEM ###
set COLL; # collecton points
set DIS; # disposal sites
set CON; # conveyance
param supply {COLL,CON}>= 0; # amount available at collections
param demand {DIS,CON} >= 0; # amount required at disposals
check {k in CON}:
sum {i in COLL} supply[i,k] = sum {j in DIS} demand[j,k];
param price_convex;# dual price on convexity constr
param price{COLL,DIS} <= 0.000001; # dual price on transport limit
param cost {COLL, DIS, CON} >= 0; # transport cost per unit
var Trans{COLL,DIS,CON} >= 0; # unit to be transported
minimize Artif_Reduce_cost:
sum{i in COLL,j in DIS,k in CON}(cost[i,j,k]-price[i,j])*Trans[i,j,k]-price_convex;
minimize Reduce_cost:
sum{i in COLL,j in DIS,k in CON}(cost[i,j,k]-price[i,j])*Trans[i,j,k]-price_convex;
subject to Supply {i in COLL,k in CON}:
sum{j in DIS}Trans[i,j,k]= supply[i,k];
subject to Demand {j in DIS,k in CON}:
sum{i in COLL} Trans[i,j,k]=demand[j,k];
### MASTER PROBLEM ###
param limit{COLL,DIS} >= 0; # max transported on each link
param nPROP integer >= 0;
param Prop_Transport{COLL,DIS,1..nPROP} >= -0.000001;
param Prop_Cost{1..nPROP} >= 0; # for each proposal from subproblem:
# amount it transports over each link,and its cost
var Wieght{1..nPROP} >= 0;
var Excess>= 0;
minimize Artificial: Excess;
minimize Total_Cost:
sum{k in 1..nPROP}Prop_Cost[k]*Wieght[k];
subject to Multi{i in COLL,j in DIS}:
sum{k in 1..nPROP}Prop_Transport[i,j,k]*Wieght[k]-Excess<= limit[i,j];
subject to convex:sum{k in 1..nPROP}Wieght[k] = 1;
### PHASE III PROBLEM ###
param opt_transport{COLL,DIS} >= -0.000001;
minimize Opt_cost:
sum{i in COLL,j in DIS,k in CON}cost[i,j,k]*Trans[i,j,k];
subject to Opt_Multi{i in COLL,j in DIS}:
sum{k in CON}Trans[i,j,k] = opt_transport[i,j];
data;
set COLL:= C1 C2 C3 C4 C5 C6 C7 C8 C9 C10;
set DIS:= D1 D2;
set CON:= t1 t2 t3 t4 t5;
param supply (tr): C1 C2 C3 C4 C5 C6 C7 C8 C9 C10:=
t1 20 10 15 30 40 50 60 70 80 90
t2 10 20 30 40 50 60 70 50 60 30
t3 30 40 50 20 10 70 80 90 100 102
t4 50 60 70 20 30 30 40 50 60 90
t5 70 80 90 20 30 40 50 60 70 80;
param demand (tr):
D1 D2 :=
t1 30 50
t2 40 60
t3 60 70
t4 80 90
t5 20 30;
param limit default 625;
param cost:=
[*,*,t1]: D1 D2 :=
C1 200 300
C2 300 400
[*,*,t2]: D1 D2 :=
C3 100 200
C4 300 400
[*,*,t3]: D1 D2:=
C5 500 200
C6 400 300
[*,*,t4]: D1 D2 :=
C7 400 500
C8 700 600
[*,*,t5]: D1 D2 :=
C9 200 100
C10 300 400;
ampl: model lan.mod;
ampl: data lan3.dat;
ampl: let nPROP:=0;
ampl: let price_convex:=1;
ampl: let {i in COLL, j in DIS}price[i,j]:=0;
ampl: option solver minos;
ampl: option omit_zero_rows 1;
ampl: option display_1col 10;
ampl: option display_eps .000001;
ampl: problem master: Artificial, Wieght, Excess, Multi, convex;
ampl: problem sub: Artif_Reduce_cost, Trans, Supply, Demand;
ampl: repeat {printf "\nPHASE I -- ITERATION %d\n\n", nPROP + 1;
repeat { ? ampl: solve sub;
repeat { ? ampl: printf "\n";
repeat { ? ampl: display Trans;
repeat { ? ampl: if Artif_Reduce_cost >=- 0.00001 then {printf "\n***NO FEASIBLE SOLUTION***\n";
if ... then { ? ampl: break;
if ... then { ? ampl: }
if ... then {...} ? ampl: else { let nPROP:=nPROP+1;
else { ? ampl: let {i in COLL, j in DIS}Prop_Transport[i,j,nPROP]:= sum{k in CON}Trans[i,j,k];
else { ? ampl: let Prop_Cost[nPROP]:=sum{i in COLL, j in DIS, k in CON}cost[i,j,k]*Trans[i,j,k];
else { ? ampl: };
repeat { ? ampl: solve master;
repeat { ? ampl: printf"\n";
repeat { ? ampl: display Wieght;
repeat { ? ampl: display Multi.dual;
repeat { ? ampl: display{i in COLL, j in DIS}limit[i,j]-sum{k in 1..nPROP}Prop_Transport[i,j,k]*Wieght[k];
repeat { ? ampl: if Excess <= 0.00001 then break;
if ... then {...} ? ampl: else {
else { ? ampl: let {i in COLL, j in DIS}price[i,j]:=Multi[i,j].dual;
else { ? ampl: let price_convex:= convex.dual;
else { ? ampl: };
repeat { ? ampl: };
PHASE I -- ITERATION 1
check['t1'] at line 10 of lan.mod fails:
check{k in CON} : sum{i in COLL} supply[i,k] == sum{j in DIS} demand[j,k];
check['t2'] at line 10 of lan.mod fails.
check['t3'] at line 10 of lan.mod fails.
check['t4'] at line 10 of lan.mod fails.
check['t5'] at line 10 of lan.mod fails.
Error executing "solve" command:
error processing objective Artif_Reduce_cost:
no value for cost['C1','D1','t2']
ampl: