model "Brute" uses "mmxprs" parameters DATAFILE="Brute.dat" !OUTFILE="Results.dat" end-parameters declarations !Indices for perfume type PERFUME_TYPE: set of string !Maximum hours of laboratory time Max_Lab_Time: real !Maximum amount of raw material that could be purchased Max_Material: real !Cost, processing time and yield for raw material Raw_Material_Cost: real Raw_Material_Process_Time: real Brute_Yield: real Chanelle_Yield: real !Selling price for each perfume type Revenue: array(PERFUME_TYPE) of real !Further processing cost for each perfume type Further_Process_Cost: array(PERFUME_TYPE) of real !Further processing time for each perfume type Further_Process_Time: array(PERFUME_TYPE) of real end-declarations initializations from DATAFILE Max_Lab_Time Max_Material Raw_Material_Cost Raw_Material_Process_Time Brute_Yield Chanelle_Yield Revenue Further_Process_Cost Further_Process_Time end-initializations finalize(PERFUME_TYPE) declarations !Number of ounces of perfume type sold annually perfume_amount: array(PERFUME_TYPE) of mpvar !Number of pounds of raw material purchased annually raw_material: mpvar end-declarations forward procedure print_solution Profit:= sum(i in PERFUME_TYPE) (Revenue(i)*perfume_amount(i) - Further_Process_Cost(i)*perfume_amount(i)) - Raw_Material_Cost * raw_material !Raw material purchasing constraint raw_material <= Max_Material !Laboratory time constraint sum(i in PERFUME_TYPE) Further_Process_Time(i) * perfume_amount(i) + Raw_Material_Process_Time * raw_material <= Max_Lab_Time !Yield Constraints perfume_amount("Regular Brute") + perfume_amount("Luxury Brute") - Brute_Yield * raw_material = 0 perfume_amount("Regular Chanelle") + perfume_amount("Luxury Chanelle") - Chanelle_Yield * raw_material = 0 maximize(Profit) !fopen(OUTFILE,F_OUTPUT) print_solution !fclose(F_OUTPUT) procedure print_solution !Print value of objective function writeln("Profit: $", getobjval) writeln !New line !Amount to produce writeln("Amount to produce for") forall(i in PERFUME_TYPE) do writeln(" ", i, ": ", getsol(perfume_amount(i)), " ounces") end-do writeln !Raw material used writeln("Amount of raw material used: ", getsol(raw_material), " pounds") end-procedure end-model