Practise Script
Practise Script
sets
I restrictions /1,2,3/
J columns /1*4/
;
parameter
c(j) coefficient of objective function /1 90, 2 50, 3 70, 4 40/
b(i) capacity restriction /1 30
2 24
3 36/
;
table a(i,j) parameter of capacity usage
1 2 3 4
1 2 -1 1 2
2 1 2 3 -1
3 3 2 -1 2
;
free Variables
F variable of objective function
;
positive Variables
x(j) quantity of j
;
Equations
OF objective function
CR capacity restriction
;
OF..F=E=sum(j, c(j)*x(j));
CR(i).. sum(j,a(i,j)*x(j)) =L= b(i);
Parameter
b(i) coefficient of objective function /1 1, 2 2, 3 3, 4 4, 5 5/
K capacity restriction /5/
w(i) parameter of capacity usage /1 1, 2 2, 3 3, 4 4, 5 5/
;
free Variables
F variables of objective function
;
binary Variables
x(i) quantity of i
;
Equations
OF objective function
CR capacity restriction
;
OF..F=E=sum(i, b(i)*x(i));
CR.. sum(i,w(i)*x(i)) =L= K;