(!******************************************************* Mosel Example Problems ====================== file debug.mos ````````````` Example of the use of `exit'. (c) 2002 Dash Associates author: S. Heipcke *******************************************************!) model "debug" uses "mmxprs" declarations R=1..10 a,b: array(R) of real x: array(R) of mpvar Ctr,obj: linctr end-declarations a:: [2, 4, 6, 8, 10, 9, 7, 5, 3, 1] b:: [9, 7, 5, 3, 1, 2, 4, 6, 8, 10] forall(r in R) x(r) is_binary Ctr:=sum(r in R) b(r)*x(r) <= 100 Obj:=sum(r in R) a(r)*x(r) ! Solve the LP and test whether there is a solution maximize(XPRS_LIN, Obj) if(getprobstat=XPRS_INF) then exit(1) end-if ! Solve the MIP and test whether there is an integer solution maximize(obj) stat:=getparam("XPRS_mipstatus") if(stat<>XPRS_MIP_SOLUTION and stat<>XPRS_MIP_OPTIMAL) then exit(2) else writeln("Solution: ", getobjval) end-if end-model