(!****************************************************** Mosel Example Problems ====================== file a5mine.mos ``````````````` Opencast mining (c) 2008 Fair Isaac Corporation author: S. Heipcke, Feb. 2002 *******************************************************!) model "A-5 Opencast mining" uses "mmxprs" declarations BLOCKS = 1..18 ! Set of blocks LEVEL23: set of integer ! Blocks in levels 2 and 3 COST: array(BLOCKS) of real ! Exploitation cost of blocks VALUE: array(BLOCKS) of real ! Value of blocks ARC: array(LEVEL23,1..3) of integer ! Arcs indicating order of extraction extract: array(BLOCKS) of mpvar ! 1 if block b is extracted end-declarations initializations from 'a5mine.dat' COST VALUE ARC end-initializations ! Objective: maximize total profit Profit:= sum(b in BLOCKS) (VALUE(b)-COST(b))* extract(b) ! Extraction order ! forall(b in LEVEL23) 3*extract(b) <= sum(i in 1..3) extract(ARC(b,i)) forall(b in LEVEL23) forall(i in 1..3) extract(b) <= extract(ARC(b,i)) forall(b in BLOCKS) extract(b) is_binary ! Solve the problem maximize(Profit) ! Solution printing declarations WEIGHT: integer ! Weight of blocks end-declarations initializations from 'a5mine.dat' WEIGHT end-initializations writeln("Total profit:", strfmt(getobjval*WEIGHT,8,0)) write("Extract blocks") forall(b in BLOCKS) write(if(getsol(extract(b))>0, " "+b, "")) writeln end-model