Skip to content

Instantly share code, notes, and snippets.

@mhsharifi96
Created August 8, 2020 11:01
Show Gist options
  • Save mhsharifi96/662d35543354e5ddf3ebb48f7d9f6b8d to your computer and use it in GitHub Desktop.
Save mhsharifi96/662d35543354e5ddf3ebb48f7d9f6b8d to your computer and use it in GitHub Desktop.
model :
sets:
Cinput/1..2/:i;
Coutput/1/:r;
dmu/1..10/:j;
Winput/1..2/:v;
Woutput/1/:u;
link(Cinput,dmu):x;
link1(Coutput,dmu):y;
endsets
data:
x =
2 8
1 3
3 7
1 4
5 2
2 10
3 8
2 9
9 8
10 8;
y = 1 14 9 5 8 5 7 11 12 12;
enddata
max =@sum(Coutput(r):Woutput()*y()) !??;
! ??;
@for(dmu(j):sum(Coutput(r):Woutput(r)*y(r,j)) -sum(Cinput(i):Winput(i)*x(i,j);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment