model:
sets:
production/1..5/:;
factory/1..8/:;
market/1..8/:;
season/1..4/:;
link1(market,season,production):d;
link2(factory,season):p;
link3(factory,production):u,m,h;
link4(factory,market):r,g;
link5(production,factory,season):x,c;
link6(production,factory,market,season):s;
endsets
min=@sum(link5(i,j,t):x(i,j,t)*m(j,i))+@sum(link6(i,j,k,t):s(i,j,k,t)*(r(j,k)+g(j,k)))+@sum(link5(i,j,t):c(i,j,t)*h(j,i));
@for(link2(j,t):@sum(production(i):x(i,j,t)*u(j,i))