| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Local authorities and public services Description
Further explanation of this example:
'Applications of optimization with Xpress-MP', Chapter 15: Local authorities and public services
Source Files By clicking on a file name, a preview is opened at the bottom of this page. Data Files
j1water.mos (!****************************************************** Mosel Example Problems ====================== file j1water.mos ```````````````` Water conveyance/water supply management A water transport network is provided. Nodes correspond to cities, reservoirs, and pumping stations. Arcs correspond to pipes. Capacities for each reservoir, demand for each city, and capacities for the pipe connections are given. How much water should flow through each pipe to maximize the flow in the network? A network transformation is presented to introduce fictitious source and sink nodes. A LP model based on the transport network representation is presented. (c) 2008 Fair Isaac Corporation author: S. Heipcke, Mar. 2002 *******************************************************!) model "J-1 Water supply" uses "mmxprs" declarations ARCS: range ! Set of arcs NODES=1..12 PIPE: array(ARCS,1..2) of integer ! Definition of arcs (= pipes) CAP: array(ARCS) of integer ! Capacity of arcs SOURCE,SINK: integer ! Number of source and sink nodes end-declarations initializations from 'j1water.dat' PIPE CAP SOURCE SINK end-initializations declarations flow: array(ARCS) of mpvar ! Flow on arcs end-declarations ! Objective: total flow TotalFlow:= sum(a in ARCS | PIPE(a,2)=SINK) flow(a) ! Flow balances in nodes forall(n in NODES | n<>SOURCE and n<>SINK) sum(a in ARCS | PIPE(a,1)=n) flow(a) = sum(a in ARCS | PIPE(a,2)=n) flow(a) ! Capacity limits forall(a in ARCS) flow(a) <= CAP(a) ! Solve the problem maximize(TotalFlow) ! Solution printing writeln("Total flow: ", getobjval) forall(a in ARCS) writeln(PIPE(a,1), " -> ", PIPE(a,2), ": ", getsol(flow(a))) end-model | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

© Copyright 2022 Fair Isaac Corporation. |