sets
         i index of firms /A,B/
         j index of stores /S,T/
         k index for customers /1*3/
         iteration /1*100/;
parameters
D(k) demand of customers /1 60
                          2 40
                          3 70/

cap(i)   capacity of each firm /A 50,B 90/
f(i,j,k) comment
result(iteration,*) results of loop;

table c(i,j,k) transportation cost
         1       2       3
A.S      5       6       9
A.T      7       10      8
B.S      10      11      14
B.T      6       9       7 ;

f(i,j,k)= 10*c(i,j,k);

variable
         Z;
integer variable
         X(i,j,k);

         X.l("A","S","2") = 20;

equations
         ObjectiveFunction
         co1(i)
         co2(k);

ObjectiveFunction .. Z =e= sum((i,j,k),x(i,j,k)*c(i,j,k));
co1(i)            .. sum((j,k),x(i,j,k)) =l= cap(i);
co2(k)            .. sum((i,j),x(i,j,k)) =g= D(k);

model example2 /all/;
option MIP=Cplex;

         Loop(iteration,
         cap('A')=cap('A')+1;
         solve example2 using MIP minimizing Z;
         result(iteration,'Capacity of firm A')= cap('a');
         result(iteration,'Z')=Z.l;
         );

display Result;
execute_unload 'firstresult.Gdx';