Skip to content

Instantly share code, notes, and snippets.

@mhsharifi96
Created August 23, 2020 17:30
Show Gist options
  • Save mhsharifi96/72ae7bb50604f8c3c07edaf91a288ff6 to your computer and use it in GitHub Desktop.
Save mhsharifi96/72ae7bb50604f8c3c07edaf91a288ff6 to your computer and use it in GitHub Desktop.
!Additive Model Lingo Code
!Additive Model Lingo Code
write by Mohammad hossein sharifi
Aug 2020;
model:
sets:
dmu/1..10/:l;
input/1..4/:si;
output/1..3/:sr;
link1(input,dmu):x;
link2(output,dmu):y;
endsets
data:
x y=@ole('C:\Users\mohammad hossein\Documents\vru\lingo\code\book.xlsx','x','y');
enddata
max=@sum(input(i):si(i))+@sum(output(r):sr(r));
@for(input(i):@sum(dmu(j):l(j)*x(i,j))+si(i)=x(i,o));
@for(output(r):@sum(dmu(j):l(j)*y(r,j))-sr(r)=y(r,o));
@sum(dmu(j):l(j))=1;
calc:
@for(dmu(j):o=j;
@solve();
);
endcalc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment