(!******************************************************* Mosel Example Problems ====================== file coco1.mos `````````````` Coco Problem Phase 1. Initial formulation: data, variables, and constraints fixed. (c) 2001 Dash Associates authors: Y. Colombani & S. Heipcke *******************************************************!) model Coco1 ! Start a new model uses "mmxprs" ! Load the optimizer library declarations make11: mpvar ! Amount of product 1 to make at factory 1 make21: mpvar ! Amount of product 2 to make at factory 1 make12: mpvar ! Amount of product 1 to make at factory 2 make22: mpvar ! Amount of product 2 to make at factory 2 end-declarations ! Objective: maximize total profit MaxProfit:= 50*make11 + 125*make21 + 47*make12 + 132*make22 MxMake1:= make11 + make21 <= 400 ! Capacity limit at factory 1 MxMake2:= make12 + make22 <= 500 ! Capacity limit at factory 2 MxSell1:= make11 + make12 <= 650 ! Limit on the amount of prod. 1 to be sold MxSell2:= make21 + make22 <= 600 ! Limit on the amount of prod. 2 to be sold maximise(MaxProfit) ! Solve the LP-problem ! Print out the solution writeln("Solution:\n Objective: ", getobjval) writeln(" make11: ", getsol(make11), " make12: ", getsol(make12), " make21: ", getsol(make21), " make22: ", getsol(make22)) end-model