# cosmic.mod # # Written by Mike O'Sullivan & Cameron Walker 2004 # # This file alters the (balanced) transportation # model. Demands must be met and supply must be used model; # The supply nodes set SUPPLY_NODES; # The demand nodes set DEMAND_NODES; # The supply at the supply nodes param Supply {SUPPLY_NODES} >= 0, integer; # The demand at the demand nodes param Demand {DEMAND_NODES} >= 0, integer; # The cost of sending one unit of flow param Cost {SUPPLY_NODES, DEMAND_NODES} default 0; # The bounds on the flow of goods param Lower {SUPPLY_NODES, DEMAND_NODES} integer default 0; param Upper {SUPPLY_NODES, DEMAND_NODES} integer default Infinity; # The flow of goods from supply nodes to demand nodes var Flow {i in SUPPLY_NODES, j in DEMAND_NODES} >= Lower[i, j], <= Upper[i, j], integer; # Do we build the plants or not? var Build {SUPPLY_NODES} binary; # The fixed monthly cost of the production plants param FixedCost {SUPPLY_NODES}; # The objective is to minimise the transportation cost + the fixed cost minimize TotalCost: sum {i in SUPPLY_NODES, j in DEMAND_NODES} Cost[i, j] * Flow[i, j] + sum {i in SUPPLY_NODES} FixedCost[i] * Build[i]; # Flow must not exceed supply if it exists subject to UseSupply {i in SUPPLY_NODES}: sum {j in DEMAND_NODES} Flow[i, j] = Supply[i] * Build[i]; # Flow must meet demand subject to MeetDemand {j in DEMAND_NODES}: sum {i in SUPPLY_NODES} Flow[i, j] = Demand[j];