/******************************************************** Xpress-BCL C++ Example Problems =============================== file xbdelvr.cxx ````````````````` Transportation problem. (c) 2008 Fair Isaac Corporation author: S.Heipcke, Jan. 2000, rev. Mar. 2011 ********************************************************/ #include #include #include "xprb_cpp.h" using namespace std; using namespace ::dashoptimization; #define NSupp 10 /* Number of suppliers */ #define NCust 7 /* Number of customers */ #define MaxArcs 100 /* Max. num. of non-zero cost values */ #define VANFILE XPRBDATAPATH "/delivery/ifvan.dat" /* Van data file */ #define COSTFILE XPRBDATAPATH "/delivery/cost.dat" /* Cost data file */ /****DATA****/ /* Supplier: London Luton B'ham Bristl Derby Stckpt York */ double SUPPLY[] = {140.0, 600.0, 50.0, 10.0, 400.0, 200.0, 20.0, /* Supplier: Derby Soton Scnthp */ 90.0, 30.0, 12}; /* Customer: London Livpol Doncst York Hull Manchr Shffld */ double DEMAND[] = {123.3, 56.4, 17.1, 192.8, 310.0, 47.0, 86}; double COST[NSupp][NCust]; /* Cost per supplier-customer pair */ double IFVAN[NSupp][NCust]; /* Non-zero if route uses vans instead of lorries */ double VANCAP=40; /* Capacity on routes that use vans */ XPRBprob p("Delivery"); /* Initialize a new problem in BCL */ /***********************************************************************/ void modDelivery() { XPRBexpr lobj, lc; int s,c; XPRBvar x[NSupp][NCust]; /****VARIABLES****/ for(s=0;s= DEMAND[c]); } for(s=0;s