model blending uses "mmxprs" ! Computer session 1 declarations products = 1..2 resources = 1..3 benefit: array(products) of real limit: array(resources) of real use:array(resources,products) of real make: array(products) of mpvar end-declarations ! Initialize values benefit:: [10,8] limit:: [56,45,48] use:: [7,4,3,5,4,3] ! Objective function total_benefit:= sum(p in products) benefit(p)*make(p) ! Constraints forall(r in resources) do sum(p in products) use(r,p)*make(p) <= limit(r) end-do maximize(total_benefit) forall(p in products) do writeln("Amount produced of product ",p,": ",getsol(make(p)),".") end-do writeln writeln("The net benefit is ",getobjval,".") end-model