Home
ILOG OPL Studio 3.7 Studio User`s Manual
Contents
1. BEBE A zizi B Aexamplestoplalloc pri EQ Data ae F forall c in Cells amp ordered t1 t2 in 1 nbTrans c rbFreas abs freq lt c t1 gt freq lt c t2 gt gt 16 0 nbTrans distance forall ordered c1 c2 in Cells distance c1 c2 gt 8 Al O Transmitters forall t1 in 1 nbTrans c1 8 t2 in 1 nbTrans c2 0 Type abs freq lt c1 t1 gt freq lt c2 t2 gt gt distance c1 c2 8 iw 1 3 Cells 2 5 i B n Fregs ed EQ Variables search 4 amp iQ freq forall t in Transmitters ordered by increasing lt dsize freq Y To in maxFreq tryall f in Freqs ordered by decreasing nbOccur f freq D Ei freg t f ze HE O maxFreq sum i in Freqs nbOccur i freg gt 0 E lt YE Model Projects a Console Solutions Optimization Log Solver CPLEX Stopped at instruction fin 18 Col1 Waiting Figure 7 14 Main Window in Debug Mode with Stepping Option The first instruction is indicated by the yellow current line arrow in the editor ILOG OPL STUDIO 3 7 USER S MANUAL 143 EXECUTING THE PROJECT WITH THE STEPPING IN MODEL OPTION 144 Displaying the Stack Window and Inspector Window Now open the Stack and Inspector windows Click those buttons in the tool bar The Stack window will again display all the instructions executed in the program The Inspector window will again display the current instruction executed O gt salve Inspector x 0
2. nennnnununennnnunnnene 172 Mathematical Programming 0 00s eee eee eee eee eee 175 MP General ooccoccccccc cece nn nan nn nen a a nn nan nn eens 176 Optimization Using Simplex nunenenennenennnennn nen en 180 Preprocessing irori ii iio A taa A A a ae 185 Mixed Integer Programming 00 00 e eee eee nan na nunnu nen nn nne 189 MIP Strategy ota eta wae eal A alata alee humalat 189 MIPS ese eek ces Gon othe Gatien an So crane yates a adi 194 MIP Tolerances ia nce ee ta eee a ee eds eee 198 MIP Cuts tsiklit ee ae ita each ere e DANE fad og tenia ide e de 201 Bartier Algorlt MM 5555418 07508 j ua eta a ee Eee m A ete ee wee 205 Network Simplex Algorithm 0 cece eee eee ee 209 Results of Mathematical Programming 00 0 c eee eee eee eee 211 Working with a Database eee 213 Supported Databases i oia a td fi lee We eae es 214 Database Connectivity oooocoococonnrncnn unune 214 Prerequisit s sico irradia eG aw eae cree a Relea he 216 The Bridge Example 00 c cece eee ee eee rece eee eee eee eee eee e ene 216 Setting Up the Database 0 cece eee eee eee eee 217 ILOG OPL STUDIO 3 7 USER S MANUAL 7 CONTENTS Chapter 11 Chapter 12 The Data Tables 000cooi0oicia ia a ede A he A 218 The Task Table vv coo iria cn hd bs 219 The Resource Table sits ie tee Prat a A Oe eee dle pa 220 The MAX and MIN Table
3. Time limit Sets the OPL parameter tiLim Sets the maximum time in seconds for computations before termination The time limit applies to primal simplex dual simplex barrier and mixed integer optimizations as well as infeasibility finder computations Network simplex and barrier crossover operations are exceptions these processes do not terminate 1f the time limit is exceeded The time limit includes preprocessing time For hybrid optimizations such as network optimization followed by dual or primal simplex barrier optimization followed by crossover the cumulative time applies The value can be any positive number Default 1e 5 ILOG OPL STUDIO 3 7 USER S MANUAL MP GENERAL Refresh rate Sets the screen refresh rate Enter a decimal value for example 0 5 refresh every half second 1 refresh every second 0 refresh as often as possible Default 0 1 Export format No export default LP format MPS format SAV format RLP format REW format These options apply to LP and MIP models The exported file is created with its extension after running the model The destination directory is the directory in which the project file is located or the model file is located CPLEX Log File Sets the OPL parameter cplexLogFile used to generate the CPLEX log file The default value is empty otherwise the value is a string containing a file name As an alternative to using the GUI you can use the setting
4. Figure 8 3 Font Chooser Dialog Box Use the list box on the left side of the dialog box to choose the type of font Use the check boxes in the middle of the dialog box to choose the style of font italic bold underlined or the font size in points OIPNIS IdO Sai le lt n O 3 N 5 ko e Q Use the list box on the right side of the screen to specify the size of the font The text box at the bottom of the dialog box shows the results of your selection Click Apply to return to the Default Options dialog box You must also click Apply in the Default Options dialog box for your changes to appear in the Main window The options will then be restored the next time you start OPL Studio Tip Choose fixed fonts if you have them They will improve indentation and scrolling performance ILOG OPL STUDIO 3 7 USER S MANUAL 167 SETTING EDITOR OPTIONS 168 Changing the Foreground and Background Colors You can change the color used for the following text displays Editor the default colors used for ordinary text inside the editor Errors the colors used to display errors found during syntax checking OPL and OPLScript the colors used to highlight e OPL and C keywords default blue and white e OPL and OPLScript functions or methods default violet and white e OPLScript keywords and C preprocessor macros default orange and white Comments the colors used to display comment
5. EXECUTING THE BRIDGE EXAMPLE 230 ILOG OPL STUDIO 3 7 USER S MANUAL Using OPL Script This chapter explains how to work with OPL Script the OPL scripting language in OPL Studio OPL Script enables you to solve repeated instances of the same model make data modifications format output 4 create algorithmic solutions where the output of one model is used as the input of a second model Refer to the ILOG OPL Studio Language Manual Chapters 16 and 17 for a detailed description of OPLScript ILOG OPL STUDIO 3 7 USER S MANUAL 231 mb mb G a 5 e e v 42 o gt THE VELLINO EXAMPLE The Vellino Example When using this example you will open a script file and execute the script 4 re execute the script step by step in debug mode abort the execution while stepping in the script proceed with the execution while stepping in the script step out from a loop while stepping in the script You do not use projects to manipulate scripts you use script files with the extension osc In this example you will be using the file vellino osc from your release distribution If you used the default directories at installation time you can find this file in the following location For UNIX systems lt installation directory gt OPLSt37 examples opl scripts vellino osc For Windows XP Windows 2000 Windows NT 4 and Windows 98 C ILOG OPLSt37 examples opl scripts vellino osc
6. USER S MANUAL 215 PREREQUISITES Prerequisites In order to follow this example a minimal knowledge of the syntax of the query language SQL would help If you are working with ODBC you are not required to have Microsoft Access installed on your computer However having this product installed will allow you to view the contents of the database file abridge mdb If you are working with Oracle e you must have a user account and a password allowing you to connect to a pre existing database e the Oracle client must be installed The Bridge Example For this example you will need to use the following files from your release distribution Windows XP Windows 2000 Windows NT 4 and Windows 98 c ILOG OPLSt37 examples opl database abridge mod which is the Bridge example using a connection to ODBC c ILOG OPLSt37 examples opl database abridge mdb which is a Microsoft Access database source containing the data for the Bridge example UNIX systems lt installation directory gt OPLSt37 examples opl database obridge mod which is the Bridge example using a connection to Oracle 8 lt installation directory gt OPLSt37 examples opl1 database obridge sql which is an SQL script to help you load the data for the Bridge example into an Oracle database of your choice The Bridge example involves finding a schedule that minimizes the time needed to build a five segment bridge The project contains a set of 46 tasks and
7. gt This model does not contain only linear constraints over integer expressions The model contains higher order constraints See the constraint forall w in Warehouses sum s in Stores supplier s w lt capacityl w supplier s w containsa variable so itis a constraint not a traditional expression Therefore the overall constraint is a meta constraint a constraint on constraints If we do not use explicitly with linear relaxation OPL switches to Solver alone ILOG OPL STUDIO 3 7 USER S MANUAL 153 COOPERATING SOLVERS COMBINED LP AND CP 1 oN oo 154 First you need to modify the example Put the objective function in a variable so that you can refer to it graphically Create totalCost an integer variable between 0 and 1000 var int totalCost in 0 1000 Now minimize totalCost and add a constraint to link this variable to the objective function expression minimize with linear relaxation totalCost subject to totalCost sum w in Warehouses fixed open w sum w in Warehouses s in Stores supplyCost s w supply s w y search forall s in Stores ordered by decreasing regretdmin cost s tryall w in Warehouses ordered by increasing supplyCost s w supplier s w Select Display Search Tree from the Debug menu Deselect any other options Run the program You will see a small search tree with only a few branches The optimal value in the Solutions panel is 383
8. ples opl product mod struct ProductData lt float demand float insideCost float outsideCost float consumption Resources ProductData product Products float capacity Resources var float inside Products var float outside Products minimize sum p in Products product p insideCost inside p product p outsideCostx outside p y rf Console Solutions Optimization Log Solver CPLEX La fiae fin cota Figure 2 3 Project Tree and Editing Area After Inserting a Model File 56 ILOG OPL STUDIO 3 7 USER S MANUAL CREATING A PROJECT Inserting an Existing Data File into a Project Next you are going to insert the product dat file into the project Position the cursor on the project name noname prj and right click on the mouse Select 3 Insert Existing Data File from the menu as shown in Figure 2 4 OPL Studio examples opI product mod olx Ele Edit View Project Execution Debug Options Window Help 18 x POSSBLEUGR Os x TA SUE B Close Project E Browse Model 2 Project Options xjl enum Products eb enum Resources 8 exat Set as Active Project ct ProductData IQ Add New Model File loat demand 8 Add New Data File loat insideCost ra A loat outsideCost o Insert Existing Model File Float consumption Resources 3 Q r Insert Existing Data File Pd A E
9. Figure 1 4 Handles on Dockable Windows You can alternatively double click on the handle to float a window In order to float the tool bar or menu bar double click on the background ILOG OPL STUDIO 3 7 USER S MANUAL 33 ILOG OPL STUDIO MAIN WINDOW 34 Docking a Window To dock a window drag it back inside the Main Window and drop it In Microsoft Windows you must drag and drop the title bar see Figure 1 5 Alternatively double click on the title bar Workspace Title Bar 9 Model Projects Figure 1 5 Title Bar on Floating Window Windows XP 2000 NT 4 98 In UNIX you must drag the handle inside the window as shown in Figure 1 6 Dragging the title bar will have no effect on UNIX platforms X Windows 9 Model Browser empty 9 Model OB Projects Figure 1 6 Handle on Floating UNIX Window X Windows Hiding a Docked Window To hide a docked window just click on the button with a cross in it xj To display it again choose the corresponding window in the View Menu ILOG OPL STUDIO 3 7 USER S MANUAL ILOG OPL STUDIO BASICS ILOG OPL Studio Basics This section describes several basic concepts to consider when you use ILOG OPL Studio O File Types a 42 Models fd 2 e Model files contain OPL statements A stand alone model is a model that can be executed in OPL Studio without any additional requirements A model file can be generated in a compiled form for integrat
10. Optimization Using Simplex Default Options ox kama Propane ereeroceem m sti mP umes Mittes nap cuts Bar aj vi lathematical Programming Tf primal alternate ways of usii Determined automatically Hybrid reduced cost amp devex p Equilibration scaling method Crash ordering Sets the OPL parameter craInd Determines how CPLEX orders variables relative to the objective function when selecting an initial basis Select a value from Tf primal alternative ways of using objective coefficients else aggressive starting basis If primal ignore object coefficients during crash else aggressive starting basis If primal alternative ways of using objective coefficients else default starting basis 180 ILOG OPL STUDIO 3 7 USER S MANUAL OPTIMIZATION USING SIMPLEX Dual pricing algorithm Sets the OPL parameter dPriInd The default pricing Determined automatically usually provides the fastest solution time but many problems benefit from alternative settings Select a value from Determined automatically default Standard dual pricing Steepest edge pricing Steepest edge pricing in slack space Steepest edge pricing unit initial norms Devex pricing Primal pricing algorithm Sets the OPL parameter pPriInd The default pricing Hybrid reduced cost amp devex pricing usually provides the fastest solution time but many problems benefit from alternative settings
11. gt solve Figure 7 15 Stack and Inspector Windows at First Instruction of Stepping Option ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE PROJECT WITH THE STEPPING IN MODEL OPTION Click the Next button to move to the next instruction You can see how the windows have changed 0 gt solve 0 gt forall t in Transmitters Inspector x 0 gt forall t in Transmitters yN y U 0 os sc fto Qe bo IN 9 5 a gt gt Figure 7 16 Stack and Inspector Windows at Second Instruction of Stepping Option Click the Next button four more times While you are doing this notice how ILOG OPL Studio moves from instruction to instruction and how the Stack and Inspector windows change with each move ILOG OPL STUDIO 3 7 USER S MANUAL 145 EXECUTING THE PROJECT WITH THE STEPPING IN MODEL OPTION 146 The Stack and Inspector windows now look like this gt salve gt forall t in Transmitters gt tryall fin Fregs gt freg lt c 4 t1 gt 1 gt tryall fin Fregs gt freg lt c 5 1 gt 1 Inspector x 2 gt freq lt c 5 t1 gt 1 Figure 7 17 Stack and Inspector Windows at Sixth Instruction of Stepping Option If you click the Next button several more times you will see how ILOG OPL Studio displays the values that it tries to assign to the variables Because the values 1 and 2 assigned to freq lt c 5 t 1 gt lead to a failure you
12. 5 amp e Q Figure 8 6 Advanced Options Activity Domains e Min Color used to draw the min rectangle start min end min e Max Color used to draw the max rectangle start max end max e Sure Color used to draw the surely overlapped time window start min end max Drawing Board Docked the drawing board window is docked by default Uncheck this box if you prefer the drawing board to float Blinking status the yellow patch indicating a Waiting state blinks by default Uncheck this box if you do not want the patch to blink in waiting mode This modification is not taken into account in the Project Options only in the Default Options ILOG OPL STUDIO 3 7 USER S MANUAL 171 SETTING MISCELLANEOUS OPTIONS Setting Miscellaneous Options Use the Miscellaneous notebook page to set the paths for OPL and OPLScipt files and for compiled models Default Options Afel p Constraint Programming E Mathematical Programming be MP General Simplex Preprocessing OPL and OPLScript Include Path Mixed Integer Programming MIP Strategy MIP Limits Path for opi file generation MIP Tolerances MIP Cuts Barrier i Network E Graphical User Interface Editor MIP Cuts Barrier Network Editor Output Advanced Miscellaneous 4 gt Figure 8 7 Miscellaneous Options OPL and OPLScript Include Path The pathname entered in this field
13. A BASIC EXAMPLE WITH THE EIGHT QUEENS PROBLEM Az var int queens 1 8 in 1 8 solve forall ordered i j in 1 8 lt queens i lt gt gueens j queens i i lt gt queens j j queens i i lt gt queens j j E search forall i in 1 8 tryall v in 1 8 queens i v E B tryall w in 1 8 0 forallCi in 1 8 0 tryall w in 1 8 1 gt queens 1 1 1 gt tryall vin 1 8 2 gt queens 2 3 2 gt tryall v in 1 8 126 ILOG OPL STUDIO 3 7 USER S MANUAL E E GB E A A A BASIC EXAMPLE WITH THE EIGHT QUEENS PROBLEM Continuing the Execution To continue the execution step by step click the Next button repeatedly and watch how ILOG OPL Studio assigns the variables At this point we describe the tree mode selectors tree abstraction the default search strategy of ILOG OPL Studio Search Tree Mode Selectors e Selection mode Click on the arrow button then double click on a node belonging to the current branch e Elastic zoom mode 42 g 9 3 0 g r O Q lt Click on the zoom button then with the left mouse button trace a rectangle around the element s you want to enlarge When you release the mouse button the enlarged image fills the window e Zoomin Click on the button with a sign then click in the search tree window The image is increased by a factor of 2 each time you click e
14. Changing the rules of business ILOG OPL Studio 3 7 Studio User s Manual September 2003 Copyright O 1987 2003 by ILOG S A All rights reserved ILOG the ILOG design CPLEX and all other logos and product and service names of ILOG are registered trademarks or trademarks of ILOG in France the U S and or other countries Java and all Java based marks are either trademarks or registered trademarks of Sun Microsystems Inc in the United States and other countries Microsoft Windows and Windows NT are either trademarks or registered trademarks of Microsoft Corporation in the U S and other countries All other brand product and company names are trademarks or registered trademarks of their respective holders C N T E N T S Contents Preface Before You Begin gt a va aa ee 11 About ILOG OPL Studio 4 oi a ta maata wales 11 What You Need to Know 0 0 n eua n nunna ena nunn nne nunn nan nan 12 What This Manual Contains nerenennununenenaennnnnene 12 Notation Used in This Manual 00 0c eee eee eee eee eee eens 13 Related Documentation 00 ccc eee eee eee eee eee eee eee 13 Where to Get More Information 0 00 c eect eee eee 14 Users Mailing Liste eas AA Se a A ae ae 15 WebiSitO da A A Dea ee Nee 15 Licensing RequirementS oocoocccconccn nne nun nunna 15 Chapter 1 Overview of ILOG OPL Studio uanunnunnna nunna 17 Launching I
15. Depth bounded Discrepancy Search Best First Search Interleaved Depth First Search For information on these search procedures refer to the ILOG Solver User s Manual ILOG OPL STUDIO 3 7 USER S MANUAL 165 SETTING EDITOR OPTIONS Setting Editor Options Some of the editor options are described in The Text Editor on page 41 You can use the Editor notebook page to set the default fonts and colors for the ILOG OPL Studio editor E Default Options Constraint Programming io Mathematical Programming MP General E Mixed Integer Programming MIP Strategy MIP Limits MIP Tolerances MIP Cuts 5 Barrier i Network Output k Advanced The quick brown fox Miscellaneous The quick brown fox i i i a Graphical User Interface The quick brown fox The quick brown fox The quick brown fox The quick brown fox Figure 8 2 Editor Options 166 ILOG OPL STUDIO 3 7 USER S MANUAL SETTING EDITOR OPTIONS Changing the Fonts You can change the font used for text displays When you click the Font button ILOG OPL Studio displays the Font Chooser dialog box Font Chooser ol x Foundiy CO aj Y Italic Century Gothic Century Schoolbook Comic Sans MS Bold Courier C Underline Fixedsys Frame5 Font F Use point size FrameMakerSmallFont Garamond E prao abedpgrst ABCDEPORST Apply Close
16. Reset o oz e y y F 35 3 2 5 le e g ILOG OPL STUDIO 3 7 USER S MANUAL 189 MIXED 190 INTEGER PROGRAMMING Best bound interval Sets the OPL parameter BBInterval When nodeSe1 2 the value of BBInterval is the interval at which the best bound node instead of the best estimate node will be selected from the tree The value can be O Best estimate node always selected 1 Best bound node always selected or any positive integer Default 7 Heuristic frequency Sets the OPL parameter heurFreq Determines how often to apply the periodic heuristic The value can be 0 Do not apply heuristic at nodes default or any positive integer Priority order generation Sets the OPL parameter MIPOrdType Select a value from Do not generate a priority order default Use decreasing cost Use increasing bound range Use increasing cost per coefficient count Branching direction Sets the OPL parameter brDir Select a value from Down branch first Automatically determined default Up branch first ILOG OPL STUDIO 3 7 USER S MANUAL MIXED INTEGER PROGRAMMING Starting LP algorithm Sets the OPL parameter startAlg to determine which LP algorithm should be used to solve the initial relaxation of the MIP Select a value from Controlled by the 1pmethod parameter default Primal simplex Dual simplex Network optimizer followed by dual simplex Barrier with crossover Sub problem LP al
17. The application is a bin packing configuration that given a supply of components and bins of various types must assign the components to the bins so that the bin constraints are satisfied and the smallest possible number of bins is used The application is described in detail in the ILOG OPL Studio Language Manual Section 16 4 Sequences of Models Here we assume that you are familiar with this application and the solving strategy as it is explained in that document The file vellino osc contains the script to implement the solving strategy It invokes two models contained in the files genBin mod and chooseBin mod Data for the model genBin mod is contained in the file genBin dat All these files are located in the same subdirectory as the script file vellino osc 232 ILOG OPL STUDIO 3 7 USER S MANUAL OPENING THE SCRIPT FILE Opening the Script File In the tool bar of the OPL Studio Main window select File gt Open gt Script or click on the icon B i ILOG OPL Studio displays a standard Open File dialog box for you to select the appropriate script file Select vellino osc from the scripts directory ILOG OPL Studio then displays the script in the editing area C 2 gt Q e a r on 2 me OPL Studio Yexamples opi scripts rellino osc olx Ele Edt View Project Execution Debug Options Window Help la x jeesseadE oo he FEO Model bin genBin mod genBin dat import en
18. USER S MANUAL 103 EXAMINING THE SOLUTION Solution 1 a carpentry plumbing plumbing ceiling roofing roofing painting windows carpentry carpentry carpentry plumbing plumbing plumbing Figure 4 7 Gantt Chart Split into Four Views The top left and top right views are constrained by their vertical scale which means that these two views display the same row but you can select different zoom factors or scroll states along the time axis The same applies to the bottom left and bottom right views The top left and bottom left views are constrained by their horizontal scale time axis but you can select different zoom factors or scroll states for the vertical axis The same applies to the top right and bottom right views 104 ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING THE SOLUTION The Activities Notebook Page ILOG OPL Studio provides another way to look at the Activities results During the execution of the model ILOG OPL Studio added two notebook pages Activities and Sorted Activities to the display area These notebook pages provide additional views of the activities results Click on the Activities tab to bring the Activities notebook page to the foreground SS Console Solutions Optimization Log Solver CPLEX Activities Sorted Activities La ext solution tn 1 Colt Waiting Figure 4 8 Activities Notebook Page for house2 mod Example The chart displaye
19. Dual simplex pricing algorithm 1 Standard dual pricing 2 Steepest edge pricing 3 Steepest edge pricing in slack space 4 Steepest edge pricing unit initial norms 5 Devex pricing 246 ILOG OPL STUDIO 3 7 USER S MANUAL Parameter Name a and Description Type Possible Values Default Page epAGap float Any positive number 1e 6 198 MIP absolute mipgap tolerance epGap float Any number between 0 0 and 1 0 1e 04 198 MIP relative mipgap tolerance epInt float Any number between 1e 09 and 1 0 1e 05 199 MIP integrality tolerance epMrk float Any number between 0 0001 and 0 99999 0 01 183 Simplex Markowitz tolerance epOpt float Any number between 1e 10 and 0 01 1e 06 183 Simplex optimality tolerance epPer float Any positive number gt 1e 8 1e 6 184 Simplex perturbation constant epRHS float Any number between 1e 10 and 0 01 1e 06 183 Simplex feasibility tolerance finalFactor int 0 Off 1 181 1 On Simplex final basis factorization after uncrush flowCovers int 1 Do not generate flow cuts 0 202 0 Automatically determined 1 Generate flow cuts moderately MIP flow cuts indicator 2 Generate flow cuts aggressively flowPaths int 1 Do not generate flow path cuts 0 203 0 Automatically determined 1 Generate flow path cuts moderately MIP flow path cut indicator 2 Generate flow path cuts aggressively fracCand int Any non negative integer 200 196 Candidate limit for ge
20. ILOG OPL Studio opens the files associated with the project in the editing area of the Main window For this example it opens alloc mod and alloc dat OPL Studio Ele Edit View Project Execution Debug Options Window Help EEES B d texamplestopltalloc pri 8 alloc mad nbCells 25 nbFregs 256 nbTrans 8 6 6 1 4 4 8 8 8 8 4 9 8 4 4 16 8 9 8 4 5 4 8 1 1 distance 16 1 1 8 8 8 8 8 1 1 1 1 1 2 2 1 1 1 16 2 8 8 8 8 8 2 2 1 1 1 2 2 0 1 2 16 0 0 0 0 0 2 2 1 1 1 2 2 0 0 0 0 16 2 2 0 0 0 0 0 0 0 0 0 1 0 0 0 2 16 2 0 0 0 0 0 0 0 0 0 1 09 0 0 2 2 16 0 0 0 0 0 0 0 0 0 1 6 0 0 0 0 0 16 2 0 0 1 1 1 0 0 1 e 09 0 0 0 0 0 2 16 0 0 1 1 1 0 0 1 Medal Kl IA A sii TTK KT Console Solutions Optimization Log Solver CPLEX La Project loaded Ln 18 Col3 Figure 7 3 Main Window for the Frequency Allocation Example ILOG OPL STUDIO 3 7 USER S MANUAL THE FREQUENCY ALLOCATION EXAMPLE Looking at the Model Structure If you want to see the data structure of alloc mod before executing the project you need to browse the model To do this click on the Model tab in the work space right click on the root item select Browse Active Model from the menu see Figure 7 4 Ol x OPL Studio Ele Edt View Project Execution Debug Options Window Help gt OoSSBLENG Kx
21. Ln 23 Col 1 waiting Figure 3 5 setup Variable Results for Solution 1 Again if you want to see another view of this result go to the model browser and double click the setup entry in the Variables folder ILOG OPL Studio displays the following panel with the same results This time the results are displayed in matrix format The 5 options are listed on the left hand side of the panel and the 10 slots appear across the top Again the values 1 and 0 in the matrix indicate whether the car at that intersection requires the option or not The car at 1 1 requires option 1 the car at 1 2 does not require option 1 pauljapaid o lt Q 3 i y gt m lt Figure 3 6 Alternative View of setup Variable Results for Solution 1 ILOG OPL STUDIO 3 7 USER S MANUAL 87 COPYING THE RESULTS MATRIX TO A SPREADSHEET Copying the Results Matrix to a Spreadsheet You can copy the results matrix from OPL Studio to an external spreadsheet such as Microsoft Excel StarOffice or gnumerics Select a matrix or sub matrix by dragging the mouse from the top left corner of the matrix to the bottom right corner Press Ctrl C to copy to the clipboard then Ctrl V to paste into the spreadsheet Tabulation characters are placed between the cells as separators Note You can read and write to an Excel sheet via OPL or OPL Script by using the keywords SheetConnection SheetRead and SheetWrite Continuing the Exe
22. MIP Tolerances MIP Cuts Barrier Network E l E Mathematical Programming A TF MP General Cliques indicator Constraint aggregation limit Simplex Automatically determined gt El Preprocessing 3 A 8 Mixed Integer Programming Covers indicator MIP disjunctive cuts indicator P Strategy Automatically determined y Automatically determined y P Limits Flow covers MIP flow path cut indicator P Tolerances MIP Cuts Automatically determined y Automatically determined a Bamer GUB Covers MIP Mixed Integer Rounding cut indicator i Network E Graphical User Interface Automatically determined z Automatically determined x Implied bound cuts indicator Output Advanced Automatically determined y Miscellaneous MIP Gomory fractional cuts indicat Automatically determined y OK Apply Cancel Reset Cliques indicator Sets the OPL parameter cliques Select a value from Do not generate cligue cuts Automatically determined default Generate clique cuts moderately Generate clique cuts aggressively Covers indicator Burwmweiboldg o D gt O 3 D O 2 Sets the OPL parameter covers Select a value from Do not generate cover cuts Automatically determined default Generate cover cuts moderately Generate cover cuts aggressively ILOG OPL STUDIO 3 7 USER S MANUAL 201 MIXED 202 INTEGER PROGRAMMING Flow covers Sets the OPL parameter flowCovers
23. Sets the OPL parameter MIRCut s to determine whether or not to generate MIR cuts for the problem Setting the value to 0 the default indicates that the attempt to generate MIR cuts should continue only if it seems to be helping The value can be 1 Do not generate MIR cuts 0 Automatically determined default 1 Generate MIR cuts moderately 2 Generate MIR cuts aggressively 204 ILOG OPL STUDIO 3 7 USER S MANUAL BARRIER ALGORITHM Barrier Algorithm Default Options olx Constraint Programming Preprocessing MIP Strategy MIP Limits MIP Tolerances MIP Cuts Barrier neti 4 E Mathematical Programming MP General Barrier algorithm Convergence tolerance 1e 008 Simplex Preprocessing Default primal dual log barrier Growth limit 1e 012 Mixed Integer Programming A KUS 1H MIP Strategy Ordering algorithm Objective range e MIP Limits i Column non zeros 0 MIP Tolerances Automatic MIP Cuts Starting point algorithm Iteration limit 2100000000 Barrier rier Network Dual is 0 y Maximum correction limit 1 E Graphical User Interface Editor Barrier crossover method Out of core barrier indicator Output Advanced Automatic y Barrier thread limit 0 Miscellaneous OK Apply Cancel Reset Barrier algorithm Sets the OPL parameter barAlg to determine which barrier algorithm is used The default value Default primal dual log barrier is normally fastest but the alternative settin
24. Sets the OPL parameter depInd The dependency check strengthens problem reduction by detecting redundant constraints Such reductions are usually most effective with the Barrier optimizer but these reductions can be applied to LP or MIP problems The settings for this parameter enable a user to control dependency checking 1 Automatic default 0 Off 1 On at beginning of preprocessing Sunuwe1bB01d o z D a gt O 3 D le 9 2 On at end of preprocessing 3 On at beginning and end of preprocessing If the dependency check is activated it will search for dependent rows during preprocessing If it is not activated dependent rows will not be identified For many models eliminating the dependency check will speed up the preprocessing time at the expense of not identifying dependent rows ILOG OPL STUDIO 3 7 USER S MANUAL 187 PREPROCESSING 188 Pre optimizer passes Dual Sets the OPL parameter preDual Determines whether CPLEX Presolve should pass the primal or dual linear programming problem to the linear programming optimization algorithm By default CPLEX chooses automatically If the DUAL indicator is set to On the CPLEX presolve algorithm is applied to the primal problem but the resulting dual linear program is passed to the optimizer This is a useful technique for problems with more constraints than variables The value can be Off Automatic default On Primal and dual reduction type Sets
25. Show AllAchvities Show Sorted Activities x Hose Al Display Windows po F 2 os sc fto Qo cc 9 5 es gt gt Figure 7 4 Browsing an Active Model Frequency Allocation Example Other ways of browsing a model are described in Using the Model Browser on page 67 The model s elements are displayed in a tree structure in the work space see Figure 7 5 OPL Studio ol x File Edit View Project Execution Debug Options Window Help KETTI CEES ta examples opl alloc pri Data Y nbCells Q nbFregs Q nbTrans Q distance Transmitters nbCells nbFreqs nbTrans nud N Val o distance n Fregs Variables i Q hea t Q maFreg eee Figure 7 5 Model Browser for the Frequency Allocation Example To expand the docked work space window do one of the following drag down the border between the work space and the output area and drag to the right the border between the work space and the editing area click on the button 4 in the top right corner of the work space ILOG OPL STUDIO 3 7 USER S MANUAL 135 THE FREQUENCY ALLOCATION EXAMPLE 136 Setting the Debug Option The frequency allocation example illustrates the debug feature well because of the search procedure that appears in the model file See Code Sample 7 1 To use the debug feature select one of the debug options from the Debug menu in the menu bar ILOG OPL Studio gives you the following
26. does not allow the compiling of models for deployment you do not need a key The evaluation period is 6 months The free trial version does not include the OPL Component Library and not all database drivers are provided ILOG OPL STUDIO 3 7 USER S MANUAL 15 16 To use OPL Studio 3 7 in batch mode you need the keys for the underlying libraries as required by your model CPLEX and or Solver and or Scheduler The keys required to execute an OPL model or a compiled OPL model using the OPL Component Libraries are indicated in the Preface of the ILOG OPL Studio Component Libraries User s Manual Information on licensing requirements can also be found in the file readme txt delivered with OPL Studio ILOG OPL STUDIO 3 7 USER S MANUAL Overview of ILOG OPL Studio This chapter describes the basic features of ILOG OPL Studio how to launch the product the main window and its elements the basic concepts for using ILOG OPL Studio the text editor the online help ILOG OPL STUDIO 3 7 USER S MANUAL 17 OIPNIS IdO s e lt 2 lt lt O Q LAUNCHING ILOG OPL STUDIO Launching ILOG OPL Studio 18 In this manual we assume that you have already successfully installed ILOG OPL Studio on your particular platform If this is not the case refer to the booklet delivered with the OPL Studio CD ROM Once you have installed the product you are ready to launch ILO
27. 161 Default Options Constraint Programming enennuunueuaenunenenanne nan nne 165 Editor Options sii A SEA 166 Font Chooser Dialog BOX ss 14 54 amuna pm eee ee ev eee eek row ak ee ea eee ee de ee alal 167 Color Chooser Dialog BOXES 1 cece eee eee eens 168 Output Options a cad ataca Sie ea eae Tae abe eee Sow aes ete ate DEORE AT 169 Advanced Options sss sisusse mamma mi mala beeps eee Rea ee eee 171 Miscellaneous Options mesere Aa A aata a ta AVA Gite a 172 TAS Task Ta ha ESE me taak EU aa E Aara ds a 219 TIEM a a a isis 220 The RSS es Tal A A area A ween da a 0 aata 227 Contents of the Results Table 2 cccescevtea eevee eevee ved ewe ee ne eee Maata laata 228 vellino osc OPL Script Example ueuenannnnnuenennenn neuen na nen nene 233 Execution of the vellino osc Example ennenuunuanuanuanna nunn nn nn nn nn na 235 ILOG OPL STUDIO 3 7 USER S MANUAL 257 FIGURES 11 3 Step by Step Execution of a SOript ooccoccorronrnarnrr nene e nanna 11 4 A Loop in a Script 11 5 Stepping Out of a Loop in OPLScript ooccoccocconrnarnnnr ann anna 258 ILOG OPL STUDIO 3 7 USER S MANUAL List of Tables 1 1 Commands in the Menu Bal cccccccccc uanaaneeennennn nan aan naa nene neem nn na 26 1 2 EditoniFUNCHIONS 4 koni aa id AI he aha end ded See Set 43 A 1 ORE Parametersss a taa 243 ILOG OPL STUDIO 3 7 USER S MANUAL 259 TABLES 260 ILOG OPL STUDIO 3 7 USER S MA
28. First Choice Point Displaying the Inspector Window Click the Inspect Current Node button p in the tool bar of the Main window ILOG OPL Studio displays the Inspector window in a docked state but you can float it by clicking on its handle at the left side The current instruction is displayed in the Inspector window Inspector x 1 gt tryall fin Fregs Figure 7 9 Inspector Window Floating at the First Choice Point ILOG OPL STUDIO 3 7 USER S MANUAL 139 po y U 0 os sc O Qe 9 5 a gt EXECUTING THE FREQUENCY ALLOCATION PROJECT Continuing the Execution You can continue the execution by clicking the Next button to look at the subsequent choice points Click the Next button E to go the next choice point As you do this you can see how the Stack and Inspector windows change showing the instructions that were executed The Stack window now looks like this gt salve gt forall tin Transmitters gt trpall fin Freqs gt freq lt c 4 t1 gt 1 gt tryall fin Fregs Figure 7 10 Stack Window at Second Choice Point The Inspector window now looks like this Inspector x 2 gt tryall fin Fregs Figure 7 11 Inspector Window at Second Choice Point 140 ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE FREQUENCY ALLOCATION PROJECT Click the Next button two more times As you progress through the execution you can see the values that w
29. Fore Back Gantt font The quick brownfox Fom Gantt activities color The quick brown fox Fore Back Output Notebook M Activities Y Sorted activities Y Textual result Precision 4 Console font Tne quick brown fox Font OK Apply Cancel Reset OIPNIS IdO oo O 2 o 3 N eQ Figure 8 5 Output Options e Q 4 For the model browser display windows e Square matrix check this box to specify that the cells in a displayed matrix appear as squares If this box is not checked the cells appear as rectangles e Hide the zeros check this box to specify that the zeros in a displayed matrix do not appear If this box is not checked the zeros appear in the matrix e Font the font used in the results panels displayed from the model browser Select options from the Font Chooser e Data colors the colors used to display the results in the panels that pop up from the model browser Select options from the Color Chooser e Label colors the colors used to display the labels of a matrix in the panels that pop up from the model browser Select options from the Color Chooser e Gantt font the fonts used in the Gantt charts displayed from the model browser e Gantt activities color the activities colors in the Gantt charts displayed from the model browser ILOG OPL STUDIO 3 7 USER S MANUAL 169 SETTING OUTPUT OPTIONS For t
30. OPL Studio text editor has the following features MDI approach The MDI Multi Document Interface enables you to edit more than one file at the same time OIPNIS IdO Syntax coloring x O lt 2 lt lt A O Q The syntax in each type of file that you can load model script data or C file is colored differently according to its type Multiple levels of Undo and Redo You can undo and redo your modifications without any limit Automatic indentation blocks are automatically indented Brace matching When typing or the matching open brace is highlighted for 800 ms In data files lt and gt are also matched Margin symbols The editor has a left margin that can contain margin symbols such as e the yellow arrow that indicates the current line oy e the blue arrow that indicates an error mi Reload prompt If you modify a file with an external editor you are prompted to reload the file as soon as the OPL Studio editor regains focus Switching Between Editor Windows The editor respects the Multi Document Interface MDI approach which allows you to edit more than one file at a time and thus have several document windows open simultaneously as shown in Figure 1 2 Main Window ILOG OPL STUDIO 3 7 USER S MANUAL 41 THE TEXT EDITOR 42 The Window menu lists the opened files and allows you to arrange them in a cascade or as tiles An icon in the upper left corne
31. Objective Value 104 Also OPL Studio will open the model browser You can examine the model in the usual manner to see the contents of the various data structures in this example Viewing the Result in the Database When you have successfully executed the model from OPL Studio you can view in the database the contents of the newly created table Result Windows XP Windows 2000 Windows NT 4 and Windows 98 Close OPL Studio and Microsoft Access 1f you are using it Restart Microsoft Access by double clicking from Windows Explorer on the database abridge mdb Figure 10 3 shows that the Result table has been added to the list of tables abridge mdb 226 ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE BRIDGE EXAMPLE 85 abridge Database iof x Tables Queries EZ Forms B Reports 2 Macros E Modules MAx_EF MAX NF MIN AF MIN NF MIN SF Precedence Requirements Resource Result Task a Figure 10 3 The Result Table mba o o 2 5 DH D 2 os gt ILOG OPL STUDIO 3 7 USER S MANUAL 227 EXECUTING THE BRIDGE EXAMPLE Double click on Result in order to see the table s contents The table contains 46 rows each row corresponding to a task with its optimal start and end time as you can see in Figure 10 4 Figure 10 4 Contents of the Results Table If you want to rerun the example first remove the table Result from the database by selecting the name Result
32. Option 142 Displaying the Stack Window and Inspector Window e 144 Visualizing the Search Strategy with the Stack and Inspector Windows 147 Visualizing the Search Tree 00 c eee cee eee eee 148 Using the Depth First Search 2 0 0 0 cette eee 148 Using the Slice Based Search 1 0 0 eect eee 150 Cooperating Solvers Combined LP and CP 0 0 e cece eee eee eee eee 153 Exploration Strategy Drawing Board Combined with Search Tree 160 Terminating ILOG OPL Studio ne es samaa ane a a aia eee eee 162 ILOG OPL STUDIO 3 7 USER S MANUAL Chapter 8 Chapter 9 Chapter 10 CONTENTS Customizing ILOG OPL Studio nnnennnnnannna 163 Default Options and Project Options nernununnunnnnna 164 Setting the Default Options r rererereaeaeeeeea 164 Setting Project Options Aela deine A OA Aa ae Aa 164 Navigating in the Options Dialog BOX8S oooccoccccococ 164 Setting Constraint Programming Options nnennenunennne 165 Setting Editor Options shasi eirias aiser Gina en 166 Changing the Fonts sec soc wise A caidas 167 Changing the Foreground and Background Colors 0 cece eee eee eee 168 Setting Output Options ez soos es 169 Setting Advanced Options 0 0 0 cece eee eee eee eee 171 Setting Miscellaneous Options
33. Running Indicates that ILOG OPL Studio is executing the active model project or script Yellow Waiting Indicates that ILOG OPL Studio is in a waiting state during flashing execution mode It is waiting for further direction from the user to continue or stop the execution Red Aborting Indicates that ILOG OPL Studio is aborting the execution The default behavior of the yellow box is to blink in order to remind you that OPL Studio isina waiting state You can stop this effect in the Advanced page of the Default Options dialog box See Setting Advanced Options on page 171 ILOG OPL STUDIO 3 7 USER S MANUAL ILOG OPL STUDIO MAIN WINDOW Menu Bar Commands Eile Edit View New 2 Undo Ctrl Z Workspace Q Open 62 Redo Cte Output Recent Files 42 Cut Ctrl KA Choice Stack E Save Ctl 5 Copy Ctrl C gt gt Inspect Current Node El Save As A Paste Ctrl Gi Save All Kill Line Ctrl K B Close Current Editor Select All Cirle 15 Close Active Project Find Ctrl F Dump ctive Model and Result irg Nert A ES I Generate Compiled Model File Aa Replace Ctrl H Quit Ctrl Q GoTo Ctl G Recenter Ctrl L Comment Uncomment A CompleteWord Ctrl T Debug Stepping in Model Stepping in Script Stop at Choice Point Stop at Solution Display Search Tree Options Customize Default Options pe Customize Active Project Options Window E Cascad
34. Save the Project 2 s he Piciect A uctData product Products Q Gi Save the Project As t capacity Resources o s float inside Products float outside Products minimize sum p in Products product p insideCostxinside p product p outsidetCostxoutside p Mi Projects gt E Model Figure 2 4 Inserting a Data File into a Project ILOG OPL Studio again displays the Open File dialog box this time filtering the dat files Look in a opl zl El exi database 2 config dat 3 knapsackp dat 3 product2 c scheduler a covering dat a marriage dat a production scripts a fixed dat a mulprod dat a productn c a alloc dat a gas dat a oil dat a sailco dat a car dat a gasn dat a prodmilp dat a sailcopwg a carsmall dat a knapsack dat E product dat a sailcopwae o File name product dat Files of type Data files dat y Cancel C Open as read only Figure 2 5 Open Data File Dialog Box Select the product dat file from the list and click Open ILOG OPL STUDIO 3 7 USER S MANUAL CREATING A PROJECT 58 ILOG OPL Studio adds the product dat file to the tree structure To load the data into the editor right click on the gray data icon then click on the Load button that appears This opens the data file in the editing area Ele Edt View Project Execution Debug Options Window Help l lxl ES TETS T
35. all the iterations View Choice Stack Inspects the entire execution stack Inspect Current Node Inspects the current choice point in the execution 32 ILOG OPL STUDIO 3 7 USER S MANUAL ILOG OPL STUDIO MAIN WINDOW Dockable GUI Elements attached to or docked at any side of its parent window In the graphic interface the following elements are dockable Menu Bar Output Area Stack window o s Tool Bar Drawing Board Inspector window 2 lt Work Space Activity Domains Window Search Tree 2 2 ao A dockable element can be detached from or floated in its own frame window or it can be ey e e Floating a Window To float a window drag it outside the Main Window by its handle materialized by double horizontal or vertical lines as shown in Figure 1 4 When the ghost frame thickens drop the window and let it float OPL Studio Col Eile Edit View _ Project Execution Debug Options Window Help 7 SP A EE A A y Gi examples stophoil mod Ek examples opl oil prj enum Gasolines enum Oils struct GasType float demand float price float octane float lead Handle A struct OilType lt float capacity float price float octane float lead 3 E Model Projects GasType gas Gasolines NilTune nilfNnilsl __ Console Solutions Optimization Log Solver CPLEX La Projectloaded Ln 1 cott
36. and the line in the file are displayed Nexampleslopl11gas mod 14 4 The second element indicates the type of error In our example syntax error The third element indicates the token that was encountered got token Components Identifier 4 The fourth element shows a list of tokens that could have been valid at that point In our example expecting token in in An OPL statement must be correct before ILOG OPL Studio will execute it You must correct any errors before running the model again Note If there are multiple errors double click on an error message to scroll the editor to the corresponding line Specifying Processing Directives The following buttons in the tool bar of the Main window can be used to indicate how to proceed in the processing of a model or project e Next Goes to the next solution of the model or project e Continue Run Forces ILOG OPL Studio to produce all the remaining solutions without further intervention e Abort Stops the current computation during execution of the model project or script After pressing the Abort button the traces of any solutions found up to that point are kept in the Output notebook Note The abort process can sometimes take a little time Terminating ILOG OPL Studio To terminate an ILOG OPL Studio session select Quit from the File menu of the Main window ILOG OPL STUDIO 3 7 USER S MANUAL THE TEXT EDITOR The Text Editor The
37. before the algorithm terminates without reaching optimality The value can be any positive integer Default 2 100 000 000 194 ILOG OPL STUDIO 3 7 USER S MANUAL MIXED INTEGER PROGRAMMING Solution limit Sets the OPL parameter intSolLim Determines the number of MIP solutions to be found before stopping The value can be any positive integer Default 2 100 000 000 Strong branching candidate list limit Sets the OPL parameter st rongCandLim Controls the length of the candidate list when using the strong branching variable selection setting The value can be any positive number Default 10 Simplex iterations Sets the OPL parameter strongItLim Controls the number of simplex iterations performed on each variable in the candidate list when using the strong branching variable selection setting The value can be any positive number The default setting 0 chooses the iteration limit automatically Strong branching thread limit Sets the OPL parameter st rongThreadLim Controls the number of parallel threads used to perform strong branching Note that this parameter does nothing if the MIP thread limit is greater than 1 The value can be any positive number Default 1 Burwweiboldg o z D a gt O 3 D le 9 ILOG OPL STUDIO 3 7 USER S MANUAL 195 MIXED 196 INTEGER PROGRAMMING Tree memory limit Sets the OPL parameter treLim Sets an upper limit on the amount of memo
38. file you can execute the project right away Click the Run button E in the tool bar of the Main window Note If you happen to have other model files or other project files open in the Main window ILOG OPL Studio always gives precedence to the active project file The most recently opened project model is by default the active project You can set another project as the active one by right clicking on the new project name and selecting the option Set As Active Project ILOG OPL Studio when it executes a project analyzes the project and produces the summary information in the model browser checks for syntactic or semantic errors 4 executes the model displaying OPL Studio is running in the status bar showing the name car pr3 in the Path Name area and changing the color patch to green displays the first solution in the Solutions notebook page in the Main window enters a waiting state when the first solution is found displays Next solution in the status bar and changes the color patch to yellow paujapaild UV lt Q 3 oO y 2 pl R lt ILOG OPL STUDIO 3 7 USER S MANUAL 85 EXAMINING THE FIRST SOLUTION Examining the First Solution 86 While ILOG OPL Studio is in its waiting state you can take a look at the first solution to the car sequencing problem The slot variables are listed first The slot variables specify which car is assigned to a given slot in the assembly line You
39. i 1 n Fregs EQ Variables forall ordered c1 c2 in Cells distance c1 c2 gt 6 forall t1 in 1 nbTrans c1 t2 in 1 nbTrans c2 abs freq lt c1 t1 gt freq lt c2 t2 gt gt distance c1 c search lt forall t in Transmitters ordered by increasing lt dsize fre gt tryall f in Fregs ordered by decreasing nbOccur f freq freq t f maxFreg sum i in Freqs nbOccur i freg gt 6 E Model dB Projects a Console Solutions Optimization Log Solver CPLEX aj Stopped at instruction in 29 Col1 Waiting Figure 7 7 Main Window in Debug Mode with Stop at Choice Point Option The yellow arrow in the editor margin indicates the instruction at which execution stops Now you can display two additional windows that will help you perform your debugging task the Stack window the Inspector window ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE FREQUENCY ALLOCATION PROJECT Displaying the Stack Window Click the View Choice Stack button KA in the tool bar of the Main window ILOG OPL Studio displays the Stack window in a docked state but you can float it by clicking on its handle at the left side All the instructions executed so far appear in the Stack window After stopping at the first choice point the window looks like this 0 gt solve 0 gt forall t in Transmitters 0 gt tryall f in Fregs Figure 7 8 Stack Window Floating at the
40. indicates where to find files referenced in OPL or OPLScript code For a script that references model and data files as in Model car car mod car dat you can set this field to lt OPLDIR gt examples opl to specify where to find the car mod and card dat files The only valid separator between pathnames is a semi colon Do not use blanks 172 ILOG OPL STUDIO 3 7 USER S MANUAL SETTING MISCELLANEOUS OPTIONS For a model that references a data file as in gueens1 mod int n Akt you can set the parameter to lt OPLDIR gt examples opl to specify where to find the n txt file Path for opl file generation The pathname entered in this field indicates where op1 files are produced after generating a compiled model See Chapter 12 Generating Compiled Models OIPNIS IdO 2 O E o 9 3 N 5 a e e ILOG OPL STUDIO 3 7 USER S MANUAL 173 SETTING MISCELLANEOUS OPTIONS 174 ILOG OPL STUDIO 3 7 USER S MANUAL Mathematical Programming When customizing OPL Studio default or project options you can select options for mathematical programming OPL parameters are identical to CPLEX parameters except that OPL parameter names do not begin with a prefix and contain mixed upper and lower case characters For example the two versions of the time limit parameter are as follows tiLimit OPL CPX PARAM TILIMIT CPLEX The default values are those displayed when the Default Options
41. keyword in the model setting cplexLogFile myLogFile log Mixed integer programming In this field you select the search method to be used for mixed integer programming CPLEX MIP default Suuwe1bB01d o D D gt o 3 D O gt Solver MIP Uses an ILOG Solver search procedure by default a depth first branch and bound search with a linear relaxation Solver Uses ILOG Solver only no linear relaxation This option is valid only for integer programs and is ignored otherwise ILOG OPL STUDIO 3 7 USER S MANUAL 177 MP GENERAL 178 MIP emphasis indicator Sets the OPL parameter MIP In this field specify whether Emphasis CPLEX should use feasibility optimality or a balance between searching for feasible solutions and proving optimality The best bound choice emphasizes moving the best bound as an aggressive technique for proving optimality on extremely difficult models Most models will reach the optimal solution fastest using one of the other choices dependi ng on the user s needs The values are Balance optimality and feasibility default Emphasize feasibility over optimality Emphasize optimality ove r feasibility Emphasize moving best bound Emphasize hidden feasibles LP Method In this field you select a method to be used by OPL Studio to optimize a linear program The available methods are Dual default Primal Network Primal Network Dual Barrier
42. message OPL Studio is running appears in the status bar the name product prj appears in the Path Name area and the color patch turns to green to indicate the program is running ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING A SOLUTION TO THE MODEL When ILOG OPL Studio finds a solution it enters a waiting state and expects further instruction from you The message Next solution appears in the status bar and the color patch turns to yellow and blinks to indicate the waiting state outside kluski 66 6606 aytcidofesanollinil IAN ARAR Console Solutions Optimization Log Solver CPLEX Next solution examplestophpraduct prj waiting Figure 2 11 Next solution Message You can use this break in the execution to examine the solution in more detail N 38 2x 0 5 20 g Examining a Solution to the Model ILOG OPL Studio provides two facilities for examining the details of your model and the solutions the output notebook in the lower half of the Main window the model browser in the work space Using the Output Area When a solution to the model is found ILOG OPL Studio fills in several notebook pages in the output area These pages show the solution that ILOG OPL Studio has found optimization information if it exists log information solving statistics Solutions Notebook Page The Solutions notebook page is used to display the current solu
43. modifications to an edited file without a limit Redo Redoes what you have just undone without a limit Cut Cuts selected text Copy Copies selected text to the clipboard Paste Pastes text from the clipboard ILOG OPL STUDIO 3 7 USER S MANUAL 31 OIPNIS IdO e O lt 2 lt lt A O Q ILOG OPL STUDIO MAIN WINDOW Rebuild Browser Information Builds or rebuilds the model tree of the data structures defined in the active model or project and displays the Model Browser notebook page in the work space Run Submits the active model project or script for execution Add Remove Breakpoint Sets and removes breakpoints in the search procedure of an OPL model or script Generate Compiled Model File Generates a compiled OPL model file op1 Execution Tool Bar Buttons The execution tool bar appears after clicking the Run button El gt E PA m i a Abort Stops the current computation during execution of the model project or script After an Abort the traces of any solutions found up to that point are kept in the Output notebook Next Goes to the next solution of the model or project or to the next instruction in stepping mode or to the next choice point in stop at choice point mode Continue Run Forces ILOG OPL Studio to produce all the remaining solutions without further intervention Step Out Steps out of a loop in a script to avoid going through
44. on word Select all Ctrl a or ESC h or quadruple click quadruple click or ESC x mark whole buffer Switch editor buffers Ctrl Tab Ctrl Tab or ESC x switch to buffer Indent a region Tab on selected lines Ctrl x on selected lines or ESC x indent region Unindent a region Shift Tab on selected lines Ctrl x m on selected lines or ESC x back to indentation Indent at location Tab without any selection Tab without any selection Unindent at location Shift Tab without selection Shift Tab without selection Comment lines ESC x comment region Uncomment lines ESC x kill comment Find Ctrl f Ctrl s or ESC x search forward Find Next F3 F3 Find Previous Shift F3 Ctrl r Replace Ctrl h ESC or ESC x query replace Complete Word Ctrl t ESC or ESC x dabbrev expand Go to a specific line Ctrl g ESC g or ESC x goto line ILOG OPL STUDIO 3 7 USER S MANUAL 45 OIPNIS 1dO q e lt 2 lt lt O Q THE TEXT EDITOR 46 Customizing the Editor To customize the editor select Options gt Customize Default Options from the tool bar Then go to the Editor page in the Default Options dialog box e either by clicking on Editor in the left panel e or by using the next and previous arrows 15 in the top right corner Default Options OF ES y Constraint Programming MIP Cuts Barri
45. panels in the editing area vertically ILOG OPL STUDIO 3 7 USER S MANUAL 29 OIPNIS IdO e lt S lt y o O e ILOG OPL STUDIO MAIN WINDOW 30 Table 1 1 Commands in the Menu Bar Continued Command Description Help Contents Opens the Help window displaying the presentation page Keyword Help About OPL Studio Opens the Help window displaying the page corresponding to the OPL keyword selected in the text editor Indicates the version of ILOG OPL Studio the ILOG products used by OPL Studio and contains copyright information ILOG OPL STUDIO 3 7 USER S MANUAL E a lo le e e e ly 15 ie D uw 8 ILOG OPL STUDIO MAIN WINDOW Tool Bar Buttons The following buttons appear in the tool bar Load Project File Opens a project ILOG OPL Studio displays an Open File dialog box requesting the file name of the project you wish to open The Project dialog box then appears Close Active Project Saves and closes the active project file pr4 Load Model File Opens a model file mod in the editing area Load Data File Opens a data file dat in the editing area Load Script File Opens a script file osc in the editing area Save the Editor Content Saves the current file in the editing area Save All Files Saves all the files in the editing area Close Current Editor Closes the active file in the editing area Undo Undoes your
46. script file name in the status bar and changing the color patch to green ifthe script contains instructions of the form cout lt lt the resulting output is printed in the Console notebook page upon completion displays OPL Studio is idle in the status bar and changes the color patch to blue ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE SCRIPT The Main window now looks like this OPL Studio NS SAS File Edit View Project Execution Debug Options Window Help Bo Model bin genBin mod genBin dat import enum Colors bin Colors inport enum Components bin Components Model pro chooseBin mod int nbSol 8 while bin nextSolution do lt pro bin addh pro bin nbSo1 c bin c forall c in Components pro bin nbSo1 n c bin n c nbSol nbSol 1 1d11951d0 BUISN LL color red glass 2 produce 3 units color blue units green plastic 1 wood 2 produce 1 units Console Solutions Optimization Log Solver CPLEX aj Idle texampiestopnseriptstvel Figure 11 2 Execution of the vellino osc Example ILOG OPL STUDIO 3 7 USER S MANUAL 235 STEPPING IN A SCRIPT Stepping in a Script ILOG OPL Studio offers you the possibility of interactively executing a loaded script step by step This facility is useful for debugging a script To Step to the First Instruction Now that the script vellino osc is open select the option Stepping in Script
47. search part of the model we use Drawing Board methods to draw We can bind data or variables to the method parameters search Drawing the large square b rectangle 0 0 112 112 2 Drawing the small colored squares using variables and data forall i in Squares b filledRectangle x i start y i start size i size i 1 colors i b rectangle x i start y i start size i size i 1 y setTimes x setTimes y 120 ILOG OPL STUDIO 3 7 USER S MANUAL THE SQUARE EXAMPLE For instance the large square which is pure constant data is drawn using the following instruction b rectangle 0 0 112 112 2 The small squares whose locations depend upon variable values use two variables for x y location and data for height width and colors Load the model squaregr mod into OPL Studio then click on Run to execute it U lt E D 3 5 Q a 2 D lt Drawing Board xi By clicking on Continue Run you will see the search for solutions As soon as a location is found for a square that is its x and y are bounded variables the square is drawn When backtracking occurs the square is cleared By default the drawing board is docked but you can choose to have it automatically undocked Before executing a model uncheck the Docked option in the Advanced page of the Options dialog box see page 171 You can specify a width a height and a scaling factor between 0 0 and 2 0 when you initialize the dr
48. that you can look at another way of using the debug feature Click the Abort button ILOG OPL Studio returns to its idle state Notice that the model browser collapses and the Stack and Inspector windows are closed Next you are going to see how the Stepping option of the debug feature works Executing the Project with the Stepping in Model Option 142 The Stepping in Model option from the Debug menu allows you to follow the execution of the model more closely by looking at each instruction The difference between the Stepping in Model option and the Stop at Choice point option is as follows When you use Stop at Choice Point you see only the values that were actually assigned during the execution When you use Stepping in Model you see all the values that ILOG OPL Studio tries to assign during the execution including the ones leading to failures With the Stepping in Model option you can see a more detailed view of the execution Go to the Debug menu and deselect the Stop at Choice Point option then select the Stepping in Model option Now click the Run button E to execute ILOG OPL Studio in debug mode ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE PROJECT WITH THE STEPPING IN MODEL OPTION When ILOG OPL Studio stops at the first instruction the Main window looks like this OPL Studio OL x File Edt View Project Execution Debug Options Window Help SGe Sha E 143 ACTES
49. the OPL parameter reduce Determines whether primal reductions dual reductions or both are performed during preprocessing The value can be No primal and dual reductions Only primal reductions Only dual reductions Both primal and dual reductions default ILOG OPL STUDIO 3 7 USER S MANUAL MIXED INTEGER PROGRAMMING Mixed Integer Programming There are four notebook pages for mixed integer programming MIP MIP Strategy MIP Limits MIP Tolerances MIP Cuts MIP Strategy Default Options olx Constraint Programming Constraint Prog MP General Simplex Preprocessing MIP Strategy me Limits Mathematical Programming MP General Best bound interval 7 Simplex o RISE Preprocessing Heuristic freguency 0 Mixed Integer Programming Priority order generation m MIP Limits Do not generate a priority order ne Use MIP priority information lv MIP Tolerances MIP Cuts Branching direction Probe strategy Parner Automatically determined s Automatic y Network E Graphical User Interface Starting LP algorithm Node presolve selector Editor Output Controlled by Ipmethod parameter y Automatic v Ad d a Sub problem LP algorithm Dive type Miscellaneous Automatic ge Automatically determined Node selection strategy Best boundsearch H RINS heuristic 0 v Variable selection strategy Branch variable automatically selected y OK Apply Cancel
50. the Project File 1 0 0 0 cece tte 83 Loading the Dali eee See ae ee od ee ee ees 83 Executing the Project ccc e eee eee eee a eee eee 85 Examining the First Solution ss 2 2 2ul adiantumid Dee eee ees 86 Copying the Results Matrix to a Spreadsheet 0 0 0c cece eee eee eee 88 Continuing the Execution 0 0 cece eee eee eee 88 Looking at the Model Structure 0 0c cece eee eee eee eee eee 89 Using Dynamic Display with ILOG OPL Studio o0oooooooommomommooo 90 Closing the Project oiooiocisiorios toka aiaa ee eae ee e a 92 Tutorial Examining the Solution to a Scheduling Problem 93 The House Building Example annan uaenne nan nne nun nunnana 94 Opening the Model Files 1 53 4 25 11458 27 seine eta aa aasa a AoE ELNA EK E eae 95 Looking at the Model Structure uenennununnuennnnanua 96 Executing the Model ennnnuanuanuannan nan una nen eee 98 Examining the Solutions seenen Antal knee ae 100 Looking at the Activities Results ereereneee 100 Looking at the Resources ResultS 00000 tees 107 The Optimization Notebook Page 0 cece teen eee 109 The Solver Notebook Page 0c cect tet 109 Completing the Execution enenennunennnnnnnnanenena 110 Closing the Model File unenennunununannenanenene 111
51. the amount of variable probing to be performed on a problem Probing can be both very powerful and very time consuming Setting the value to 1 can result in dramatic reductions or dramatic increases in solution time on particular models The value can be No probing Automatic default Probing level 1 Probing level 2 Probing level 3 Node presolve selector Sets the OPL parameter pres1Nd Indicates whether node presolve should be performed at the nodes of a mixed integer programming solution Node presolve can significantly reduce solution time for some models The default setting is generally effective at determining whether to apply node presolve although runtimes can be reduced for some models by turning node presolve off The value can be No node presolve Automatic default Force node presolve ILOG OPL STUDIO 3 7 USER S MANUAL MIXED INTEGER PROGRAMMING Dive type Sets the OPL parameter diveType to determine the MIP dive strategy The MIP traversal strategy occasionally performs probing dives where it looks ahead at both children nodes before deciding which node to choose The values are Automatically determined default Traditional dive Probing dive Guided dive The default setting lets CPLEX choose when to perform a probing dive The option Traditional dive directs CPLEX never to perform probing dives Probing dive to always perform probing dives and Guided dive to spend more time exploring potential soluti
52. the chessboard Click one more time on Next The next choice tried is queens 2 1 ILOG OPL STUDIO 3 7 USER S MANUAL A BASIC EXAMPLE WITH THE EIGHT QUEENS PROBLEM A ChoicePoints 3 Failures 0 Solutions 0 var int queens 1 8 in 1 8 solve forall ordered i j in 1 8 lt queens i lt gt gueens j queens i i lt gt queens j j queens i i lt gt gueens j j search lt forall i in 1 8 tryall v in 1 8 queens i v Ri gt solve z 2 gt queens 2 1 forall iin 1 8 tryall w in 1 8 queens 1 1 tryallt vin 1 8 gt gueens 2 1 Optimization Log Solver CPLEX queens 4 Because the value 1 has already been removed from the domain of the variable queens 2 this second choice leads to a failure Click once more on Next The previous blue node is now red and a brother node representing the choice of the value 2 for the same variable is to be explored Click Next two more times You will notice that the value 2 has already been removed from the queens 2 variable so this choice leads to a failure too However the value 3 is in the domain of the variable The constraint propagation that follows does not lead to a failure Other variables see their domain reduced by the propagation algorithm ILOG OPL STUDIO 3 7 USER S MANUAL 125 po y U 0 os sc O Qe _ 9 5 es gt gt
53. the name of the resource as a character string The MAX and MIN Tables The tables MAX_EF MAX_NF MIN_AF MIN_NF MIN_SF store data describing the temporal constraints imposed on the different tasks involved in the project Each table contains three columns Before After Distance The first two columns store the names of tasks while the third column stores an elapsed number of days Depending on the table each row is interpreted as a specific temporal constraint imposed on the start times and or the end times of the tasks indicated For example the data stored in the table MAX EF corresponds to the constraint stating that the time between the completion of a particular formwork and the completion of its corresponding concrete foundation is at most four days Windows XP Windows 2000 Windows NT 4 and Windows 98 Figure 10 2 shows an example table MAX_EF as seen from Microsoft Access E MAX_EF Table OP x Record 14 7 gt orp of 7 Figure 10 2 The MAX_EF Table ILOG OPL STUDIO 3 7 USER S MANUAL THE DATA TABLES UNIX Here you can see the contents of the table MAX_EF as reported by the select command in the SQL shell SQL gt select from MAX EF BEFORE AFTER DIST s1 b1 4 s2 b2 4 s3 b3 4 s4 b4 4 s5 b5 4 s6 b6 4 6 rows selected The Precedence Table The table Precedence indicates the precedence relationships that must e
54. then pressing the Delete button on the keyboard UNIX If you are working with Oracle on UNIX you can view the contents of the table Result by typing the select command at the prompt of the SQL shell SQL gt select from Result You will see 46 rows selected If you want to rerun the example remove the table Result from the Oracle database by typing a drop command at the prompt of the SQL shell SOL gt drop table Result 228 ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE BRIDGE EXAMPLE Consulting the Result From Another Model It is not mandatory to have Microsoft Access installed on your computer in order to view the contents of the table Result As an alternative you can type the following OPL instructions in a new model file DBconnection db odbc abridge connect to the database struct Schedule string task int startTime int endTime 5 Schedule see from DBread db select from Result read the table Result DBexecute db drop table Result remove the table from the database solve display see display the result Code Sample 10 3 OPL Instructions to View the Results Table Upon execution of this new model file the set see will be displayed by OPL Studio in the Solution notebook page You can also examine the set see from the data structure tree built in the model browser ILOG OPL STUDIO 3 7 USER S MANUAL 229 A o oZ 2 9 a 2 5 go 2 o z gt o
55. this example you will learn how to create a project and associate a model file and a data file with the project execute the project display and examine the results of the solution use the model browser close the project file with its associated model and data file work with several projects For this part of the tutorial you will need the product mod and product dat files from your release distribution If you used the default directories at installation time you will find these files at the following location For UNIX systems lt installation directory gt OPLSt37 examples opl For Windows XP Windows 2000 Windows NT 4 and Windows 98 c ILOG OPLSt37 examples opl ILOG OPL STUDIO 3 7 USER S MANUAL 51 THE PRODUCTION PLANNING EXAMPLE The Production Planning Example The first example centers around the production planning model that appears in Chapter 2 of the ILOG OPL Studio Language Manual The problem is described as follows To meet the demands of its customers a company manufactures its products in its own factories inside production or buys the products from other companies outside production The inside production is subject to resource constraints each product consumes a certain amount of each resource In contrast the outside production is theoretically unlimited The problem is to determine how much of each product should be produced inside the company and how much outside while
56. variable is mapped to an interval showing the lower bound and the upper bound The execution narrows the interval Holes in the domain are not shown display boolean each variable is mapped to a colored cell This is useful for a variable whose domain is 0 1 The cell becomes blue if the domain is reduced to 1 and beige if the domain is reduced to 0 For this example select display boolean A check mark appears to the left of the option indicating that it is selected as shown in Figure 3 8 ILOG OPL STUDIO 3 7 USER S MANUAL USING DYNAMIC DISPLAY WITH ILOG OPL STUDIO Workspace x a examples opl car prj OR Data i Y nbCars nbOptions nbSlots demand option capacity optionDemand 1 1 Options o Lan Slots AQ Variables Q slot display domain display value E Model 5 Proj display interval v display boolean Figure 3 8 Selecting a Dynamic Display Option Now execute the project again to see the dynamic display Click the Run button E in the tool bar This time as it executes ILOG OPL Studio opens a setup notebook page in the output area of the Main window It displays the setup results in a matrix Because you selected display boolean from the pop up menu each Boolean is displayed in a colored cell During the search for a solution the matrix is updated in real time The cells appear gray or colored depending on the value the corresponding Boolean receives A g
57. will see the support of discrete resources A discrete resource is a resource with a capacity The capacity which may vary over time represents the number of available instances of the resource In this example a discrete resource is used to model the budget for building the house In planning the construction of the house there are a certain number of activities that must be performed each with a certain duration and some that must be completed before others can be started The table below lists each activity its duration in days and the activities that must precede it Name Duration Preceding Activities masonry 7 carpentry 3 masonry plumbing 8 masonry ceiling 3 masonry roofing 1 carpentry painting 2 ceiling windows 1 roofing facade 2 roofing plumbing garden 1 roofing plumbing moving 1 windows facade garden painting In addition to the time constraints there are constraints concerning the budget for this house Each activity requires the payment of an amount of money proportional to the duration of the activity This amount to be paid at the beginning of the activity is set to 1 000 per day The total budget is 29 000 which is 1 000 times the sum of the duration of the project activities Only 20 000 is available at the beginning of the project the remaining 9 000 is ILOG OPL STUDIO 3 7 USER S MANUAL OPENING THE MODEL FILE available 15 days after the be
58. xenuaneunennnunennnna 139 Stack Window at Second Choice POiMt occocococncn nunnu 140 Inspector Window at Second Choice POilMt oocoocooocornrer nunnu nen 140 Stack Window at the Fourth Choice Point nrnuenaenunnnenannunenn unune 141 Inspector Window at the Fourth Choice Point xenuenunnuaeuaennn annan anu 141 Main Window in Debug Mode with Stepping Option enuunenenannuneuennnnna 143 Stack and Inspector Windows at First Instruction of Stepping Option nunenanns 144 Stack and Inspector Windows at Second Instruction of Stepping Option enas 145 Stack and Inspector Windows at Sixth Instruction of Stepping Option enunnenes 146 Order of the Search Tree Exploration with the Default Depth First Search 147 Part of the Search tree Exploration Order with the SBS 00 aa naa eua nunnana naa 151 Main Window After Leaving Debug Mode oocooccccnocn nun nunna 152 Search Tree and Objective Bounds after One Choice using Solver without Linear Relaxation 155 Search Tree without Linear Relaxation after 14 Next Commands ennnnuuennnns 156 Search Tree after One Choice using Solver with Linear Relaxation at Each Node 157 Search Tree with Linear Relaxation after 14 Next commands enennununnnnnna 159 Exploring the Search Tree in the Slice Based Search ne eee nunn nunna
59. you used the default directories at installation time you can find the bridgebr prj file at the following location For UNIX systems lt installation directory gt OPLSt37 examples opl scheduler For Windows XP Windows 2000 Windows NT 4 and Windows 98 c ILOG OPLSt37 examples opl scheduler To select the display domain option 1 Open the bridgebr prj file 2 Browse the model 3 Right click on activity a and select the option display domain To execute the model 1 Select Debug gt Stop at Choice Point 2 Click Run To observe the algorithm animation 1 The activity domains appear after the initial propagation then the search begins 2 Click 5 times on Next 116 ILOG OPL STUDIO 3 7 USER S MANUAL THE BRIDGE EXAMPLE 3 Place the mouse pointer over the 11th task A tooltip appears with the activity name als1 Activity Domains x To zoom in on the a s1 activity 1 Enlarge the Activity Domains window to the required size 2 Click on the zoom mode selector in the vertical tool bar 3 Place the cursor in the main part of the window hold down the left mouse button and trace a rectangle around the a s1 activity Then lift your finger off the mouse button Buinpayos s 42 he Q o U lt gt Q a pl EN lt ILOG OPL STUDIO 3 7 USER S MANUAL THE BRIDGE EXAMPLE 118 4 The a s1 activity fills the enlarged window Start End Min Min I Because of the
60. 1006 Relative MIP gap tolerance 1e00 Integrality tolerance 1005 Upper cutoff tolerance e05 Lower cutoff tolerance 1e 075 Absolute objective difference cutoff be 000 Relative objective difference cutoff be 000 0 0009 Backtracking tolerance Miscellaneous OK Apply Cancel Reset Absolute MIP gap tolerance Sets the OPL parameter epAGap Defines an absolute tolerance on the gap between the best integer objective and the objective of the best node remaining When the difference falls below the value of the this parameter the MIP optimization is stopped The value can be any positive number Default 1e 26 Relative MIP gap tolerance Sets the OPL parameter epGap Defines a relative tolerance on the gap between the best integer objective and the object of the best node remaining When the value lbestnode bestinteger X le 10 lbestintegerl falls below this value the MIP optimization is stopped The value can be any number between 0 and 1 Default le 198 ILOG OPL STUDIO 3 7 USER S MANUAL MIXED INTEGER PROGRAMMING Integrality tolerance Sets the OPL parameter epInt Specifies the amount by which an integer variable can be different from an integer and still be considered feasible The value can be any number between le and 1 Default 10 Upper cutoff tolerance Sets the OPL parameter cutUp Used on a minimization problem to cuts off any nodes that have an objective v
61. 32 Inspect Current Node 32 Load Data File 31 Load Model File 31 Load Project File 31 Load Script File 31 Next 32 40 71 Paste 31 Rebuild Browser Information 32 Redo 31 Run 32 Save All Files 31 Save and Close Project 31 Save Editor Content 31 Step Out 32 Undo 31 View Choice Stack 32 C car seguencing tutorial car dat file 82 car mod file 80 car prj file 83 closing the project file 92 continuing the execution 88 displaying variable results 91 dynamic display 90 examining the solution 86 executing the project 85 looking at the model structure 89 Main window 84 opening a project file 83 problem description 80 Cascade command 29 changing colors 168 changing fonts 167 264 ILOG OPL STUDIO 3 7 checking for errors 39 choice point 29 32 66 128 136 139 142 146 154 160 choice point in bridgebr example 116 choice stack 124 Choice Stack command 28 cligues parameter 201 245 Close Current Editor button 31 Close Current Editor command 26 Close Project command 28 CloseActive Project command 26 closing models 111 closing projects 74 92 closing the active file 31 coeRedInd parameter 186 245 Color Chooser dialog box 168 color patch setting the blink option 171 colors changing 168 comments 168 editor 168 error 168 label 169 OPL keywords and functions 168 OPLScript 168 options 169 commands Debug Add Remove Break Point 29 Display Search Tree 29 Stepping in Model 29 Stepping in Script 29 Stop at Choice Poi
62. 385 Console Solutions Optimization Log Solver CPLEX totalCost La Next solution Ln 47 Colt Waiting 16 Click one more time on the Next button This time the search explores fewer nodes and backtracks sooner to the root children pruning the other potential nodes The pruned nodes are not displayed Compare this to the previous tree obtained without the linear relaxation This time because you know that the lower bound of the objective value is 385 in the subtree beginning at the root s first child it is unnecessary to search for a better solution than the third solution found Objective Value 385 So Solver prunes this subtree and explores the brothers of the root s first child 158 ILOG OPL STUDIO 3 7 USER S MANUAL COOPERATING SOLVERS COMBINED LP AND CP Search Tree XI Choice Points 12 Failures 10 Solutions 3 Pru Figure 7 24 Search Tree with Linear Relaxation after 14 Next commands po y U 0 os sc O Qe 9 5 a gt gt ILOG OPL STUDIO 3 7 USER S MANUAL 159 EXPLORATION STRATEGY DRAWING BOARD COMBINED WITH SEARCH TREE Exploration Strategy Drawing Board Combined with Search Tree In this section you will visualize simultaneously the search tree and a 2D graphic representation of the choices made by the algorithm at each search node 1 160 Open the file xamples opl eulergr mod Select the following options from the Debug menu
63. 7 USER S MANUAL Parameter Name a and Description Type Possible Values Default Page MIPOrdType int 0 Do not generate a priority order 0 190 1 Use decreasing cost 2 Use increasing bound range MIP priority order generation 3 Use increasing cost per coefficient count MIPThreads int 0 Determined by global thread default 0 197 gt 0 Upper limit on threads for Parallel MIP MIP thread limit MIRCuts int 1 Do not generate MIR cuts 0 204 0 Automatically determined MIP MIR mixed integer 1 Generate MIR cuts moderately rounding cut indicator 2 Generate MIR cuts aggressively netEpOpt float Any number from 1e 4 to 1e 11 1e 6 210 Network optimality tolerance netEpRHS float Any number from 1e 4 to 1e 11 1e 6 210 Network feasibility tolerance netFind int 1 Extract pure network only 2 210 2 Try reflection scaling Simplex network extraction 3 Try general scaling level netItLim int Any non negative integer 2 100 000 000 210 Network simplex iteration limit netPPrilnd int 0 Automatic 0 209 1 Partial pricing 2 Multiple partial pricing Network simplex pricing 3 Multiple partial pricing with sorting algorithm nodeFilelnd int 0 No node file 1 197 1 Node file in memory and compressed 2 Node file on disk MIP node storage file indicator 3 Node file on disk and compressed nodeLim int Any non negative integer 2 100 000 000 194 MIP node limit ILOG OPL STUDIO 3 7 U
64. 7 Solver Constraints 5 Variables Solver memory 163548 Failures 0 Choice points 0 Solving time 0 02 Console Solutions Optimization Log Solver CPLEX Next solution Ln 1 Colt Waiting Figure 2 14 Solver Notebook Page for product prj Example ILOG OPL Studio reports the following statistics in the Solver notebook page 4 Constraints the number of constraints it received ILOG OPL STUDIO 3 7 USER S MANUAL 65 EXAMINING A SOLUTION TO THE MODEL 66 9 2 Solving time Variables the number of variables received Solver memory the amount of memory used e computation time on UNIX platforms e elapsed time computation plus graphics display on PCs In our example the number of choice points is zero since ILOG Solver s constraint programming search is not used here product prj is a pure LP model CPLEX Notebook Page Failures the number of failures encountered during the resolution Choice points the number of choices needed to produce the solution F Primal Phase Dual Phase 1 Barrier MIP Infeasibility Po Infeasibility OOOO Primal objective Nodes Iterations tis Iterations Nades left m Primal Phase r Dual Phase E 1 Dual objective METEORO Objective Objective 3 72e 002 Iterations Iterations 0 Iterations Best m Primal Crossover Dual Crossover Bound Push Push Constraints Constraints 5 Cutoff Exchange
65. 7 units and is completed at time 7 Carpentry begins at time 7 has a duration of 3 units and is completed at time 10 El g Optimal Solution with Objective Value 21 8 7 gt 7 7 3 gt 18 7 8 gt 15 15 3 gt 18 18 1 gt 11 18 2 gt 28 11 1 gt 12 15 2 gt 17 15 1 gt 16 28 1 gt 21 Console Solutions Optimization Log Solver CPLEX Activities _Sorted Activities ja ex son solution i Col 1 Waiting Figure 4 4 Activities Results for house2 mod Example ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING THE SOLUTION Using the Model Browser To get another view of the results of the Activities go to the Model browser and double click the a entry in the Activities folder ILOG OPL Studio first displays the following panel that essentially shows the results in the same format as shown in the Solutions notebook page You will need to move the Gantt chart as it is displayed on top of the activities results Solution 1 a Uu 722 13 igh eh Sees allah ra Ses 18 15 18 10 11 18 20 pir 12 15 17 15 16 Figure 4 5 Alternative View of Activities Results for house2 mod Example ILOG OPL Studio also displays a Gantt chart representation of the activities The horizontal scale shows the total duration of the project that is 21 units The vertical scale on the left side of the wi
66. CLE_HOME nfs oracle 8 solaris e Use the SQL statements from the file lt installation directory gt OPLSt37 examples opl database obridge sql in order to load the data for the example into your database For example you can launch the SQL shell SORACLE_HOME bin sqlplus then type SQL gt obridge sql e Ensure that the environment variable LD_LIBRARY_PATH contains both the path SORACLE_HOME 1ib and the path lt installation directory gt OPLSt37 bin A ME 2 9 a 2 5 go 2 a z gt o ILOG OPL STUDIO 3 7 USER S MANUAL 217 THE DATA TABLES The Data Tables The data for the Bridge example is stored in nine relational tables MAX_EF MAX_NF MIN_AF MIN_NF MIN_SF Precedence Requirements Resource Task Windows XP Windows 2000 Windows NT 4 and Windows 98 218 Provided that you have Microsoft Access installed on your computer you can view the contents of any of these tables by simply double clicking from Windows Explorer on the file c ILOG OPLSt37 examples opl database abridge mdb Microsoft Access opens the database and displays the tables in alphabetical order Double click on the table whose contents you want to see gE abridge Database Jof x El Tables EH Queries E Forms B Reports Macros Modules MAX EF Open MAX_NF pun MIN AF MIN_NF New MIN_SF Precedence Requirements Resource Task E UNIX If you are workin
67. CUTING THE PROJECT Executing the Project 62 As the project file product pr3 is now open you can execute the project and find the solution Click the Run button E in the tool bar of the Main window You will notice that the execution tool bar is displayed Note ILOG OPL Studio always gives precedence to the active project If you have other models scripts or projects open in the Main window the model of the active project always gets executed To switch to another model project or script right click on it in the project tree and select the menu item Set As Active When you execute a project you trigger a chain of events ILOG OPL Studio first analyzes the model and produces summary information Click on the tab Model to display the model browser in the Workspace window This browser contains information about the data structures defined in the model The model browser is described in Using the Model Browser on page 67 Workspace x E examples opl product prj E a Type 123 Products 1 412 Resources El 8 Data fm 9 product Y capacity a a Variables pu Y inside 9 outside YE Model gt Projects Figure 2 10 Model Browser for product prj Example ILOG OPL Studio also checks for syntactic or semantic errors at this time If 1t finds errors it stops the execution and the errors must be corrected See Checking for Syntactic or Semantic Errors on page 39 ILOG OPL Studio then executes the model The
68. Click on Abort to stop the search Comment the keywords with linear relaxation minimize with linear relaxation totalCost Run the program again This time the tree is much bigger Click on Abort In the Debug menu select Stop At Choice Point and Stop At Solution In the Execution menu select Browse Active Model In the Model Browser Notebook Page right click on the totalCost variable and select the option display domain Run the program again Select View gt Choice Stack or click on the corresponding item on the execution tool bar The root of the tree appears The domain of the objective is 0 1000 Double click on the tota1Cost item inside the model browser You can keep a snapshot of the domain s current state ILOG OPL STUDIO 3 7 USER S MANUAL COOPERATING SOLVERS COMBINED LP AND CP 10 Click once on Next You see the domain of the objective reduced to 41 1000 in the lower notebook Double click on the totalCost item inside the model browser You can keep another snapshot of the domain s current state xa ChoicePoints 2 Failures 0 Solutions 0 4 Prur gt Solution 1 Op xf Names DELE Solution 1 Names po y U 0 os sc fto Qe bo IN 9 5 a gt gt Figure 7 21 Search Tree and Objective Bounds after One Choice using Solver without Linear Relaxation 11 Now click on the Next button six more times You will see OPL finding solutions an
69. Customize Default Options 76 ILOG OPL STUDIO 3 7 USER S MANUAL WORKING WITH SEVERAL PROJECTS Two References to the Same File You can open two projects standalone models or scripts that reference the same file Workspace Ed E B examples opl carsmall prj ioe car mod i ji carsmall dat B B Aexamplestopltcar pri N 3 2x 0 5 20 ong Ye Model 1 Projects In the figure above the file car mod is referenced by two different projects carsmall prj and car prj ILOG OPL STUDIO 3 7 USER S MANUAL 77 WORKING WITH SEVERAL PROJECTS 78 ILOG OPL STUDIO 3 7 USER S MANUAL Tutorial Predefined Dynamic Display In this chapter you will see how ILOG OPL Studio handles a basic constraint model with constraint programming constructs Using the car sequencing example you will pauljapaid E open a project file with its associated model and data files i lt Q 3 e y 4 pl o lt load the data into the editor execute the project display and examine the results of the model solution noting how ILOG OPL Studio displays the variables of a solution complete the model execution by searching for all solutions to the problem generate summary information in the model browser and select dynamic display re execute the project using dynamic display to view solutions For this part of the tutorial you will need these from your release dist
70. DEX priceLim parameter 182 251 probe parameter 192 251 proceeding through executions 71 processing directives 40 71 production planning tutorial alternative data file 73 closing the project file 74 continuing the execution 71 creating the project 54 59 displaying results 70 editing area with model file 56 examining the solution 63 executing the project 62 Main window after executing 72 Main window with data file 58 Optimization notebook page 64 problem description 52 product dat file 53 product mod file 52 product prj file 59 Solutions notebook page 63 Solver notebook page 65 Project menu Add New Data File 28 Add New Model File 28 Browse Model 28 Close Project 28 Insert Existing Data File 28 Insert Existing Model File 28 Project Options 28 Save the Project 28 Save the Project As 28 Set as Active Project 28 Project Options command 28 Project Options dialog box 60 project options setting 60 61 project tree description 23 54 displayed in workspace 74 for alloc prj 133 for car prj 83 projects adding existing data files 57 adding existing model files 55 adding new data files 58 272 ILOG OPL STUDIO 3 7 adding new model files 58 closing 74 92 creating 54 59 executing 62 85 137 142 opening 83 Projects page 133 projects description 35 Q Quit command 26 R reading from a database 224 Rebuild Browser Information button 32 Recent Files command 26 Recenter comman
71. Determines whether or not to generate flow cuts for the problem Setting the value to 0 the default indicates that the attempt to generate flow cuts should continue only if it seems to be helping The value can be one of the following Do not generate flow cuts Automatically determined default Generate flow cuts moderately Generate flow cuts aggressively GUB covers Sets the OPL parameter gubCovers Determines whether or not to generate GUB cuts for the problem Setting the value to 0 the default indicates that the attempt to generate GUB cuts should continue only if it seems to be helping The value can be Do not generate GUB cuts Automatically determined default Generate GUB cuts moderately Generate GUB cuts aggressively Implied bound cuts indicator Sets the OPL parameter imp1Bd Determines whether or not to generate implied bound cuts for the problem Setting the value to 0 the default indicates that the attempt to generate implied bound cuts should continue only if it seems to be helping The value can be Do not generate implied bound cuts Automatically determined default Generate implied bound cuts moderately Generate implied bound cuts aggressively ILOG OPL STUDIO 3 7 USER S MANUAL MIXED INTEGER PROGRAMMING MIP Gomory fractional cuts indicator Sets the OPL parameter fracCuts to determine whether or not Gomory fractional cuts should be generated The value can be 1 Do not generate Gomory fractional
72. Display Search Tree Stop At Choice Point Stop At Solution Click on the Run button and click on the Next button several times You can visualize the selected knight moves on the chessboard created simultaneously in the Drawing Board panel and the explored Search Tree First notice that you have access to a binary tree The basic one produced by ILOG Solver The n ary tree is available only if you define the choice points yourself with the try or tryall instructions in the search procedure To understand what happens at each choice point take a look at the Drawing Board Click on the Continue Run button and observe the yellow arrow exploring the tree in a Depth First Search strategy The white nodes are the nodes created by ILOG Solver and not yet visited Click on the Abort button Select Customize Default Options from the Options Menu Select the Constraint Programming page and select the Slice Based Search as the search strategy Deselect Stop At Choice Point and Stop At Solution Run the example again This time you see the yellow arrow jumping in the tree and leaving some white nodes behind it These white nodes are left unvisited for the moment They will be visited or pruned later ILOG OPL STUDIO 3 7 USER S MANUAL EXPLORATION STRATEGY DRAWING BOARD COMBINED WITH SEARCH TREE Search Tree Choice Points 74 4 Failures 14 Solutions 16 4 Prunednodes 0 The white dots represent unexplored
73. E examples opl product prj enum Resources 4 struct ProductData lt Me jan float demand DS Eneas float insideCost ata float outsideCost 3 moe float consumption Resources we capacity 3 Variables inside ProductData product Products E 9 outside float capacity Resources var float inside Products var float outside Products X Projects gt Figure 2 17 Open View Button ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING A SOLUTION TO THE MODEL When you double click an entry in the tree ILOG OPL Studio displays an additional view for that entry and highlights the corresponding declaration in the text editor The presentation of the object s content depends on the type of object displayed For example if you double click Product s in the Type folder ILOG OPL Studio displays the following view Solution 1 Products P E3 t kluski capellini fettucine N 38 2x 0 5 20 g If you double click Resources under Type you will see a similar display with the defined resources If you double click product in the Data folder ILOG OPL Studio displays the following Solution 1 product Piel EG lt demand 100 000000 insideCost 0 61 ILOG OPL STUDIO 3 7 USER S MANUAL 69 EXAMINING A SOLUTION TO THE MODEL If you double click capacity under Data ILOG OPL Studio displays the following Solution 1 capacity 104 FA Indices flour As you
74. E IJSEETET TAS TIEA EE enum Products enum Resources eb noname ptj E Aexamplestopiiproduct mod struct ProdyctData lt ProductData product Products 5 float capacity Resources var float inside Products var float outside Products minimize sum p in Products product p insideCostxinside p reel product p outsidetostx outside p x YE Model GB Projects Figure 2 6 Loading Data into a Project You can create a project without loading the data file into the editor This feature is useful if you have a large data file that takes a long time to load Adding New Files to a Project If you create a new model file or data file and want to add it to a project click on the project name and select as appropriate Add New Model File Add New Data File ILOG OPL STUDIO 3 7 USER S MANUAL CREATING A PROJECT Saving the Project OPL Studio Ele Edt View Project Execution Debug Options Window Help Bi Es PBOSSBLEUGR coa ta EF Ej dexamplestopiiproductmod P a coa enum Products jee 16 Add New Model File BE o piproductdat E Add New Data Fie f chap 2 statement 2 8 g Insert Existing Model File Insert Existing Data File Products amp Save the Project Resources flour eggs gt Save the Project As product kluski lt 166 6 6 Th Close Project llini lt 200 6 capellin
75. Exchange Variables Duat phase 0000000 Console Solutions Optimization Log Solver CPLEX Figure 2 15 CPLEX Notebook Page for product prj Example This page shows CPLEX statistics Here in dual phase II the objective is 3 72e 002 and there are 7 iterations 5 constraints and 6 variables ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING A SOLUTION TO THE MODEL Using the Model Browser To browse the active model in the work space you can choose from one of the following methods In the tool bar e Click on the button l Rebuild Browser Information e Select Execution gt Browse Active Model In the model browser right click on the root item and select Browse Active Model 4 In the project tree right click on the project name and select Browse Model The model browser provides another way for you to examine the solution to your model ILOG OPL Studio displayed the model browser before 1t began executing the model and so it is visible during the execution process The model browser summarizes information about the data structures defined in the model It lists the types and constants that appear in the model as well as any variables activities or resources As you can see the following have been defined for the model product mod v as 2 D r 7 YUM BUOM Z Products and Resources in the Type folder product and capacity in the Data folder inside and outsid
76. FISO DR ANIH laix DOSSBAGK OH x be E e SET E ETL B 703 2 2 IVY 26 2 2D D 858it 2 REL Solver CPLEX PTI Ln 1 Col 1 These labels can be displayed in English by relaunching the application and adding a startup parameter 20 ILOG OPL STUDIO 3 7 USER S MANUAL LAUNCHING ILOG OPL STUDIO Switching from Japanese to English If you want to switch to the English US version you need to relaunch OPL Studio with the parameter us There are two ways of doing this In MS DOS enter the command C ILOG OPLSt37 bin oplst exe us On your Windows desktop right click on the OPL Studio shortcut and select Properties In the dialog box see Figure 1 1 do the following OIPNIS IdO e Select the Shortcut tab x O lt 2 lt 4 O Q e Inthe Target field add the parameter us This field should now contain C ILOG OPLSt37 bin oplst exe us e Click OK OPL Studio 3 7 Properties ax General Shortcut Security E OPL Studio 3 7 Target type Application Target location bin Target C ILOGS OPLSt37 bin oplst exe us I Runin separate memory space I Runas different user Start in ELO 000 Shortcut key None Run Normal window E Comment Find Target Change Icon Cancel Apply Figure 1 1 Switching from the Japanese Version to the English US Version Reading from a Database OPL cannot read a double byte string from a database Thi
77. File Add New Data File Insert Existing Model File Insert Existing Data File Save the Project Save the Project As Close Project Browse Model Project Options This menu depends on the selection made in the Project Tree When several projects are open remembers the project selected in the Project Tree as the active one Adds a newly created model file to the project Adds a newly created data file to the project Adds an existing model file to the project Adds an existing data file to the project Saves the project s options and its components Changes the name of an existing project Closes the project Builds or rebuilds the model tree of the data structures defined in the active model or project Opens the Project Options dialog box for the project Execution Browse Active Model All Solutions Run Abort Builds or rebuilds the model tree of the data structures defined in the active model or project When checked solves for all solutions during the execution Does not enter a waiting state after each solution Executes the active model project or script Stops execution of a model project or script and returns to a normal editing session After pressing the Abort button the traces of any solutions found up to that point are kept in the Output notebook ILOG OPL STUDIO 3 7 USER S MANUAL ILOG OPL STUDIO MAIN WINDOW Table 1 1 Commands in the Menu Bar Continued Comman
78. G DB Link and must have a value such as orac1e81 The complete list of possible values can be found in the README file Note Prior to using a database connection you must ensure that the corresponding database client is correctly installed on your system The second argument the connection string must comply with a format that depends on the target RDBMS For Oracle for example the format is lt user gt lt password gt E lt SQL Net id gt where the SQL Net id is lt net gt lt hostname gt lt SID gt for SOL Net V1 and lt service name gt for SQL Net V2 In the example DBconnection db oracle81 scott tiger ilog the user scott with the password tiger will connect to the Oracle database called ilog ILOG OPL STUDIO 3 7 USER S MANUAL DATABASE CONNECTIVITY The Environment Variable On UNIX systems When integrating with your application you should make the LD_LIBRARY_PATH or SHLIB_PATH or LIBPATH environment variable point to the database driver location and to the ILOG DB Link driver directory The DB Link drivers are provided in directories of the type lt OPLDIR gt lib lt platform gt lt shared format gt Details are provided in the README file ILOG OPL 3 7 isin theory independent of ILOG DB Link since it comes with all the DB Link dynamic link libraries In certain cases however DB Link drivers need to be relinked for the platform and database release that OPL needs to connect to Ple
79. G OPL Studio For Windows XP Windows 2000 Windows NT 4 Windows 98 Click the Start menu and then select Programs gt Ilog gt ILOG OPL Studio 3 7 gt OPL Studio 3 7 In Batch Mode Use the option batch in the command line For UNIX Systems Enter oplst On HP systems you must set SHLIB_PATH instead of LD_LIBRARY_PATH You need to add the shared libraries to the env variable set env SHLIB PATH usr ilog OPLSt37 lib hp32 11 3 15 shared In Batch Mode Use the option batch in the command line A configuration file op1st3 config is created in each directory from which you launch OPL Studio When you quit the application the configuration options main window setup dockable pane positions are saved in this file Each time you relaunch the GUI these options are restored and the GUI has the same appearance as the last time you used it When using OPL Studio in batch mode you need licenses for the underlying libraries as required by your model Solver Scheduler and or CPLEX opl bat launches op1st exe with the batch option and redirects the standard output to a file called result txt Then it displays this file s content and deletes it Because OPL Studio is a Windows application and not a console application you would not be able to see the output if you launched directly oplst exe batch without redirecting the standard output This is why we provide the op1 bat file When using the batch mode you must avoid interacti
80. ILOG OPL STUDIO 3 7 USER S MANUAL 5 CONTENTS Chapter 5 Chapter 6 Chapter 7 Tutorial Scheduling Specific Dynamic Display 113 The Activity Domains Wind0W ooooococccccnn nen nunnu 114 The Bridge Examples 15 45 irae avita minia aiamaja a le matat 116 Tutorial User Defined Dynamic Display e nnnes 119 The Drawing Board eee eee eee eee e enn nn 119 The Square Example nnnunnennununnuenna nan nunnana eee 120 The Map Example 00sec seen eee eee eee eee eee eee aia 122 The Euler EXaMple ase cora a a es 122 Tutorial Debugging the Search Strategy nunnu anna 123 A Basic Example with the Eight Queens Problem ne nnnnua 124 settingUp the Example sua A a 124 Executing the Models cc ocio data db ee ied ete ee 124 Continuing the Execution 1 0 0 0 cee ete eee 127 The Frequency Allocation Example 00 cece eee eee eee eee eee ene 130 Looking at the Model Structure 20 0 eee teens 135 Setting the Debug Option 0 eet teens 136 Executing the Frequency Allocation Project ooooooooomommmmmmm o 137 Displaying the Stack Window 0 0 0 0 cee et teens 139 Displaying the Inspector Window 0 cece tte eee 139 Continuing the Execution rveveerreeeneeeaeeeenea 140 Executing the Project with the Stepping in Model
81. IO 3 7 USER S MANUAL 123 po y U 0 os sc G Qe 9 5 ge gt gt A BASIC EXAMPLE WITH THE EIGHT QUEENS PROBLEM A Basic Example with the Eight Queens Problem 124 There are some preliminary steps to take before executing the model You need to modify the code and select the appropriate options Setting up the Example 1 Open the file examples opl gueens8 mod This model contains the following code var int gueens 1 8 in 1 8 solve forall ordered i j in 1 8 queens i lt gt queens j queens i i lt gt queens 3 j queens i i lt gt queens j j y Add a simple search procedure search forall i in 1 8 tryall v in 1 8 queens i v y From the Debug menu select the options Stepping in Model and Display Search Tree Browse the model by selecting the menu item Execution gt Browse Active Model Right click on the queens item in the Model notebook page and select display domain Executing the Model 1 2 Execute the model by clicking on the green Run button Open the Choice Stack and the Current Node Inspector via the View menu Click three times on the Next button You will see the yellow arrow in the editor margin pointing to the line queens i v Simultaneously the Current Node Inspector expands this choice as queens 1 1 Click one more time on Next You will see the result of the choice and of the constraint propagation on
82. L 357 ELIO y Sh OF li Code Sample 3 2 OPL Data for the Car Sequencing Example car dat ILOG OPL STUDIO 3 7 USER S MANUAL SETTING UP THE PROJECT Setting Up the Project You need to open a project file with 1ts associated model and data files and optionally load the data into the editor Opening the Project File The ILOG OPL Studio Main window should still be open from the previous tutorial If not you will need to launch it as described in Launching ILOG OPL Studio on page 18 When the Main window is open you are ready to start the car sequencing tutorial by opening the project file Select Open gt Project from the File menu or click on the corresponding button Then select car prj from the list displayed in the op1 directory ILOG OPL Studio then displays the project tree in the work space showing the names of the associated model and data files in the tree structure You can see that car mod and car dat are the files associated with car pr3 You will notice that the names car prj and car mod are highlighted in red This is to remind you that car prj is the active project and thus car mod is the active model Loading the Data You can open the project without loading the data file into the editor This feature is useful if you have a large data file that takes a long time to load For this example we will load the data file by clicking on the name of the file with the right mouse button then selec
83. LOG OPL STUDIO 3 7 USER S MANUAL The TEXT EDO TA You can switch off the error line coloring the syntax coloring and the brace matching By default the syntax coloring is automatically switched off if the file size is more than 65 KB However you can force the syntax coloring to be on or off You can switch off the automatic indentation and change the tabulation size but these two switches block the undo redo mechanism for previous commands Tabulations and indentations are handled as blanks OIPNIS IdO You can change the save preferences ey e lt 2 lt lt O Q e Save before running checked by default If checked all edited files and projects are saved before execution e Prompt before saving files unchecked by default If checked a dialog box is displayed for you to confirm that you want to save a file ILOG OPL STUDIO 3 7 USER S MANUAL 47 THE ONLINE HELP The Online Help The online help provides a quick reference to OPL and OPLScript instructions functions and methods Windows Platforms E oplhelp olx amp er Hide Back Print Options Contents Index Search OPLScript Keywords Functions 2 Operator Precedences Welcome to the ILOG OPL Studio online help system This online help provides a quick reference to the OPL and OPLScript languages t contains OPL keywords OPLScript keywords Functions used in OPL and O
84. LOG OPL Studio enrnnuuunannunnnenaennnua 18 Launching an OPL Script in Batch Mode r reeee 19 Batch Mode for OPL Models ooccccccococ ttt teen eee 19 Other Command Line Options rerrerereeeeernee 19 Japanese Localization ooooooooooornrr eee 20 ILOG OPL Studio Main Wind0W o oococccconoccn 22 Menu Bar Commands 0000 cece teen e eee 25 ILOG OPL STUDIO 3 7 USER S MANUAL 3 CONTENTS Chapter 2 Tool Bar Buttons 14114 244 iio e ad dt 31 Execution Tool Bar Buttons ooocooccococr nananana naana 32 Dockable GUI Elements cu nies Dira eed ey Dolar 33 ILOG OPL Studio Basics cuicos id aia 35 File TYB8S 0 IN A AAA Ad A ee A ed 35 Opening n Existing Files sic ip tt a ii 36 Greatingsa New Files srian tanata dl la lia akt a doe 36 Executing a Project or Model oooooooocoocoroor 38 Checking for Syntactic or Semantic Errors 1 2 0 0 0c cece eee 39 Specifying Processing Directives 0 0 0 0 cette tees 40 Terminating ILOG OPL Studio 1 0 0 ett 40 The Text Editor inicias a alin latin noel wa elles a ahaa ea 41 Switching Between Editor Windows r r r erenee 41 Resizing an Editor Window 2000 ti hoe ele we le ep al ee 42 Editor Quick Reference 2 0 0 cette eee tenet eee 43 Customizing the Editor recre neiseis a a ete eee ae 46 The Online Help oia an ie Bie
85. N md NNNOO0OODONANAIAANANIO Dei eber me A lt NANNDVDDVDONNANA AN N 0 AAA COOH ANNNA Y ANNAN AANA ALO HA foe AAA COOHANNN YD ANNNANN AHAN A HONG 0 AHAHOOOHANANIO ANNANAN AANA AO co ANNDTOCACCN ANNNNN DAA ea Aaa Aone ANNOO0O0OO0ON0 ANNNNAN o lt oooooon vw oo oo NOCOnd d oooooovo ANOS oo NOOCOdd o COONN wo HOOOOOOOOOOONNNHOOOKNrTI Ne cooNnw AND GCDODCOCOOCOOCOOF nH nH OOOnFH 00000 ANNOOD0OODOOD0OO0OOO cdd HAO OOA A Il H N Il AHO GOGON rA ANa a O O G OG G O do HNOOOOONNriririNNririooooOoo0oO0oo0ooO0 o A AHOO0O0O0O AAA AANNATHOOCONNA ASG distance Code Sample 7 2 OPL Data for the Frequency Allocation Example alloc dat USER S MANUAL ILOG OPL STUDIO 3 7 132 THE FREQUENCY ALLOCATION EXAMPLE Select Open gt Project from the File menu or click on the Load Project button in the tool bar then select alloc prj from the list and click Open The project tree showing the associated model and data files is displayed on the Projects page of the work space For this example we will load the data into the editor Workspace x a Aexamplestopltalloc prj 9 alloc mod alloc dat DB Remove from Project po y U 0 os sc O Qe 9 5 a gt gt YE Model 13 Projects Figure 7 2 Project Tree for the Frequency Allocation Example in Dockable Window ILOG OPL STUDIO 3 7 USER S MANUAL 133 THE FREQUENCY ALLOCATION EXAMPLE 134
86. NUAL List of Code Samples 1 1 Example of an OPL Statement ase ni a a nene E nen anne 37 2 1 OPL Model for the Production Planning Example product mod xneruennennana 52 2 2 OPL Data for the Production Planning Example product dat ennennenuennennnna 53 2 3 OPL Named Data for Production Planning Example productn dat exnennenunna 73 3 1 OPL Model for the Car Sequencing Example car mod annennennenuennenuaaa 81 3 2 OPL Data for the Car Sequencing Example car dat ococcccccrnronronrnarr 82 4 1 OPL Model for the House Building Example house2 mod es eee eee e eee eee eee ea 95 7 1 OPL Model for the Frequency Allocation Example with Search Procedure o ooooooooommmmo 131 7 2 OPL Data for the Frequency Allocation Example alloc dat xnennenueneenuna 132 10 1 Record Definitions in the abridge mod Fil ec eee eee eee eee eee 222 10 2 Initializing OPE Seis ns ka ell eae die tahavad ad a Salma a la ia aie ee ae 225 10 3 OPL Instructions to View the Results Table xnennennnaneenunnunna 229 ILOG OPL STUDIO 3 7 USER S MANUAL 261 CODE SAMPLES 262 ILOG OPL STUDIO 3 7 USER S MANUAL A Abort button 32 40 71 Abort command 28 active model 76 active project 74 active script 76 Activities notebook page 105 activity domains after propagation 116 Activity Domains window 114 activity domains color options 171 activity definiti
87. OG OPL STUDIO 3 7 USER S MANUAL USING AN ALTERNATIVE DATA FILE Using an Alternative Data File Here we examine an alternative way of expressing the data initialization of this problem In the product dat file the expression was a simple initialization of records OPL provides the possibility of a named initialization of records as shown in Code Sample 2 3 Products kluski capellini fettucine Resource flour eggs product kluski lt demand 100 insideCost 0 6 outsideCost 0 8 N consumption 0 5 0 2 gt y fs capellini Ke lt demand 200 0 5 insideCost 0 8 20 outsideCost 0 9 o consumption 0 4 0 4 gt fettucine lt demand 300 insideCost 0 3 outsideCost 0 4 consumption 0 3 0 6 gt li capacity 20 40 Code Sample 2 3 OPL Named Data for Production Planning Example productn dat To use this alternative data file you can open the product prj file remove the product dat file see Removing a File from a Project on page 75 and insert the file productn dat When you execute product pr3 this time with the productn dat file you should see exactly the same results as when product dat was associated with 1t ILOG OPL STUDIO 3 7 USER S MANUAL 73 CLOSING A PROJECT FILE Closing a Project File This completes the production planning example Since you are finished with the product prj file you can close it in one of three ways Select File gt Close Acti
88. OPL Studio 9 try two different exploration search strategies visualize dynamically the search strategy in the search tree This example centers around the frequency allocation problem that appears in Chapter 14 of the ILOG OPL Studio Language Manual The frequency allocation problem consists of allocating frequencies to a number of transmitters so that there is no interference between transmitters and the number of allocated frequencies is minimized This problem is an actual cellular phone problem where the network is divided into cells Each cell contains a number of transmitters whose locations are specified The interference constraints are as follows the distance between two transmitter frequencies within a cell must not be less than 16 the distance between two transmitter frequencies from different cells varies according to their geographical situations The variations are described in a matrix The problem is to assign frequencies to transmitters to avoid interference and if possible to minimize the number of frequencies Code Sample 7 1 shows the OPL model for this example The model file is alloc mod in your product distribution ILOG OPL STUDIO 3 7 USER S MANUAL THE FREQUENCY ALLOCATION EXAMPLE int nbCells de int nbFreqs range Cells 1 nbCells range Fregs 1 nbFreqs int nbTrans Cells int distance Cells Cells struct TransmitterType Cells c int t TransmitterType Transmit
89. PLScript Operators used in OPL and OPLScript and their order of precedence I The online help available on Windows platforms is based on Microsoft HTML Help To access the help you must use Microsoft Internet Explorer 4 0 or above and at least version 1 22 of the ActiveX control file HHCTRL OCX must be installed If you are unsure of what components are installed on your system you can upgrade it with the HTML Help update file hhupd exe which contains browser and software compatibility updates It is available for all languages at the following URL http msdn microsoft com library tools htmlhelp wkshp hhupd exe 48 ILOG OPL STUDIO 3 7 USER S MANUAL THE ONLINE HELP On windows platforms the online help provides the following features Integration of the entire online documentation set e ILOG OPL Studio User s Manual e ILOG OPL Studio Language Manual e ILOG OPL Studio Component Libraries User s Manual e ILOG OPL Studio Component Libraries Reference Manual e ILOG OPL Studio Release Notes OIPNIS IdO a O lt 2 lt lt O Q A link to the OPL Studio home page on the ILOG web site when connected to the Internet A link to the model library on the ILOG web site when connected to the Internet You can download a model and use it as a basis for creating your own model To access the help from OPL Studio either use the Help menu 9 or press the Fl key on a selected key
90. Previous command 27 floating a window 33 flowCovers parameter 202 247 flowPaths parameter 203 247 Font Chooser dialog box 167 fonts changing 167 options 169 fracCand parameter 196 247 fracCuts parameter 203 248 fracPass parameter 196 248 frequency allocation 140 frequency allocation tutorial alloc dat file 132 alloc mod file 130 alloc prj file 133 continuing the execution 140 executing the project 137 looking at the model structure 135 Main window 134 model browser 135 problem description 130 processing directives 141 setting the debug option 136 Stack and Inspector windows 139 G Gantt chart how to use 102 showing activities results 101 Go To command 27 GUBCovers parameter 248 gubCovers parameter 202 H Help menu Contents 30 Keyword Help 30 268 ILOG OPL STUDIO 3 7 help on keywords UNIX platforms 49 Windows platforms 48 heurFreg parameter 190 248 house building tutorial Activities notebook page 105 activities results 100 closing the model file 111 completing the execution 110 discrete resources bar chart 108 examining the solution 100 executing the model 98 house2 mod file 95 list of activities 94 looking at the model structure 96 Main window 96 Main window after execution 99 Optimization notebook page 109 problem description 94 Resources results 107 Solutions notebook page 107 Solver notebook page 109 Sorted Activities notebook page 106 implBd parameter 202 248 include files 172 Indent Lin
91. Primal Barrier Dual Barrier Solver Search e LP First Method Here you select a value to Primal default Dual Network Primal Network Dual Barrier Primal Barrier Dual be passed to the first LP solving method Select from ILOG OPL STUDIO 3 7 USER S MANUAL MP GENERAL e LP Search Method Here you select a value to be passed to the LP incremental solving method Select from Dual default Primal e Piecewise Cuts When this box is checked default the OPL parameter PiecewiseCuts is set to on If the parameter is set to off the default OPL search procedure will branch on the segments of the piecewise linear expression appearing in the problem statement If the parameter is set to on in addition to the behavior described above OPL can generate cuts to reduce the search space Memory available for working storage Sets the OPL parameter workMem Specifies an upper limit on the amount of central memory in megabytes that CPLEX is permitted to use for working files See also workDir below The value can be any positive number Default 128 Directory for working files Sets the OPL parameter workDir Specifies the name of an existing directory in which CPLEX may store temporary working files such as for MIP node files or for out of core barrier Default a dot ILOG OPL STUDIO 3 7 USER S MANUAL 179 Burwiweiboldg o z D gt O 3 D le 9 OPTIMIZATION USING SIMPLEX
92. SER S MANUAL 249 Parameter Name and Description Type Possible Values Default Page nodeSel int 0 Depth first search 1 191 1 Best bound search 2 Best estimate search MIP node selection strategy 3 Alternate best estimate search objDi float Any number 0 0 199 MIP absolute objective difference cutoff objLLim float Any number 1e 75 184 Simplex lower objective value limit objULim float Any number 1e 75 184 Simplex upper objective value limit perInd int 0 Off 0 184 1 On Simplex perturbation indicator perLim int 0 Determined automatically 0 182 or Any positive integer Simplex perturbation limit PiecewiseCuts int 0 Off 1 179 1 On Piecewise cuts indicator pPrilnd int 1 Reduced cost pricing 0 181 0 Hybrid reduced cost 8 devex pricing 1 Devex pricing 2 Steepest edge pricing 3 Steepest edge pricing with slack initial norms Primal simplex pricing 4 Full pricing algorithm preCompress int 1 Off 0 186 0 Automatic Compression of model after 1 On presolve 250 ILOG OPL STUDIO 3 7 USER S MANUAL Parameter Name and Description Type Possible Values Default Page preDual int 1 Off 0 188 0 Automatic Presolve dual setting 1 On prelnd int 0 Off 1 187 1 On Presolve indicator prePass int 1 Determined automatically 1 187 0 Do not use Presolve Presolve pass limit or Any positive integer preslNd i
93. Select a value from Reduced cost pricing Hybrid reduced cost amp devex pricing default Devex pricing Steepest edge pricing Steepest edge pricing with slack initial norms Full pricing Scale parameter Sets the OPL parameter scaInd Defines the method to be used for scaling the problem matrix Select a value from No scaling Suruwe1bB01d o z D a gt O 3 D le gt Equilibration scaling method default More aggressive scaling Final factor Sets the OPL parameter finalFactor When preprocessing changes the model prior to optimization a reverse operation uncrush occurs at termination to restore the full model with its solution With default settings the simplex optimizers perform a final basis factorization on the full model ILOG OPL STUDIO 3 7 USER S MANUAL 181 OPTIMIZATION USING SIMPLEX 182 before terminating If you turn off this parameter the final factorization after uncrushing will be skipped on large models this can save some time but computations that require a factored basis after optimization for example for the computation of the condition number Kappa may be unavailable depending on the operations performed during preprocessing If you run out of memory at the end of a simplex optimization consider turning off final factorization The values are 0 Off 1 On default Pricing candidate list size Sets the OPL parameter priceLim Determines the maximum number of variables k
94. TRUCTURE ILOG OPL Studio opens the Model browser and builds the tree of the model objects Workspace Ea ete examples opl scheduler house2 mod ES A Type io 412 Tasks AQ Data Y duration AQ Activities AQ Discrete Resources IN budget 3 Projects Figure 4 2 Model Browser for house2 mod Floating State As you can see this model has the following objects Type Tasks Data duration Activities a and Discrete Resources budget For this model you will want to pay particular attention to how ILOG OPL Studio displays the results of the activities and the discrete resources e o uonnjos y 42 e O Qa E Q U e O 3 ILOG OPL STUDIO 3 7 USER S MANUAL 97 EXECUTING THE MODEL Executing the Model 98 For this example there is only a model file The data has not been isolated in a dat file so therefore a project file pr3 and a data file dat do not exist You are going to be executing only the model file house2 mod Note Make sure that house2 mod is the active model The name should appear in red on the Projects notebook page If this is not the case right click on the name and select Set As Active Model Click the Run button E in the tool bar of the Main window In the same manner as when executing a project ILOG OPL Studio analyzes the model and if not already done produces the summary information and updates the Model browser checks fo
95. UAL 37 OIPNIS 1dO O lt 2 lt a F O Q ILOG OPL STUDIO BASICS 38 When you finish the editor looks something like this OPL Studio noname mod olx File Edt View Project Execution Debug Options Window Help 18 xl 028504 22 x RO En S AN var float gas var float chloride inoname mod maximize 46 gas 56 chloride subject to lt gas chloride lt 58 3 gas 4 chloride lt 186 chloride lt 46 YE Model Projects Figure 1 9 Simple OPL Statement in the noname mod file You can now save your model under another name From the File menu select the Save As option ILOG OPL Studio displays a standard Save As dialog box for you to supply the new file name When you save your file the new name appears in the title bar of the Main window You can now perform other tasks as required for this new working document Executing a Project or Model Once a project or model is opened in ILOG OPL Studio you can execute it by simply clicking the Run button El in the tool bar of the Main window ILOG OPL STUDIO 3 7 USER S MANUAL ILOG OPL STUDIO BASICS Checking for Syntactic or Semantic Errors Before ILOG OPL Studio begins executing a model or project it compiles the OPL statement into an internal representation that is better suited for execution If the model contains syntactic or semantic errors ILOG OPL Studio reports them immedia
96. XAMPLE int nbCars int nbOptions int nbSlots range Cars 1 nbCars Options 1 nbOptions Slots 1 nbSlots int demand Cars int option Options Cars struct Tcapacity int 1 AAL y 5 Tcapacity capacity Options int optionDemand i in Options sum j in Cars demand 3 option i j var Cars slot Slots int setup Options Slots in 0 1 solve forall c in Cars sum s in Slots slot s c forall o in Options amp s in 1 nbS1 sum j in s s capacity o u 1 setup o j lt capacity o 1 forall o in Options amp s in Slots setup o s option o slot s forall o in Options amp i in 1 opt sum s in 1 nbSlots i capa setup o s gt optionDemand o demand c lots capacity o u 1 l ionsDemand o city o u i capacity o 1 Code Sample 3 1 OPL Model for the Car Sequencing Example car mod ILOG OPL STUDIO 3 7 USER S MANUAL 81 o lt o 3 O y W pl o lt pauljapaid E THE CAR SEQUENCING EXAMPLE 82 Code Sample 3 2 shows the data initialization for the problem This code can be found in the car dat file of the release distribution nbCars 6 nbOptions 5 nbSlots 10 demand 1 1 2 2 2 2 option 1 0 Es 1 E O AD ss 5 NS SAO A ss SN 0 1 0 1 0 OO PB Oo oy SNS CS Goi a a 1 capacity lt 1 2 gt lt 2 3 gt S
97. XED INTEGER PROGRAMMING Save node information to disk Sets the OPL parameter nodeFileInd Used when the tree memory limit set by t reLim is reached If the node file parameter is set to zero when the tree memory limit is reached optimization is terminated Otherwise a group of nodes is removed from the in memory set as needed By default CPLEX transfers nodes to node files when the in memory set is larger than 128 MBytes and it keeps the resulting node files in compressed form in memory The use of node files is described in more detail in the CPLEX User s Manual The value can be No node file Node file in memory and compressed default Node file on disk Node file on disk and compressed MIP thread limit Sets the OPL parameter MIPThreads 0 Limit determined by global thread default gt 0 Upper limit on threads for Parallel MIP Sub MIP node limit Sets the OPL parameter subMIPNodeLim to define the MIP subnode limit This parameter restricts the number of nodes searched during application of the relaxation induced neighborhood search RINS heuristic See the RINSHeur parameter The value can be any positive integer Default 500 Suruwe1bB01d o z D a gt O 3 D le 9 ILOG OPL STUDIO 3 7 USER S MANUAL 197 MIXED INTEGER PROGRAMMING MIP Tolerances Default Options Constraint Programming MIP Strategy MIP Limits Mathematical Programming Absolute MIP gap tolerance
98. Zoom out Click on the button with a sign then click in the search tree main window The image is decreased by a factor of 2 each time you click e View whole content Click on this button then click in the search tree window The whole tree becomes visible e Create new window Click on this button then trace a rectangle around the element s you want to view in another window A new dockable window is created with a zoom level defined by the rectangle ILOG OPL STUDIO 3 7 USER S MANUAL 127 N U T O ec 5 e e gt O A BASIC EXAMPLE WITH THE EIGHT QUEENS PROBLEM Tree Abstraction The search tree used internally by ILOG Solver is always a binary tree ILOG OPL Studio abstracts this binary tree as an n ary tree so that 1t resembles the search procedure you defined This tree abstraction facility is available only if you have defined the choice points yourself using the try or tryal1 instructions Default Search Strategy Click on Abort and edit the model to remove the search procedure It is important to observe that although the model now has no search strategy the debug features are still beneficial As explained in the LOG OPL Studio Language Manual OPL has default search strategies that are used when no search strategy is specified The debug features work in fact on these default search procedures and OPL Studio stops at each instruction or at each choice point inside them However the sear
99. a new table 225 viewing the result 226 viewing the result from a model 229 V variables examining results 86 varSel parameter 191 253 Vellino example OPLScript 232 View Choice Stack button 32 View menu Choice Stack 28 Inspect Current Node 28 Output 28 Workspace 27 viewing tables in a database 218 W waiting state blink option 171 Window menu Cascade 29 Tile Horizontally 29 Tile Vertically 29 windows docking 34 floating 33 work space description 23 workDir parameter 179 253 workMem parameter 179 workMemr parameter 253 Workspace command 27 274 ILOG OPL STUDIO 3 7 USER S MANUAL
100. a set of constraints within these tasks Most tasks require a resource e g a crane and tasks requiring the same resource cannot overlap in time In addition several other constraints must be satisfied as explained in detail in the ILOG OPL Studio Language Manual Chapter 15 216 ILOG OPL STUDIO 3 7 USER S MANUAL SETTING UP THE DATABASE The data items are organized in tables in a relational database OPL establishes a connection to the database and initializes the model by reading the corresponding relational tables After the optimal schedule is computed a new table is created and the optimal schedule is stored in this new table Setting Up the Database Before running the example you must ensure that a database containing the data for the Bridge problem is properly installed and available on your particular system To do this follow these steps On Windows XP Windows 2000 Windows NT 4 and Windows 98 e Select Start gt Settings gt Control Panel gt ODBC e On the page User DSN press the button Add e Select Microsoft Access driver mdb e In the field Data Source Name enter abridge e Inthe field Description enter the comment OPL example e Click on the button Select and look for the file abridge mdb in the directory c ILOG OPLSt37 examples database On UNIX e Ensure that the environment variable ORACLE_HOME is correctly set to the Oracle installation on your machine For example setenv ORA
101. alue above the this value On a continued MIP optimization the smaller of this value and the updated cutoff found during optimization will be used during the next MIP optimization A too restrictive value for the this parameter may result in no integer solutions being found The value can be any number Default 1e Lower cutoff tolerance Sets the OPL parameter cutLo Used on a maximization problem to cut off any nodes that have an objective value below this value On a continued MIP optimization the larger of this value and the updated cutoff found during optimization will be used during the next MIP optimization A too restrictive value for the this parameter may result in no integer solutions being found The value can be any number Default 1e Absolute objective difference cutoff Sets the OPL parameter objDif Used to update the cutoff each time a MIP solution is found This absolute value will be subtracted from added to the newly found integer objective value when minimizing maximizing This forces the MIP optimization to ignore integer solutions that are not at least this amount better than the one found so far This parameter can be adjusted to improve problem solving efficiency by limiting the number of nodes however setting this parameter at a value other than zero the default can cause some integer solutions including the true integer optimum to be missed Negative values for this parameter will result in some i
102. ase consult the ILOG DB Link documentation that explains how to rebuild the DB Link drivers In these specific cases e Install ILOG DB Link 5 0 and patches if necessary e Relink the DB Link drivers for the platform and RDBMS in question e Type the name of the ILOG DB Link dynamic library directory at the beginning of your LD_LIBRARY_PATH or SHLIB_PATH or LIBPATH On Windows XP Windows 2000 Windows NT 4 and Windows 98 e To use database connectivity on Windows from the GUI you do not need to set paths The dblink ini file is in the bin directory containing the op1st exe file and calls the libraries in the directory 1ib msvc6 d11_mda e To use database connectivity on Windows from an application that integrates the OPL library you need to check that the dynamic link libraries required by DB Link can be found in the PATH variable Example for msvc6 stat mda COM or JNI applications set PATH c i log OPLSt37 lib msvc6 d11_mda PATHS Dynamic link libraries are provided with OPL Studio 3 7 These dll files are for msvc6 stat_mda COM ActiveX and Java They can be found in lt OPLDIR gt 1ib msvc6 d11_mda For the other ports you need to install ILOG DB Link 5 0 e Inthe case of deployment on another machine make sure that the PATH variable of the target machine indicates where the dynamic drivers are located Consult the README file for details A o o 2 9 a 2 5 o D o z gt o ILOG OPL STUDIO 3 7
103. awing board If the Docked box is checked only the height width ratio is guaranteed If Docked is unchecked the height and width values are respected ILOG OPL STUDIO 3 7 USER S MANUAL 121 THE MAP EXAMPLE The Map Example Another example of Drawing Board use coloring a map can be found in lt installation directory gt OPLSt37 examples opl mapgr prj Drawing Board x E The Euler Example Try also examp1es op1 eulergr mod to see another instance of Drawing Board use this time involving a grid and colored arrows 122 ILOG OPL STUDIO 3 7 USER S MANUAL Tutorial Debugging the Search Strategy In this chapter you will see the debug feature of ILOG OPL Studio applied to the search procedure of constraint programming models You will learn how to display the search tree and how to use it in conjunction with the Choice Stack the Drawing Board and other dynamic display facilities Note The debug feature primarily aims at tracing the search strategy of the model Models that are deterministic that is linear programming models have no search strategy and hence the debug feature has no effect If you used the default directory at installation time you will find the files you need at the following location For Windows XP Windows 2000 Windows NT 4 and Windows 98 c ILOG OPLSt37 examples opl For UNIX systems lt installation directory gt OPLSt37 examples opl ILOG OPL STUD
104. bie et Pere eee eel emcee glee a 48 Windows Platforms Aca 0 ar A kak Sea WO ee AA 48 UNIX Platforms ici oe gee aa A ee aa id 49 Tutorial Working with Projects 000 cece eee eee eee 51 The Production Planning Example 0 e eee eee eee eee eee eee 52 Creating a Project oie eee eS oe eee ee Dae ee SE 54 Inserting an Existing Model File into a Project rr ree 55 Inserting an Existing Data File into a Project 0 cee ee 57 Adding New Files to a Project 0 cece ttn 58 Saving the Project 1 11 04 nar ee ee a ee tice ve ane e 59 Setting Project Options 0 0 0 ett 60 Executing the Project 1 1 ccc eee ce eee eee eee eee eee eee 62 Examining a Solution to the Model nununennnnunua 63 Using the Output Area 6 eens 63 Using the Model Browser xnrnnunuannuneereeeeeeeeena 67 ILOG OPL STUDIO 3 7 USER S MANUAL Chapter 3 Chapter 4 CONTENTS Continuing the Execution 0 0 c cece eee eee eee 71 Using an Alternative Data File 0 cece cee eens 73 Closing aiProject File sii ui li a hated aaa Gr 74 Working with Several Projects 00 cece eee eee eee eee eee eee 74 Tutorial Predefined Dynamic Display ennnnnnu 79 The Car Sequencing Example 0 cece cece eee ee eee eee eee 80 Setting Up the Project 2415704 ii Se ES ee eae Seale heels a 83 Opening
105. bound of the totalCost domain as computed by the linear relaxation Double click on the first choice i e the child of the root node The Choice Stack window appears and the label corresponding to the selected node is highlighted The first choice sets the variable supplier 0 to the value London ILOG OPL STUDIO 3 7 USER S MANUAL 157 COOPERATING SOLVERS COMBINED LP AND CP You can drag and drop to see the complete choice stack together with the search tree OPL Studio 4 4 4 ILOGS OPLSt35 examples opl wareboth mod Ele Edit View Project Execution Debug Options Window Help EART A O search lt forall s in Stores ordered by decreasing regretdmin cost s tryall w in Warehouses ordered by increasing supplyCost s w supplier s u a 2 gt tryall w in Warehouses 3 gt supplier 2 Rome 3 gt tryall w in Warehouses 4 supplier 3 Bonn 4 gt tryall w in Warehouses 5 gt supplier 4 Rome 5 tryall w in Warehouses 6 gt supplier 5 Bordeaux 6 tryall w in Warehouses 7 gt supplier 6 Bordeaux 7 tryall w in Warehouses 8 gt supplier 7 London 8 tryallCw in Warehouses 9 gt supplier 8 Rome 9 gt tryall we in Warehouses xl al Solution with Objective Value 416 Solution with Objective Value 404 Solution with Objective Value
106. breakable nature of some of the activities in this example the Start Min End Min blue rectangle and the Start Max End Max red rectangle may not always be the same size 5 Click Next a 6th time Start End Min Min Surely a a Overlapped Time Window Start End Max Max As soon as end min passes start max the time window between these two dates is the surely overlapped time window 6 Click Next a 7th time The activity is totally instantiated Start End Min Min l l I l Start End Max Max When start min start max and end min end max the activity schedule is totally determined 7 Click on Continue Run to see the algorithm finding solutions and backtracking Reminder You can change the colors of the time windows in the Advanced notebook page of the Options dialog box ILOG OPL STUDIO 3 7 USER S MANUAL U lt 3 D El 5 Q a gt D lt Tutorial User Defined Dynamic Display In this chapter you will see how to use the Drawing Board OPL Studio enables you to define your own backtrackable 2D graphical representation using the Drawing Board to animate the search algorithm The Drawing Board The Drawing Board is a dockable window that you can float and resize Reminder To float or dock a window see Dockable GUI Elements on page 33 The Drawing Board creates ellipses arrows lines arcs polygons polylines grids and labels You can find the description of the Board keyword 4 i
107. can see the Types and Data panels are not very interesting since you can very readily see the same information in the mod file orthe dat file The panels displayed for Variables are more interesting since they represent the results of the problem At times you may want to display the Data panels and the Variables panels together so that the panels have the same appearance and can be compared easily If you double click inside under Variables ILOG OPL Studio displays kluski 40 0000 capellini 0 0000 fettucine 0 0000 If you double click out side under Variables ILOG OPL Studio displays kluski 60 0000 capellini 200 0000 fettucine 300 0000 In the other examples in this manual you will see how ILOG OPL Studio uses other objects to display the results of a solution But for now let s continue with our production planning project 70 ILOG OPL STUDIO 3 7 USER S MANUAL CONTINUING THE EXECUTION Continuing the Execution All the while you were examining the model ILOG OPL Studio was in its waiting state expecting you to tell it what to do next The following buttons in the execution tool bar of the Main window allow you to continue e Abort Terminates the execution After an Abort the traces of any solutions found up to that point are kept in the Output notebook e Next Goes to the next solution of the model e Continue Run N 38 2x 0 5 20 g Forces ILOG OPL Studio to produce all the remai
108. can see that slot 1 has car 5 slot 2 has car 4 and so on E KT N o p E re fo o gt mo _ wanar vur slot 1 slot 2 slot 3 slot 4 slot 5 slot 6 slot 7 slot 8 slot 9 v pi o rr o ri Console Optimization Log Solver CPLEX 4 Next solution in 15 coro BA Figure 3 3 slot Variable Results for Solution 1 If you want to see another view of this result go to the model browser and double click the slot entry in the Variables folder ILOG OPL Studio displays the following panel with the same result Slot 1 Index 1 has car 5 slot 2 Index 2 has car 4 and so on Solution 1 slot Eg Figure 3 4 Alternative View of slot Variable Results for Solution 1 ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING THE FIRST SOLUTION If you scroll down through the Solutions notebook page you see the results for the setup variables The setup variables specify given an option and a slot whether the car assigned to the slot requires the option From the first line you can see that the car at option 1 and slot 1 1 1 requires option 1 as indicated by the value 1 The car at option 1 and slot 2 1 2 does not require option 1 as indicated by the value 0 You can scroll down through the list to see the assignments for all five options and the slots for each option El gj DADADADO gt Console Solutions Optimization Log Solver CPLEX a next solution
109. ces Miscellaneous DK Apply Cancel Reset Pricing Sets the OPL parameter netPPriInd The default Automatic shows best performance for most problems and currently is eguivalent to 3 Select a value from Automatic default Partial pricing Sunuwe1bB01d o D D gt O 3 D EE O 9 Multiple partial pricing Multiple partial pricing with sorting ILOG OPL STUDIO 3 7 USER S MANUAL 209 NETWORK SIMPLEX ALGORITHM Network extraction level Sets the OPL parameter netF ind to establish the level of network extraction for network simplex optimizations Select a value from Extract pure network only Try reflection scaling default Try general scaling Optimality tolerance Sets the OPL parameter netEpOpt Settings 1 and 2 differ only during Phase I Setting 2 shows monotonic values whereas 1 usually does not The value can be any number from let to 1e Default 1e Feasibility tolerance Sets the OPL parameter netEpRHS The feasibility tolerance specifies the degree to which a problem s flow value may violate its bounds This tolerance influences the selection of an optimal basis and can be reset to a lower value when a problem is having difficulty maintaining feasibility during optimization You may also wish to lower this tolerance after finding an optimal solution if there is any doubt that the solution is truly optimal If the feasibility tolerance is set too
110. ch tree is not abstracted as an n ary tree and the basic internal binary tree of ILOG Solver is displayed instead Select the menu option Debug gt Stop At Solution Rerun the model and click once on Next You should obtain the following display Choice Points 34 Failures 30 Solutions 2 n far f KS KS Console Solutions Optimization Log Solver CPLEX queens Figure 7 1 The Eight Queens Model with the Default Search Strategy 128 ILOG OPL STUDIO 3 7 USER S MANUAL A BASIC EXAMPLE WITH THE EIGHT QUEENS PROBLEM In the search tree The red nodes are the failures The green nodes are the solutions The blue nodes are the explored choice points i e the interior nodes The white nodes are the nodes created internally by ILOG Solver and that remain unexplored so far The black nodes are the unexplored nodes that ILOG Solver has finally pruned visible only in Slice Based Search The root node although blue does not correspond to a choice point When the yellow arrow points to the root the algorithm is performing the initial domain reduction To end the 8 Queens example click on Abort po y U 0 os Cc G Qe 9 5 ge gt gt ILOG OPL STUDIO 3 7 USER S MANUAL 129 THE FREQUENCY ALLOCATION EXAMPLE The Frequency Allocation Example 130 Using the frequency allocation problem you will execute a project using the debug feature of ILOG
111. ct Execution Debug Options Window q A 50 A ane Open E Recent Files gt Data ules Script Ge Se Gi Save All ES E urent Editor ctive Project e Modelend Result Ka Generate Compiled Model File Dump A Quit Ctr Q Figure 1 7 Selecting a New Model 36 ILOG OPL STUDIO 3 7 USER S MANUAL ILOG OPL STUDIO BASICS In the editing area of the Main window ILOG OPL Studio opens an empty working document called noname mod The mod extension indicates a model document OPL Studio noname mod OL x File Edit View Project Execution Debug Options Window Help la xl BSSBELEEGR 22 YRS KNE xis E Model Browser empty E Model Projects lx Console Solutions Optimization Log Solver CPLEX STE Ln 1 Col1 Figure 1 8 New Model in Main Window ILOG OPL Studio is now in editing mode and you can enter OPL statements for your problem For example if you want to create the model file for the simple production planning problem of the Volsay company that is presented at the beginning of Chapter 2 of the ILOG OPL Studio Language Manual the OPL statement for this problem is as follows var float gas var float chloride maximize 40 gas 50 chloride subject to gas chloride lt 50 3 gas 4 chloride lt 180 chloride lt 40 y Code Sample 1 1 Example of an OPL Statement ILOG OPL STUDIO 3 7 USER S MAN
112. cture 89 96 collapsed structure 72 description 23 67 displaying a Gantt chart 101 displaying problem results 70 for alloc prj 135 for car pr3 89 for house2 mod 97 for product prj 62 navigating the model file 68 using dynamic display 90 model structure rebuilding 89 models closing 111 description 35 executing 98 opening 95 setting as active 76 modifying colors 169 fonts 169 MPS file format 177 Multi Document Interface 41 N named initialization of records 73 netEpOpt parameter 210 249 netEpRHS parameter 210 249 netFind parameter 210 249 netItLim parameter 210 249 netPPriInd parameter 209 249 New command 26 Next button 32 40 71 Next command 29 node inspector 124 nodeFileInd parameter 197 249 nodeLim parameter 194 249 nodeSel parameter 191 250 USER S MANUAL 269 INDEX notebook pages Activities 105 Console 40 CPLEX 211 Optimization 64 109 setup 91 Solutions 63 Solver 65 109 Sorted Activities 106 O objDif parameter 199 250 objLLim parameter 184 250 objULim parameter 184 250 ODBC 223 225 online help 48 Open command 26 opening model files 95 projects 83 scripts 233 opening files 36 OPL keyword and function colors 168 OPL Studio options export file format 177 refresh rate 177 OPLScript debugging 236 description 232 example 232 executing 234 executing step by step 236 keyword colors 168 opening a script file 233 stepping out from a l
113. cution 88 While you have been looking at the first solution ILOG OPL Studio has been in its waiting state To produce all the remaining solutions to the problem click the Continue Run button El in the tool bar ILOG tudio continues its computation of subsequent solutions without stopping until 1t has found all the solutions While it is running it again displays OPL Studio is running in the status bar and the color patch changes to green When it completes its execution ILOG OPL Studio returns to its idle state and the following occur the status bar displays OPL Studio is idle 6 solution s found the color patch returns to blue 4 the model browser collapses and no longer shows the data structures You can look at the Solutions notebook to see all the solutions As ILOG OPL Studio returns additional results it adds them one after the other to the Solutions notebook page Solution 6 is now visible but you can use the scroll bar to see the other solutions Take a look at the Solver notebook page to see the statistics generated for the execution of this problem If you look at the Optimization notebook page you see that 1t is empty This model does not contain an optimization statement so therefore this page remains empty ILOG OPL STUDIO 3 7 USER S MANUAL LOOKING AT THE MODEL STRUCTURE Looking at the Model Structure At this point in the tutorial the data structure for car prj is not displayed in th
114. cuts 0 Automatically determined default 1 Generate Gomory fractional cuts moderately 2 Generate Gomory fractional cuts aggressively Constraint aggregation limit Sets the OPL parameter aggCutLim to limit the number of constraints that can be aggregated for generating flow cover and mixed integer rounding cuts The value can be any non negative integer Default 3 MIP disjunctive cuts indicator Sets the OPL parameter disjCuts to determine whether or not disjunctive cuts should be generated for the problem Setting the value to 0 the default indicates that the attempt to generate disjunctive cuts should continue only if it seems to be helping The value can be 1 Do not generate disjunctive cuts 0 Automatically determined default 1 Generate disjunctive cuts moderately 2 Generate disjunctive cuts aggressively MIP flow path cuts indicator Sets the OPL parameter flowPaths to determine whether or not flow path cuts should be generated for the problem Setting the value to 0 the default indicates that the attempt to generate flow path cuts should continue only if it seems to be helping The value can be 1 Do not generate flow path cuts Suuwe1bB01d D D gt D 3 D le 9 O Automatically determined default 1 Generate flow path cuts moderately 2 Generate flow path cuts aggressively ILOG OPL STUDIO 3 7 USER S MANUAL 203 MIXED INTEGER PROGRAMMING MIP Mixed Integer Rounding cuts indicator
115. d Description Next Continue Run Step Out Goes to the next solution of a model or project or next choice point or next instruction Forces OPL Studio to produce all the remaining solutions Avoids going through all the iterations of a loop when executing a script Debug Stepping in Model Stepping in Script Stop at Choice Point Stop at Solution Display Search Tree Add Remove Break Point During an execution forces ILOG OPL Studio to stop at each instruction in a search procedure During an execution forces ILOG OPL Studio to stop at each instruction in the script During an execution forces ILOG OPL Studio to stop at each choice point During an execution forces ILOG OPL Studio to stop at each solution in an optimization During the execution of a constraint programming model displays the corresponding search tree Used to set and remove breakpoints in the search procedure of an OPL model or script Options Customize Default Options Customize Active Project Options Displays the Default Options dialog box that allows you to change solver font color and graphics options Displays the Project Options dialog box that allows you to change solver font color and graphics options for the active project Window Cascade Tile Horizontally Tile Vertically Displays overlapping panels in the editing area Displays panels in the editing area horizontally Displays
116. d backtracking ILOG OPL STUDIO 3 7 USER S MANUAL 155 COOPERATING SOLVERS COMBINED LP AND CP Search Tree XI Choice Points 12 4 Failures 13 Solutions 3 Pr a Figure 7 22 Search Tree without Linear Relaxation after 14 Next Commands 12 Click on the Abort button Uncomment the keywords with linear relaxation Run the program again The root of the tree appears The domain of the objective is 376 1000 CPLEX produced a first lower bound 376 13 Double click on the totalCost item inside the model browser You can keep a snapshot of the domain s current state 14 Click one time on Next This second node represents the first choice You see the domain of the objective reduced to 385 1000 in the lower notebook CPLEX produced a lower bound at 385 Double click on the totalCost item inside the model browser You can keep another snapshot of the domain s current state 156 ILOG OPL STUDIO 3 7 USER S MANUAL COOPERATING SOLVERS COMBINED LP AND CP xia Falues 0 Soltions 0 Prur gt Solution 1 olx DELS DELE totalCost 376 1888 Solution 1 loj x DELS DELE 285 1000 Figure 7 23 Search Tree after One Choice using Solver with Linear Relaxation at Each Node po y U 0 os sc fto Qe bo IN 9 5 es gt 15 Click 12 more times on the Next button You see OPL finding 3 solutions The third one has 385 as objective value that is the lower
117. d 27 Redo button 31 Redo command 26 reduce parameter 188 251 referenced files in OPL OPL Script 172 regional settings database restriction in Japanese version 21 213 overriding default Japanese settings 21 reInv parameter 182 251 relaxPreInd parameter 187 251 relObjDif parameter 200 251 removing a file from a project 75 Replace command 27 resources definition 94 results displaying 90 REW file format 177 RINSHeur parameter 193 RINSheur parameter 252 RLP file format 177 Run button 32 Run command 28 S SAV file format 177 Save All command 26 Save All Files button 31 Save and Close Project button 31 USER S MANUAL Save As command 26 Save command 26 Save Editor Content button 31 save preferences 47 Save the Project As command 28 Save the Project command 28 saving a file 31 saving project options 61 saving several files 31 scaInd parameter 181 252 scheduling specific dynamic display 113 scripts debugging 236 description 35 232 executing 234 executing step by step 236 opening a script file 233 setting as active 76 stepping out from a loop 237 search procedure Best First Search 165 Depth First Search 165 Depth bounded Discrepancy Search 165 Interleaved Depth First Search 165 Slice Based Search 165 search strategy dichotomic 165 standard 165 visualizing 147 search tree 148 exploration order 150 visualizing 148 Select All command 27 Set as Active Project command 28 setting active model 76 active
118. d in the Activities notebook page again shows the time line on the horizontal scale with a duration of 21 days The center area shows each task with its starting and ending date You can see that the precedence of the tasks is indicated by the arrows going from one task to another e 0 uOnnjos y 42 ie O Qa E Q U e O 3 ILOG OPL STUDIO 3 7 USER S MANUAL 105 EXAMINING THE SOLUTION You can display the same information via the model browser Right click on the root item and select Show All Activities Workspace Eg B examples opl scheduler house2 mod 5 58 Type Brows jo he 12 Tasks r a A Data m Y duration ow Sorted Activities ose ll Display Windows O Sh 3 Cio 58 Discrete Resources 5 m budget 3 Projects Note The Activities notebook page is displayed by default when a model or project contains activities objects If you do not want the Activities notebook page displayed you can deselect this option in the Options dialog box for the current project or in the Default options dialog box for all other projects See Setting Output Options on page 169 The Sorted Activities Notebook Page Click on the Sorted Activities tab to bring that notebook page to the foreground FE Dee 24941 51 AA A E Aa A E O a ES A O E A EE AA EAN Ea almasonnd feamenti afeamentry Folumbins plumbing fiwindow ind TEN h
119. d that the database administrator has already assigned to you The field SOL Net id has the format lt net hostname gt SID for SOL Net V1 lt instance name gt for SQL Net V2 As an example the distributed model file obridge mod contains the connection statement DBconnection db oracle8 scott tiger ilog where the user scott with the password tiger will connect to the Oracle database called ilog Reading From the Database The rows contained in any table may be read into OPL by using the DBread statement For example with the following instruction you create an OPL set called taskduration which contains the rows of the table Task each row becoming an OPL record of type TaskDuration TaskDuration taskduration from DBread db select DURATION NAME from Task DBmapping 0 gt duration 1 gt task For the sake of the example we wrote a select statement inverting the columns from the table but note that the DBmapping part is not mandatory if there is a positional correspondence between the columns returned by the select statement and the fields of the OPL record Similarly the OPL sets max_ef max_nf min_af min_nf min_sf precedences Resource taskresource ILOG OPL STUDIO 3 7 USER S MANUAL THE OPL MODEL are initialized with the rows of the corresponding tables from the database as shown in Code Sample 10 2 Distance max_ef from DBread db select from MAX_EF Distance max_nf fro
120. did not see them with the option Stop at Choice Point Here with the option Stepping in Model you can also see those attempts ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE PROJECT WITH THE STEPPING IN MODEL OPTION Visualizing the Search Strategy with the Stack and Inspector Windows The Stack window displays the current path inside the search tree To understand more clearly what is displayed in the Stack and Inspector windows during a search we will examine the corresponding search tree 1 freq lt c 4 t 1 gt 1 2 freq lt c 5 t 1 gt 1 2 freq lt c 5 t 1 gt 3 2 freq lt c 5 t 1 gt 2 yo y U 0 os Cc O Qe 95 e gt gt 3 freq lt c 5 t 2 gt 1 3 freq lt c 5 t 2 gt 3 3 freg lt c 5 t 2 gt 2 3 freq lt c 5 t 2 gt 4 s 3 freq lt c 5 t 2 gt 19 Figure 7 18 Order of the Search Tree Exploration with the Default Depth First Search In this search tree the path 1 2 5 24 corresponds to the following choices the value has been assigned to the variable freq lt c 4 t 1 gt and the value 3 has been assigned to the variable freq lt c 5 t 1 gt and the value 19 has been assigned to the variable freq lt c 5 t 2 gt When executing with the Stop at Choice Point debug option only the choice point nodes are displayed in the Stack and Inspector Windows the failure nodes are hidden When executing with the S
121. dule If you are using ODBC with Microsoft Access the instruction to create the new table is DBexecute db create table Result task string startTime integer endTime integer If you are using Oracle the instruction to create the new table is DBexecute db create table Result task VARCHAR 20 startTime NUMBER 6 0 endTime NUMBER 6 0 ILOG OPL STUDIO 3 7 USER S MANUAL 225 A o 2 9 a 2 5 o D 2 o s gt o EXECUTING THE BRIDGE EXAMPLE Finally the members of the set resultSet can be inserted as rows in the table Result by using a DBupdate statement For ODBC the insertion is made by the instruction DBupdate db insert into Result task startTime endTime values resultSet For Oracle the insertion is made by the instruction DBupdate db insert into Result task startTime endTime values 1 2 3 resultSet The difference between the two DBupdate instructions is due to the different syntax for the placeholders inside the SQL request imposed by the two database systems In the case of ODBC you use a query sign as a placeholder while in Oracle you use a column sign followed by a column number with the columns numbered starting from one Executing the Bridge Example Click the Run button E in the tool bar of the OPL Studio Main window At the end of the execution you will see the following message in the Solutions notebook page Optimal Solution with
122. e o 3 EXAMINING THE SOLUTION 108 ending at day 30 In this way you can see the consumption of budget resources for all the tasks of the project To get another view of these results go to the Model browser and double click the budget entry in the Discrete Resources folder ILOG OPL Studio displays the results in a bar chart see Figure 4 11 Solution 1 budget Al ES 30928 28995 al Figure 4 11 Alternative View of Discrete Resources Results for house2 mod Example Discrete Resources are displayed with a bar chart in ILOG OPL Studio The horizontal scale shows the time line just as it did for the Gantt chart The vertical scale represents the maximum number of units in this case dollars used at any point in time throughout the duration of the project The bars in the chart give the evolution of the resource over time This panel has two sliders that you can use to adjust the scaling factor along the respective axes When this panel comes up for the first time ILOG OPL Studio uses a scaling factor to guarantee that the whole chart appears in the viewing area You may want to adjust the scaling factor to see more details of the results and you can do this with the sliders Then use the scroll bars to bring any part of the chart into the viewing area Note The graphic representation of unary resources is different Double clicking on a unary resource displays a Gantt chart with resource allocation See bridge p
123. e Tile Horizontally O Tile Vertically Project Set as Active Project 6 Add New Model File 68 Add New Data File 9 Insert Existing Model File 9 Insert Existing Data File E Save the Project E Save the Project As 15 Close Project E Browse Model pe Project Options Help B Contents Keyword Help Execution YE Browse Active Model All Solutions EL Bun EEK Abort E Next il Proceed P Step Out F5 Shift F5 FIL OIPNIS IdO Fl alloc mod M Add Remove BreakPoint Fg Figure 1 3 Overview of Commands in the Menu Bar About OPL Studio Some of the menu items have a keyboard shortcut indicated in the right hand column of the menu For example Keyword Help has the shortcut F1 which means that you can obtain help on an OPL keyword in the text editor by selecting the keyword and then either clicking the item Keyword Help or pressing the key F1 ILOG OPL STUDIO 3 7 USER S MANUAL 25 T O lt 2 lt O lt S O Q ILOG OPL STUDIO MAIN WINDOW The table below lists the commands found in the menus and provides a description of each command Table 1 1 Commands in the Menu Bar 26 Open Recent Files Save Save As Save All Close Current Editor Close Active Project Dump Active Model and Result Generate Compiled Model File Command Description File New Creates a new file Displays a submenu to specify a model pr
124. e Model lid Project Options N 38 2x 0 5 20 ong t Model Projects Figure 2 2 Insert a Model File into a Project To insert an existing model into the new project position the cursor on the project name noname prj and right click on the mouse Select to Insert Existing Model File from the popup menu as shown in Figure 2 2 The ILOG OPL Studio distribution structure contains five directories bin doc examples include lib You will find the list of available model files in lt installation directory gt lexamplestopl ILOG OPL STUDIO 3 7 USER S MANUAL 55 CREATING A PROJECT Open file 121 xi Lookin Ca opi al e E knapsack mod El marriage mod E covering mod 5 knapsackp mod E mulprod mod E queens euler mod E magic1 mod E oil mod E gueens8 m 5 fixed mod E magic2 mod E prodmilp mod E sailco mod 3 gas mod Ej magic3 mod product modi E sailcopw n 53 gas1 mod E map mod ES production mod sailcopwa E queens me a File name product mod Files of type Model files mod ha Cancel T Open as read only Select the product mod file from the list and click Open Notice that ILOG OPL Studio adds the product mod file to the project tree and opens the file in the work space File Edit View Project Execution Debug Options Window Help lx PSSSBZE0GR Oe lt BBEBOA lt 4 enum Products enum Resources
125. e Solution to a Scheduling Problem The house building example illustrates how ILOG OPL Studio can handle a scheduling problem Chapter 5 Tutorial Scheduling Specific Dynamic Display The bridge example shows how to define a scheduling specific dynamic display and use the Activity Domains window Chapter 6 Tutorial User Defined Dynamic Display The examples presented use the Drawing Board to animate the search algorithm Chapter 7 Tutorial Debugging the Search Strategy The frequency allocation example demonstrates the debugging facilities of ILOG OPL Studio including the search tree Chapter 8 Customizing ILOG OPL Studio provides information about setting ILOG OPL Studio options to meet your particular needs ILOG OPL STUDIO 3 7 USER S MANUAL Chapter 9 Mathematical Programming describes the CPLEX options available in ILOG OPL Studio Chapter 10 Working with a Database illustrates how to connect to a database from ILOG OPL Studio and how to read from and write to the database Chapter 11 Using OPLScript describes how to work with the OPL scripting language Chapter 12 Generating Compiled Models explains how to generate a op1 file that can be integrated into your application Appendix A OPL Parameters provides an alphabetical list of OPL parameters with their values Notation Used in This Manual The following typographic conventions apply throughout this manual code extracts and file names ar
126. e in the Variables folder Workspace XJ ete sexamples opl product prj FA Te o i123 Products 127 Resources n Y product j o da Y capacity EQ Variables 3 Projects Figure 2 16 Model Browser for product mod File ILOG OPL STUDIO 3 7 USER S MANUAL 67 EXAMINING A SOLUTION TO THE MODEL The model browser can be used in three different ways To help you navigate through a mod file displayed in the editing area To display additional views of the solution after running OPL Studio To check dynamic display options on variable items before running OPL Studio These options are not available when OPL is in a waiting state as it is now Dynamic display is explained in Using Dynamic Display with ILOG OPL Studio on page 90 Navigating the mod File If you click on one of the entries in the project tree ILOG OPL Studio selects the line in product mod containing the first occurrence of that entry For example click on capacity and the first occurrence of capacity is highlighted Displaying Additional Views If you right click on capacity while OPL Studio is in a waiting state the Open View button appears as shown in Figure 2 17 By clicking this button you can display an additional view of the solution OPL Studio examples opl product mod Al ES File Edit View Project Execution Debug Options Window Help la x enum Products B
127. e mail address if different from the From field first name last name your location company and country maintenance contract number maintenance contract owner s last name Web Site On our web sites you will find a wealth of information about constraint programming in a range of articles and conference papers explaining the theoretical background and technical features of OPL Studio and other ILOG products In addition to those freely accessible pages there are also technical support pages on our web sites They contain FAQ Frequently Asked Answered Questions and the latest patches for some of our products Changes are posted in the product mailing list Access to these pages is restricted to owners of an on going maintenance contract The maintenance contract number and the name of the person this contract is sent to in your company will be needed for access as explained on the login page All three of these sites contain the same information but access is localized so we recommend that you connect to the site corresponding to your location and select the Tech Support Web page from the home page Americas http www ilog com Asia and Pacific Nations http www ilog com sg Europe Africa and Middle East http www ilog fr Licensing Requirements To use the OPL Studio 3 7 graphic environment you need the key OPLStudio 3 To use the free trial version of OPL Studio 3 7 which has restrictions on model size and
128. e menu accessible through right clicking on the active project in the Projects notebook page Editing Area This area displays opened model data script or C files Use this area to create new files edit existing files or examine active documents You can open more than one file in this space The opened files are displayed in separate panels with the file name appearing in the title bar Output Notebook This area is used by ILOG OPL Studio to return error information solutions and results Separate notebook pages appear for console messages solutions to models optimization information the log of past actions solving statistics and additional pages appear for other displays depending on the nature of the model Status Bar This area displays messages concerning the execution status of ILOG OPL Studio These messages are then stored in the Log notebook page Path Name or Line and Column This area displays the pathname of the file just loaded or the file being executed When moving the insertion point in the editor this area displays the line number and column number ILOG OPL STUDIO 3 7 USER S MANUAL 23 ILOG OPL STUDIO MAIN WINDOW 24 Status Box This box changes its color and label according to the status of the currently active model project or script Color Label Meaning Blue Idle Indicates that ILOG OPL Studio is idle Files can be created edited or examined in the editing area Green
129. e model browser However ILOG OPL Studio allows you to rebuild the data structure of a model without having to execute the model There are four ways of rebuilding the browser information These are described in Using the Model Browser on page 67 For example click on the Rebuild Browser Information button E in the tool bar of the Main window ILOG OPL Studio builds the tree representing the data structures of the model in the model browser just as it did when it executed the project Workspace x ate examples opl car prj E Data nbCars nbOptions nbSlots demand option capacity optionDemand pauljapaid ln Options 1 2 Slots U lt 3 D 3 Q a a D lt Figure 3 7 Model Browser for car prj Floating State The navigation tools of the model browser are available for your use at this time When you click on an entry ILOG OPL Studio highlights the line where the first occurrence of the entry is found in the edited model file Note Because ILOG OPL Studio is in an idle state at this point a double click on an entry has no effect However when ILOG OPL Studio is in a waiting state during execution you can double click on an entry to display additional views of the results of a solution ILOG OPL STUDIO 3 7 USER S MANUAL 89 USING DYNAMIC DISPLAY WITH ILOG OPL STUDIO Using Dynamic Display with ILOG OPL Studio 90 As the last task in this tutorial let s take a look at the dynamic d
130. e phase indicator The phase displayed may be one of the following Presolve Network Primal Phase I Primal Phase II Dual Phase I Dual Phase II Barrier ILOG OPL STUDIO 3 7 USER S MANUAL 211 Sunuwe1b01d o D mp gt O 3 D EE 9 D RESULTS OF MATHEMATICAL PROGRAMMING The various frames in the rest of the page give information pertaining to each specific phase For primal and dual phase I Infeasibility measure Number of iterations For primal and dual phase II Value of the objective function Number of iterations For the primal and dual crossover Number of pushes Number of exchanges For barrier Primal objective value Dual objective value Number of iterations For the MIP Number of nodes explored Number of nodes still left to explore Number of iterations Best value found so far upper bound Lower bound currently used for this subtree Cutoff value This page also displays the Number of constraints Number of variables that are submitted to the linear solver 212 ILOG OPL STUDIO 3 7 USER S MANUAL 10 Working with a Database This chapter explains how to use the database connection feature offered by ILOG OPL Studio The example used is based on the bridge problem which is a scheduling application discussed in detail in the LOG OPL Studio Language Manual and presented in the distributed project bridge prj located in the following subdirectory For UNIX systems lt installa
131. e written in this typeface entries to be made by the user are written lt in angle brackets gt commands appear as File gt Open Related Documentation ILOG OPL Studio Language Manual Provides a description of the OPL and OPLScript programming languages used in our examples and should be read in conjunction with the present document An online help accessible from OPL Studio contains a quick reference to the OPL and OPLScript languages ILOG OPL Studio Component Libraries Reference Manual Describes the various APIs available for accessing the OPL solving engine including the Microsoft COM ActiveX API a native C API and a Java API Microsoft s Component Object Model COM allows Windows users to access OPL from within languages such as Visual Basic ILOG OPL Studio Component Libraries User s Manual Contains examples that show how to use the APIs in order to access OPL from Excel VBA Visual Basic C and Java Examples of integration into web servers with ASP and JSP are also provided ILOG OPL STUDIO 3 7 USER S MANUAL 13 ILOG OPL Studio Release Notes Indicate the new and modified features of each release Source code for examples delivered in the standard distribution A readme txt file delivered as part of the standard distribution This file contains the most up to date information about platform prerequisites for ILOG OPL Studio Where to Get More Information For technica
132. ece eee eee eee eee 107 Alternative View of Discrete Resources Results for house2 mod Example ooooooommmmmmmo o 108 Optimization Notebook Page for house2 mod Example 2 200 cece eee ee ee eee eee eee 109 Solver Notebook Page for house2 mod ExAMpl ese eee cece eee eee eee eens 109 Closing a Model in the Projects Page cece cece eee eee eee eee eee 111 Closing a Model in the Editing Area rises ginei a a e eee eee eeae 111 The Eight Queens Model with the Default Search Strategy 2 e cece eee eee eee 128 Project Tree for the Frequency Allocation Example in Dockable Window oooooooooommmoo 133 Main Window for the Frequency Allocation Example 00 cee e eee eee eee eee eee eee 134 ILOG OPL STUDIO 3 7 USER S MANUAL 7 4 75 7 6 7 7 7 8 7 9 7 10 7 11 7 12 7 13 7 14 7 15 7 16 7 17 7 18 7 19 7 20 7 21 7 22 7 23 7 24 7 25 8 1 8 2 8 3 8 4 8 5 8 6 8 7 10 1 10 2 10 3 10 4 11 1 11 2 FIGURES Browsing an Active Model Frequency Allocation Example 2 1 00 cee eee eee eee eee eee 135 Model Browser for the Frequency Allocation Example enunuuunuannnn nunnu anu 135 Debug Menu coi casa tac a A Id A A A alee ee 136 Main Window in Debug Mode with Stop at Choice Point Option xnuernnnua 138 Stack Window Floating at the First Choice Point enununununennunun nunnu 139 Inspector Window Floating at the First Choice Point
133. ecting to the Database from OPL Another interesting part of the model is the DBconnect ion statement you use to connect to the database Connecting to ODBC If you are using ODBC the connection is established by the following statement DBconnection db odbc abridge The string passed as first argument indicates that you want to connect to a database source managed by ODBC The string passed as second argument must respect the format below data source name user password where data source name is the identifier you typed in the field Data Source Name when linking the database to ODBC as explained in Setting Up the Database on page 217 In our case this identifier is abridge The fields user and password may be omitted but note that the slash signs are mandatory ILOG OPL STUDIO 3 7 USER S MANUAL 223 md o E 2 9 a 2 5 o D o z gt o THE OPL MODEL 224 Connecting to Oracle Note If you are using an Oracle database you should adapt the DBconnection statement to your particular case The string passed as first argument must take the value oraclex where x represents the particular version of the Oracle client you are using A possible value is oracle81 The complete list of values can be found in the README file The string passed as second argument must respect the format below user password SQL Net id where user and password indicate the user name and the passwor
134. ed to problems that exhibit extreme degeneracy 184 ILOG OPL STUDIO 3 7 USER S MANUAL Preprocessing PREPROCESSING Default Options lolx Constraint Programming E Mathematical Programming Constraint Prog MP General Simplex Preprocessing mP Strategy MIP Limits i MP General Bound strengthening Compression after presolve Simplex Automatically determined z Automatic z Mixed Integer Programming MIP Strategy Coefficient reduction Use dependency checker MIP Limits 3 MIP Tolerances Reduce all potential coefficients y Automatic pe MIP Cuts Barrier Preprocessing agaregator fill 10 Network E Graphical User Interface Preprocessing aggregator application limit 1 Editor Output Simplification with Presolve Vv Advanced ats Miscel necus Use LP presolve on initial MIP relax L Limit on the number of Presolve passes made 1 Symmetry breaking cuts E Pre optimizer passes Dual Primal and dual reduction type Automatic y Both primal and dual reductions y OK Apply Cancel Reset Bound strengthening By default the OPL parameter bndStrenInd is set to on and OPL Studio will use bound strengthening when solving MIP problems Bound strengthening tightens the bounds on variables perhaps to the point where the variable can be fixed and thus removed from consideration during branch and bound This reduction is usually beneficial but may take a long t
135. ept in the pricing candidate list The value can be O Determined automatically default or any positive integer Refactorization frequency Sets the OPL parameter reInv Determines the number of iterations between refactorizations of the basis matrix The value can be O Determined automatically default or any positive integer Perturbation limit Sets the OPL parameter perLim Determines the number of stalled iterations before perturbation will be performed The value can be O Determined automatically default or any positive integer Singularity repair limit Sets the OPL parameter singLim Restricts the number of attempts to repair the basis when singularities are encountered Once this limit is exceeded CPLEX replaces the current basis with the best factorable basis that has been found The value can be any positive number Default 10 ILOG OPL STUDIO 3 7 USER S MANUAL OPTIMIZATION USING SIMPLEX Iteration limit Sets the OPL parameter itLim Determines the maximum number of iterations to be performed before the algorithm terminates without reaching optimality The value can be any positive integer Default 2 100 000 000 Basis saving frequency Sets the OPL parameter basInterval Establishes the number of iterations between simplex basis file writings The value can be any positive integer Default 2100000000 Markowitz tolerance Sets the OPL parameter epMrk Influences pivot selection duri
136. er Network Mathematical Programming MP General M Error line coloring Simplex M Brace matching 1 Output Advanced Miscellaneous 4 r Save options M Save before running i C Prompt before saving files Preprocessing M Automatic indentation Mixed Integer Programming M Editor mode Syntax coloring MIP Strategy ry MIP Limits Visual y Auto Tabulation size 3 MIP Tolerances Font Editor font The quick brown fox Font Barrier Foto ie Network Colors E Graphical User Interface Editor colors Tne quick brown fox Fore Back I Output Error colors The quick brown fox Foe Back Advanced OPL keyword colors The quick brown fox Fore Back ton Miscellaneous OPL function colors The quick brown fox Fore Back OPLScript keywords The quick brown fox Fore Back Comment colors The quick brown fox Fore Back You can change the character font Note that although proportional fonts are allowed we recommend that you use a fixed font You can change the background and foreground colors for e ordinary text default black and white e errors default red and white e OPL and C keywords default blue and white e OPL and OPLScript functions default violet and white e OPLScript keywords and C preprocessor macros default orange and white e comments default green and white I
137. ere assigned to the variables The Stack and Inspector windows should now look like this gt solve gt forall t in Transmitters gt tryall fin Freqs gt freq lt c 4 t1 gt 1 gt tryall fin Freqs gt freq lt c 5 t 1 gt 3 gt tryall fin Freqs gt freg lt c 5 t 2 gt 19 gt tryall fin Freqs Figure 7 12 Stack Window at the Fourth Choice Point po y U 0 os sc O Qe 9 5 a gt gt Inspector x 4 gt tryall Fin Fregs Figure 7 13 Inspector Window at the Fourth Choice Point Now you can do one of the following If you want to continue step by step looking at the values assigned to the variables click the Next button until you reach the end of the execution If you want to continue the execution without stopping click the Continue Run button id in the tool bar When you click the Continue Run button at this point ILOG OPL Studio leaves debug mode and finds the first solution This solution appears in the Solutions notebook page ILOG OPL Studio then enters its waiting state so that you can ask for the next solution or complete the execution If you have checked what you are looking for you can terminate the execution by clicking the Abort button E in the execution tool bar ILOG OPL STUDIO 3 7 USER S MANUAL 141 EXECUTING THE PROJECT WITH THE STEPPING IN MODEL OPTION For this example we will terminate the execution so
138. es command 27 initialization of data 73 Insert Existing Data File command 28 Insert Existing Model File command 28 Inspect Current Node button 32 Inspect Current Node command 28 Inspector window 139 144 installation directory 51 80 93 123 intSolLim parameter 195 248 itLim parameter 183 248 J Japanese version database restriction 21 213 switching to English version 21 USER S MANUAL K keyword help 48 Kill Line command 27 L label colors 169 launching ILOG OPL Studio 18 Load Data File button 31 Load Model File button 31 Load Project File button 31 Load Script File button 31 loading data into the editor 58 83 133 localization database restriction in Japanese version 21 213 switching from Japanese to English 21 log notebook page 64 LP file format 177 Main window button descriptions 31 command descriptions 26 description 22 editing area 23 execution tool bar 23 execution tool bar buttons 32 line number column number 23 menu bar 23 model browser 23 output notebook 23 pathname 23 project tree 23 status bar 23 status box 24 tool bar 23 work space 23 MDI Multi Document Interface 41 menu bar description 23 MIPEmphasis parameter 178 248 MIPOrdInd parameter 192 248 MIPOrdType parameter 190 249 MIPThreads parameter 197 249 ILOG OPL STUDIO 3 7 INDEX MIRCuts parameter 204 249 mode selectors for the Activity Domains window 115 model browser building the data stru
139. ess the two keys Shift z or select a time zone by left clicking and dragging on the horizontal axis e To zoom out of the time axis press the two keys Shift u 102 ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING THE SOLUTION e To zoom in on the vertical axis there are two possibilities press the z key or select a vertical zone by left clicking and dragging on the vertical axis e To zoom out of the vertical axis press the u key To scroll e Use the horizontal scroll bars or the arrow keys and for time scrolling e Use the vertical scroll bars or the arrow keys and for vertical scrolling To fit the contents to the frame or return to the initial state e To fit the contents on the time axis press the two keys Shift f e To fit the contents on the vertical axis press the f key e To return to the initial state no zoom press the two keys Shift i To split the chart into four views Note Before using the keyboard on one of the four views click on the view in order to give it the keyboard focus If the Gantt chart is large you cannot zoom in and see activities that are far apart In order to see them together you can use the split feature By dragging the black square located at the top left corner of the chart you obtain four views Figure 4 7 contains a Gantt chart split into four views e 0 uonnjos y on 2 3 D Q Q Uv e D 3 ILOG OPL STUDIO 3 7
140. from the Debug menu Then click the Run button in order to start the execution of the script ILOG OPL Studio stops at the first instruction of the script indicated by the current line arrow in the editor margin At the same time the status bar displays the message Next instruction and the color patch changes to yellow and blinks to stop the blinking see Blinking Status on page 171 OPL Studio NS ESAS O ofx Ele Edt View Project Execution Debug Options Window Help 181 x Bews udi LETERSIA 3 Model bin genBin mod genBin dat import enum Colors bin Colors import enum Components bin Components Model pro chooseBin mod f vellino osc int nbSol 8 while bin nextSolution do lt pro bin addh pro bin nbSol c bin c forall c in Components pro bin nbSo1 n c bin n c nbSol nbSol 1 gt pro nbBin nbSol cout lt lt nbSol lt lt nbSol lt lt endl E Model Projects Console Solutions Optimization Log Solver CPLEX aj Net instruction texampiestopiseriptst Waiting Figure 11 3 Step by Step Execution of a Script 236 ILOG OPL STUDIO 3 7 USER S MANUAL STEPPING IN A SCRIPT To Step to the Next Instruction In order to execute the instruction indicated click on the Next button E in the execution tool bar of the Main window ILOG OPL Studio executes this instruction then s
141. g ILOG OPL STUDIO 3 7 USER S MANUAL 163 DEFAULT OPTIONS AND PROJECT OPTIONS Default Options and Project Options 164 There are two types of options those that are set for OPL Studio and become the default settings and apply to stand alone models and scripts those that are set for an active project and apply only to that project Note The project settings take precedence over the default settings The Default Options and Project Options dialog boxes contain the same options Only the title bars differ This chapter describes how to set default options Setting the Default Options You can customize your ILOG OPL Studio sessions using the Default Options dialog box See Figure 8 1 To access this dialog box select Options gt Customize Default Options in the menu bar To set your options for the current session click Apply or OK To reset the default values click Reset Default options are saved in the default prj file in your home directory on UNIX and in your profile directory on Windows when you quit the application or after the command Save All The options will then be restored the next time you start OPL Studio Only an option whose value differs from its default value is saved in the default prj file Options for stand alone model and script files are set in the Default Options dialog box Setting Project Options For an active project there are two ways of accessing the project options I
142. g with Oracle on UNIX and you followed the steps given for setting up the tables in your database you can view the contents of any of these tables by issuing a select command at the prompt of the SQL shell SORACLE HOME bin sglplus ILOG OPL STUDIO 3 7 USER S MANUAL THE DATA TABLES The Task Table The two column table Task stores the names of the 46 tasks involved in the building of the bridge together with their durations in days Each row of the table corresponds to a task with the name of the task stored as a character string in the first column and with its duration stored as an integer in the second column Windows XP Windows 2000 Windows NT 4 and Windows 98 Figure 10 1 shows a part of the table Task as you see it from Microsoft Access EE Task Table Ox E 3 4 2 2 2 2 5 1 1 1 1 1 abe 1 1 1 1 1 1 1 0 0 2 6 8 8 3 Rh 00 Record 14 4 II 1 gt oily 4 Figure 10 1 The Task Table UNIX In order to see the contents of the table Task launch the SQL shell then type SOL gt select from Task You see 46 rows selected ILOG OPL STUDIO 3 7 USER S MANUAL 219 hb o E 2 9 a 2 5 gQ Sa o Z gt 4 THE DATA TABLES 220 The Resource Table The table Resource stores the different resources needed by the tasks during the construction of the bridge Each row of the table corresponds to a resource and contains one column storing
143. ger 3 203 Constraint aggregation limit for cut generation aggFill int Any non negative integer 10 186 Preprocessing aggregator fill aggInd int 1 Automatic 1 for LP infinite for MIP 1 186 0 Do notuse any aggregator Preprocessing aggregator or Any positive integer application limit ILOG OPL STUDIO 3 7 USER S MANUAL 243 Parameter Name and Description Type Possible Values Default Page barAlg int 0 Default primal dual log barrier 0 205 1 Infeasibility estimate start 2 Infeasibility constant start Barrier algorithm 3 Standard barrier barColNz int 0 Dynamically calculated 0 207 or Any positive integer Barrier column non zeros barCrossAlg int 1 No crossover 0 206 0 Automatic Barrier crossover method 1 Primal crossover 2 Dual crossover barEpComp float Any positive number gt 1e 10 1e 8 206 Barrier convergence tolerance barGrowth float Any positive number 1e12 207 Barrier growth limit barltLim int 0 No barrier iterations 2 100 000 000 208 or Any positive integer Barrier iteration limit barMaxCor int 1 Automatically determined 1 208 0 None Barrier maximum correction Any positive integer limit bar0b3jRng float Any positive number 1e20 207 Barrier objective range barooc int 0 Off 0 208 1 On Out of core barrier indicator barOrder int 1 Automatic 4 206 Barrier ordering algorithm 2 Approximate minimum degree AMD 3 Approx
144. ginning of the project The goal is to minimize the duration of the project while taking into account both the time and budget constraints Code Sample 4 1 shows the OPL model for this example This model is found in the file house2 mod of your release distribution In this example the data for the problem is contained within the model It has not been separated out into a dat file enum Tasks masonry carpentry plumbing ceiling roofing painting windows facade garden moving int duration Tasks 7 3 8 3 1 2 1 2 1 1 scheduleHorizon 30 Activity a t in Tasks duration t DiscreteResource budget 29000 minimize almoving end subject to almasonry precedes a carpentry masonry precedes a plumbing masonry precedes a ceiling carpentry precedes a painting ceiling precedes alpainting roofing precedes a windows roofing precedes a facade plumbing precedes a facade roofing precedes algarden plumbing precedes algarden windows precedes a moving facade precedes a moving garden precedes a moving painting precedes a moving DUDO YY YAA YAA capacityMax budget 0 15 20000 forall t in Tasks alt consumes 1000 duration t budget y Code Sample 4 1 OPL Model for the House Building Example house2 mod e 0 uOnnjos y on O 3 O Qa Q A le D 3 Opening the Model File If the Main window is not open you will need
145. gorithm Sets the OPL parameter subA1g the algorithm to be used on MIP subproblems Select a value from Automatic default Primal simplex Dual simplex Network optimizer followed by dual simplex Barrier with crossover Node selection strategy Sets the OPL parameter nodeSel Select a value from Depth first search Best bound search default Best estimate search Alternative best estimate search Variable selection strategy Sets the OPL parameter varSe1 Select a value from Sunuwe1bB01d o D r gt O 3 D le 9 Branch on variables with minimum infeasibility Branch variable automatically selected default Branch on variable with maximum infeasibility Branch based on pseudo cost Strong branching Branch based on pseudo reduced cost ILOG OPL STUDIO 3 7 USER S MANUAL 191 MIXED 192 INTEGER PROGRAMMING Use MIP priority information By default the OPL parameter MIPOrdInd is set to on and OPL Studio will use priority order information if it exists for the next MIP optimization A priority order assigns a branching priority to some or all of the integer variables Variables with priorities will be branched on before variables without priorities Variables with higher priorities will be branched on before variables with lower priorities when the variables have fractional values Uncheck the box to switch off this function Probe strategy Sets the OPL parameter probe Determines
146. gs may eliminate numerical difficulties relating to infeasibility The value can be Default primal dual log barrier default Infeasibility estimate start Sunuwe1bB01d o D mp gt O 3 D EE 9 D Infeasibility constant start Standard barrier ILOG OPL STUDIO 3 7 USER S MANUAL 205 BARRIER ALGORITHM 206 Ordering algorithm Sets the OPL parameter barOrder to define the algorithm to be used to permute the rows of the constraint matrix in order to reduce fill in the Cholesky factor The value can be Automatic default Approximate minimum degree AMD Approximate minimum fill AMF Nested dissection ND Starting point algorithm Sets the OPL parameter barStartAlg to define the algorithm to be used to compute the initial starting point for the barrier solver The value can be DualisO default Estimate dual Average of primal estimate dual 0 Average of primal estimate estimate dual Barrier crossover method Sets the OPL parameter barCrossAlg to determine which if any crossover method is performed at the end of a Barrier optimization The value can be 1 No crossover 0 Automatic default 1 Primal crossover 2 Dual crossover Convergence tolerance Sets the OPL parameter barEpComp to determine the tolerance on complementarity for convergence The barrier algorithm will terminate with an optimal solution if the relative complementarity is smaller than this value The value can be a
147. he output notebook e Activities whether or not the Activities notebook page is displayed during the execution of a model with activities defined e Sorted Activities whether or not the Sorted Activities notebook page is displayed during the execution of a model with activities defined e Textual result whether or not ILOG OPL Studio displays the instantiation of the variables in the Solutions and Optimization notebook pages e Precision the number of digits you want to see after the decimal point when displaying a floating point value The default is 4 e Console Font the font used in the Console Solutions Optimization Log and Output notebook pages 170 ILOG OPL STUDIO 3 7 USER S MANUAL SETTING ADVANCED OPTIONS Setting Advanced Options Use the Advanced notebook page to set colors for activity domains and docking options for the drawing board Default Options oli Miscellaneous gt y Constraint Programming MIP Cuts Barrier Network Editor Output E Mathematical Programming i MP General m Activity Domains Simplex Min Solar ee a MMM Mixed Integer Programming MIP Strategy Ewok E c P Limits P Tolerances Drawing Board P Cuts Barrier lv Docked Network E Graphica User Interface Editor Output need Y Blinking status Miscellaneous OIPNIS IdO DK Apply Cancel Reset o e lt a O 3 N
148. i 0 YE Browse Model fettucine lt 366 6 tud Project Options 1 capacity 28 48 YE Model gt Projects 4 kluski capellini fettucine 3 Figure 2 7 Saving a Project To save your project file position the cursor on the project name noname prj and right click on the mouse Select the menu item E Save the Project As see Figure 2 7 ILOG OPL Studio displays a standard Save As dialog box Enter product prj for the file name and click Save As product prj already exists in your distribution you will have to overwrite It Notice that noname prj at the top of the tree has now changed to product prj a sexamples opl product prj 9 productmod fig product dat 5 Projects E Model Figure 2 8 Project Tree for product prj Example ILOG OPL STUDIO 3 7 USER S MANUAL 59 v 2 o Q 7 YUM BUOM Z CREATING A PROJECT Setting Project Options ILOG OPL Studio also allows you to set certain options for your project Right click on the project name in the project tree then select Project Options or select Options gt Customize Active Project Options from the menu bar ILOG OPL Studio displays the Project Options notebook F Project Options E Mathematical Programming MP General i Simplex Preprocessing Standard o Mixed Integer Programming MIP Strategy i MIP Limits Depth First Search ha i MIP Tole
149. imate minimum fill AMF 4 Nested dissection ND 244 ILOG OPL STUDIO 3 7 USER S MANUAL Parameter Name a and Description Type Possible Values Default Page barStartAlg int 1 Dual is O 1 206 2 Estimate dual 3 Average of primal estimate dual 0 Barrier starting point algorithm 4 Average of primal estimate estimate dual barThreads int O Determined by global thread default 0 208 gt 0 Upper limit on threads for Parallel Barrier Barrier thread limit basInterval int Any positive integer 2 100 000 000 183 Basis file saving frequency BBInterval int 0 Best estimate node always selected 7 190 1 Best bound node always selected MIP strategy BBinterval or Any positive integer bndStrenInd int 1 Automatic 1 185 0 Off Bound strengthening indicator 1 On brDir int 1 Down branch selected first 0 190 0 Automatically determined MIP branching direction 1 Up branch selected first btTol float Any number between 0 and 1 0 9999 200 MIP backtracking tolerance cligues int 1 Do notgenerate cligue cuts 0 201 0 Automatically determined 1 Generate cligue cuts moderately MIP clique cuts indicator 2 Generate clique cuts aggressively coeRedInd int 0 Do not use coefficient reduction 2 186 1 Reduce only to integral coefficients Coefficient reduction setting 2 Reduce all potential coefficients covers int 1 Do not generate cover cuts 0 201 0 Automatically deter
150. imate value of the time at a given location appears in the center of the time scale e Elastic zoom mode First adjust the Activity Domains window to the required size Click on the zoom button then with the left mouse button trace a rectangle around the element s you want to enlarge When you release the mouse button the enlarged image fills the window e Zoom in Click on the button with a sign then click on the image in the main window The image is increased by a factor of 2 each time you click e Zoom out Click on the button with a sign then click on the image in the main window The image is decreased by a factor of 2 each time you click e View all activity domains Click on this button then click in the main part of the window All the activity domains become visible their sizes are adjusted to fit into the window e Create new window Click on this button then trace a rectangle around the element s you want to view in another window A new dockable window is created with a zoom level defined by the rectangle wn Bu O 30 o 6 Uy lt gt a A Q 5 0 gt 2 lt ILOG OPL STUDIO 3 7 USER S MANUAL 115 THE BRIDGE EXAMPLE The Bridge Example Using the distributed project bridgebr prj you can browse the model and select the display domain option select a debug option then execute the model look at the algorithm animation when searching for solutions If
151. ime due to its iterative nature The value can be Automatically determined default Do not apply bound strengthening Apply bound strengthening ILOG OPL STUDIO 3 7 USER S MANUAL 185 d jeojetusyje ii 6 S O e o 3 3 5 e PREPROCESSING 186 Compression of model after presolve Sets the OPL parameter preCompress Specifies whether CPLEX should compress the original model after presolve is performed Compressing can save considerable storage space for large models Under the automatic setting CPLEX will decide whether to perform the compression based on model characteristics The values are Off Automatic default On Coefficient reduction Sets the OPL parameter coeRedInd Determines how coefficient reduction will be used Coefficient reduction improves the objective value of the initial and subsequent LP relaxations solved during branch and bound by reducing the number of non integral vertices Select a value from Do not use Reduce only to integral coefficients Reduce all potential coefficients default Symmetry Sets the OPL parameter symmet ry to determine whether or not symmetry breaking cuts may be added during the preprocessing phase to a MIP model The values are 0 Off default 1 On Preprocessing aggregator fill Sets the OPL parameter aggFill Limits variable substitutions by the aggregator If the net result of a single substitution is more nonzeros than this value the substi
152. in Model then select the Display Search Tree option in addition to Stop at Choice Point 2 Execute the project by clicking on Run 3 Select the View gt Choice Stack menu item 4 Click on Next 3 times Note that with the option Stop at Choice Point OPL Studio does not stop at the fail nodes The n ary tree corresponding to your search is displayed Search Tree x Choice Points 4 Failures 20 Solutions 0 The yellow arrow indicates the current node 5 Double click on the second and then on the third node from the root 148 ILOG OPL STUDIO 3 7 USER S MANUAL VISUALIZING THE SEARCH TREE Choice Points 4 Failures 20 Solutions 0 B gt freql lt c 5 12 gt 19 z 3 gt tryall fin Freqs 3 A green arrow appears next to the node you have selected by the double click and the corresponding lines in the goal stack are highlighted Note You must select a node in the active branch that is a node in the path from the current node yellow arrow to the root Right click on the third node In the context sensitive menu that appears select the Shrink option The subtree is shrunk and replaced by a triangle the color of which depends on the nodes that have been shrunk If a solution has been found in the subtree the triangle is green If the subtree contains only blue nodes Interior nodes i e choice points then it is blue If there are failures in the subtree and no solut
153. in Window x enunnuennnaneeneenunaaana anna 22 1 3 Overview of Commands in the Menu Bar enuenunannaneaneenannnaana 25 1 4 Handles on Dockable Windows 0 0 cee cece eet eee eee eee 33 1 5 Title Bar on Floating Window Windows XP 2000 NT 4 98 urunnnanenenunne 34 1 6 Handle on Floating UNIX Window X Windows xnnenunnnnareaneenunnunana 34 1 7 Selecting a New Model 4 4 ae cee cece mm a bee cee eee ede eee ea ama eee ee m ii 36 1 8 New Model in Main Window x exnennenuenunnunaaaanenneenaenaaaua 37 1 9 Simple OPL Statement in the noname modfil ccc ccc eee eee eens 38 1 10 Error Message Displayed in Console Notebook Page enneruenunnna 39 1 11 Text Editor after Hiding the Output and Model Windows eunuunnnanenunne 42 2 1 Project Window Floating State 2 cece eee eee ee eee eee 54 2 2 Inserta Model File into a Project ooooocoonoonrrnrcnrr eee eee 55 2 3 Project Tree and Editing Area After Inserting a Model File 2 0c cece cece cece 56 2 4 Inserting a Data File into a Project 2 6 cece eee eee 57 2 5 Open Data File Dialog Box es Tes em ee cee a soa elke eit da einen fe lente ca eee Gann a 57 2 6 Loading Data into a Projects 3 usi eeta 62080 Ped a ee 58 2 7 Saving a Project cisco nie aie eee ee ea eka eee ee ee ewe eee eee a tie 59 2 8 Project Tree for pr
154. in the following documents ILOG OPL Studio Component Libraries User s Manual ILOG OPL Studio Component Libraries Reference Manual 1 Open a model in the usual way e select File gt Open gt Model or click on the corresponding button e select the model file from the standard Open File dialog box Ensure that the focus is on the model 2 Select the commands File gt Generate Compiled Model File or click on the corresponding button 93 in the tool bar 3 The extension of the generated file is op1 For example if you generate a compiled model file for queens8 mod the resulting file will be queens8 opl 4 You can specify in your default options settings where you want these generated files to be placed See Setting Miscellaneous Options on page 172 A compiled model is to be used with the OPLsolver API for compiled model files or buffers OPLsolver is described in the ILOG OPL Studio Component Libraries Reference Manual ILOG OPL STUDIO 3 7 USER S MANUAL 241 mb 9 Q O 5 O o o o 5 242 ILOG OPL STUDIO 3 7 USER S MANUAL OPL Parameters The following table presents the OPL parameters in alphabetical order The page numbers refer you to the chapter Mathematical Programming where you will find a detailed description of each parameter Table A 1 OPL Parameters Parameter Name A and Description Type Possible Values Default Page aggCutLim int Any non negative inte
155. ing description of 39 62 display colors 168 error message format 40 Euler example 122 examining activities results 100 101 105 model solutions 63 88 100 variable results 86 87 examples abridge mod using a DB 216 226 bridgebr prj activities domain 116 car seguencing 80 Euler drawing board 122 freguency allocation 130 house building 94 map drawing board 122 production planning 52 sguare drawing board 120 Vellino OPLScript 232 Excel paste results to 88 executing in debug mode 137 models 38 98 ILOG OPL STUDIO 3 7 INDEX next command 140 projects 38 62 85 137 142 scripts 234 termination 152 execution events description 62 85 98 Execution menu Abort 28 All Solutions 28 Browse Active Model 28 Continue Run 29 Next 29 Run 28 Step Out 29 execution steps 71 execution tool bar buttons 32 71 execution tool bar description 23 exported file formats 177 F file export 177 file formats LP 177 MPS 177 REW 177 RLP 177 SAV 177 File menu Close Active Project 26 Close Current Editor 26 Dump Active Model and 26 Generate Compiled Model File 26 New 26 Open 26 Ouit 26 Recent Files 26 Save 26 Save All 26 Save As 26 file naming conventions 35 file saving preferences 47 file types in OPL data file 35 model 35 project 35 script 35 USER S MANUAL 267 INDEX files referenced in OPL OPL Script 172 finalFactor parameter 181 247 Find command 27 Find Next command 27 Find
156. ing model and uses Gantt charts to display results Using the house building example you will open the model file execute the model examine the solution of the problem noting how ILOG OPL Studio handles the display of the activities and resources of a scheduling problem close the model file For this part of the tutorial you will be using the file house2 mod from your release distribution If you used the default directories at installation time you can find this file at the following location on o gt D Q 5 Q U e D 3 For UNIX systems lt installation directory gt OPLSt37 examples opl scheduler For Windows XP Windows 2000 Windows NT 4 and Windows 98 c ILOG OPLSt37 examples opl scheduler ILOG OPL STUDIO 3 7 USER S MANUAL 93 e OL uOnnjos y THE HOUSE BUILDING EXAMPLE The House Building Example 94 This example centers around the activities necessary to build a house and the budget constraints for each of these tasks The house building example shows how OPL and ILOG OPL Studio support scheduling applications through the concepts of activities and resources In OPL an activity can be thought of as an object containing three data items a starting date a duration and an ending date In the example activities are the tasks needed to build a house OPL supports a variety of resources including unary discrete discrete energy state and reservoirs In this example you
157. ion found it is red AN ILOG OPL STUDIO 3 7 USER S MANUAL 149 42 o e 3 0 tet O Ke lt N U 7 O ec 5 e ee gt O VISUALIZING THE SEARCH TREE Using the Slice Based Search You can select other search strategies including the Slice Based Search SBS See the ILOG OPL Studio Language Manual for more information on search strategies We will now try the SBS strategy to see what the Stack and Inspector windows display 1 Stop the execution with the Abort button 2 Select the SBS as follows e Open the Project Options dialog box via the command Options gt Customize Active Project Options e in the Constraint Programming page select Slice Based Search from the Procedure combo box e Click on OK 3 Now rerun the project with the Stepping in Model debug option Don t forget to deselect the previous options 4 Click on the buttons View Choice Stack and Inspect Current Node to make the corresponding docking windows appear 5 Click on the Next button 10 times The Stack window should display 0 gt solve 0 gt forall t in Transmitters 0 gt tryall f in Fregs 1 gt freq lt c 4 t 1 gt 1 1 gt tryall f in Freqs 2 gt freq lt c 5 t 1 gt 3 2 gt tryall f in Freqs 3 gt freq lt c 5 1 22 3 6 Click on the Next button an 11 time The Stack window should now display 0 gt sol
158. ion into the OPL component libraries Data files ey e lt 2 lt lt O Q Large problems are better organized by separating the model of the problem from the instance data The instance data is stored in a data file or in several data files Projects ILOG OPL Studio uses the concept of a project to associate a model file with a number of data files The model file declares the data but does not initialize it The data files contain the initialization of each data item declared in the model The project file then organizes all the related model and data files A project provides a convenient way to maintain the relationship between related files and runtime options for the environment Scripts Script files contain OPLScript a script language for OPL A script handles different models with their data The model and data file are associated in the script itself For example mulprod osc contains the following declaration Model produce mulprod mod mulprod dat editMode The following naming conventions are used to indicate these different files File Extension Description mod Used for files containing models opl Used for compiled model files dat Used for files containing data instances pry Used for project files OSC Used for scripts written in OPLScript The examples in the tutorial chapters of this manual illustrate the use of model data project and scr
159. ipt files with ILOG OPL Studio You will see how to create project files associate model and data files with the project and then find the solution to the problem using the project file The use of scripts is illustrated in Chapter 11 Using OPLScript ILOG OPL STUDIO 3 7 USER S MANUAL 35 ILOG OPL STUDIO BASICS Opening an Existing File The model and data files used in the examples in this manual are distributed with the product In this way you will not have to create these files from scratch but just open them once ILOG OPL Studio is launched To open an existing file select Open gt Model or Data Script Project C File from the File menu ILOG OPL Studio then displays a standard Open File dialog box for you to select the file you want to open Select from the directory ILOG OPLSt37 examples opl If you have recently used the file you can alternatively select it from the Recent Files submenu Creating a New File When you are using ILOG OPL Studio to solve a problem of your own you will first have to define a working document in ILOG OPL Studio You can do this either by opening existing model and data files that you created with a text editor of your choice or by creating the file from scratch using the editing capabilities of ILOG OPL Studio The following is a brief explanation of how to create a model file in ILOG OPL Studio From the File menu select New gt Model OPL Studio ll File Edit View Proje
160. isplay feature of ILOG OPL Studio Dynamic display plays an essential role in the development process as it can bring important insights into the actual behavior of the various constraint solutions Such insights can suggest different search strategies or the addition of redundant constraints The variables of a model can be subject to dynamic display You must first select the display option To see how to use the dynamic display feature in ILOG OPL Studio go to the model browser The tree structure of car prj should still be displayed from the previous section Tf not click the Rebuild Browser Information button E in the tool bar or select Execution gt Browse Active Model from the menu bar Let s look at how ILOG OPL Studio handles the dynamic display of the setup variable Click on setup in the Variables folder then with the cursor on setup click the right mouse button A pop up menu appears with a list of the available display options Specify your selection by checking one of the options display domain each variable is associated with an array of cells Each cell in the array corresponds to a value in the domain of the variable The cell is colored blue or beige based on the presence of that value in the domain display value each variable is associated with an array of cells Each cell in the array corresponds to a value of the variable The cell is colored blue when the value is assigned display interval each
161. ith the active project The active project model always gets executed To find out which project is the active one look at the Projects notebook page the active project is colored red During the execution ILOG OPL Studio analyzes the model and if not already done produces the summary information and updates the structure in the model browser checks for syntactic or semantic errors po y U 0 os sc fto Qe bo IN 9 5 es gt gt executes the model displaying OPL Studio is running in the status bar showing the name alloc prj in the Path Name area and changing the color patch to green 9 stops at the first choice point 4 enters a waiting state displays Stopped at instruction in the status bar displays the line number and column number of the cursor in the editor and changes the color patch to yellow ILOG OPL STUDIO 3 7 USER S MANUAL 137 EXECUTING THE FREQUENCY ALLOCATION PROJECT 138 The Main window now looks like this OPL Studio olx File Edit View Project Execution Debug Options Window Help gt gt co ad GR ct DEN BEM P A oplialloc dat et Aexamplestopltalloc prj A Data j lexample talloc mod 7 nbCells 6 nbFreqs var Fregs maxFreq 9 nbTrans distance P LVE lt forall c in Cells amp ordered t1 t2 in 1 nbTrans c Y Transmitters abs freq lt c t1 gt freq lt c t2 gt gt 16 LJ Cells
162. itsoade kreziina Jipaintine Console Solutions Optimization Loa Solver CPLEX Activities Sorted Activities lle a fin cos MEM Figure 4 9 Sorted Activities Gantt Chart for house2 mod Example 106 ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING THE SOLUTION This notebook page displays all the activities in sorted order Again the horizontal scale shows the duration of the project 21 days The vertical scale lists all the activities this time sorting them by precedence In the center you can again see the chart of the activities with their precedence You can display the same information via the model browser by right clicking on the root item and selecting E Show Sorted Activities Note The Sorted Activities notebook page is displayed by default when a model or project contains activities objects If you do not want the Sorted Activities notebook page displayed you can deselect this option in the Options dialog box for the current project or in the Default options dialog box for all other projects See Setting Output Options on page 169 Looking at the Resources Results To see the results for the resources defined in the model you need to go back to the Solutions notebook page Click the Solutions tab to bring it to the foreground Then use the vertical scroll bar to move down through the solution until you come to budget Discrete Resource budget Discrete Resource consumed by a movi
163. j To compute the optimal solution and prove the optimally this model takes days using Depth First Search and seconds with Slice Based Search The Main window now looks like this ILOG OPL STUDIO 3 7 USER S MANUAL 151 VISUALIZING THE SEARCH TREE File Edit View Project Execution Debug Options Window Help 18 xl En S int nbCells A int nbFreqs range Cells 1 nbCells range Freqs 1 nbFreqs int nbTrans Cells int distance Cells Cells vay rbCels 9 nbFregs 9 nbTrans 9 distance E struct TransmitterType lt 9 Transmitters Cells c int t lt TransmitterType Transmitters lt c t gt c in Cells t in 1 n var Freqs freq Transmitters var Freqs maxFreq solve lt forall c in Cells amp ordered t1 t2 in 1 nbTrans c abs freq lt c t1 gt freq lt c t2 gt gt 16 Solution 1 Freg 4 lt c 1 t 154 26 Freg 4 lt c 1 t 254 42 Freg 4 lt c 1 t 354 58 freq lt c 1 t 4 gt 74 freq lt c 1 t 5 gt 98 freq lt c 1 t 6 gt 106 Console Solutions Optimization Log Solver CPLEX La next son solution Ln 14 Col 76 Waiting Figure 7 20 Main Window After Leaving Debug Mode ILOG OPL Studio displays the first solution and enters the waiting state expecting further direction on how to proceed You can look at further solutions by clicking the Next button or the Co
164. jULim Setting an upper objective function limit will cause CPLEX to halt the optimization process once the maximum objective function value limit has been exceeded This limit applies only during Phase II of the optimization The value can be any number Default 1e Lower objective value limit Sets the OPL parameter objLLim Causes CPLEX to halt the optimization process once the minimum objective function value limit has been exceeded This limit applies only during Phase II of the optimization The value can be any number Default 1e Perturbation constant Sets the OPL parameter epPer Sets the amount by which CPLEX will perturb the upper and lower bounds on the variables when a problem is perturbed This parameter can be set to a smaller value if the default value creates too large a change in the problem The value can be any positive number gt Le Default 1e Perturbation Sets the OPL parameter perInd Indicates whether or not simplex perturbation is turned on Simplex perturbation deals with situations called stalling in which no progress has been made in the objective function over a significant number of iterations If this box is not checked CPLEX determines dynamically during solution whether progress is slow enough to merit a perturbation If this box is checked all problems will be automatically perturbed as optimization begins The situations in which this is useful will be rare and restrict
165. l support of OPL Studio contact your local distributor or if you are a direct ILOG customer contact Region E mail Telephone Fax France oplstudio support ilog fr 0 800 09 27 91 num ro vert 33 0 1 49 08 35 62 33 0 1 49 08 35 10 Germany oplstudio support ilog de 49 6172 40 60 33 49 6172 40 60 10 Spain oplstudio support ilog es 34 91 710 2480 34 91 372 9976 United Kingdom oplstudio support ilog co uk 44 0 1344 661 630 44 0 1344 661 601 Rest of Europe oplstudio support ilog fr 33 0 1 49 08 35 62 33 0 1 49 08 35 10 Japan oplstudio support ilog co jp 81 3 5211 5770 81 3 5211 5771 Singapore oplstudio support ilog com sg 65 6773 06 26 65 6773 04 39 North America oplstudio support ilog com 1 877 ILOG TECH 1 877 8456 4832 toll free or 1 650 567 8080 1 650 567 8001 We encourage you to use e mail for faster better service 14 ILOG OPL STUDIO 3 7 USER S MANUAL Users Mailing List The electronic mailing list op1studio 1listfilog fr is available for you to share your development experience with other OPL users This list is not moderated but subscription is subject to an on going maintenance contract To subscribe to oplstudio list send an e mail without any subject to oplstudio list owner ilog fr with the following contents subscribe oplstudio list your
166. low CPLEX may falsely conclude that a problem is infeasible If you encounter reports of infeasibility during Phase II of the optimization a small adjustment in the feasibility tolerance may improve performance The value can be any number from let to 1e Default 1e7 Iteration limit Sets the OPL parameter net It Lim to determine the maximum number of iterations to be performed before the algorithm terminates without reaching optimality The value can be any non negative integer Default 2100000000 210 ILOG OPL STUDIO 3 7 USER S MANUAL RESULTS OF MATHEMATICAL PROGRAMMING Results of Mathematical Programming Once you have selected your options and executed the Run command the results are displayed in the CPLEX notebook page at the bottom of the Main window ES 4 Primal Phase Dual Phase Barrier MIP Infeasibility Infeasibility Primal objective Nodes 0 y a Iterations Iterations Nodes left 0 alul RE Dual objective Objective Objective 1 8e 003 Iterations 0 Ierations iterations 2 a m Primal Crossover Dual Crossover a EES Push Push Constraints 3 outort Po oo Exchange i siz Exchange Variables 2 Dual phase II Console Solutions Optimization Log Solver CPLEX a OPL Studio is idle 1 solution s found Jexampleslopligas prj This page informs you of the phase that CPLEX is currently in The long bar at the bottom of the notebook page is th
167. m DBread db select from MAX_NF Distance min_af from DBread db select from MIN_AF Distance min_nf from DBread db select from MIN_NF Distance min_sf from DBread db select from MIN_SF Precedence precedences from DBread db select from PRECEDENCE string Resource from DBread db select NAME from RESOURCE TaskResource taskresource from DBread db select from REQUIREMENTS Code Sample 10 2 Initializing OPL Sets Once these sets have been initialized they can be used later in the model just like any other OPL set For example the instruction string Task t lt t d gt in taskduration collects the names of the tasks in a new set of strings called Task Creating a New Table and Updating the Database At the end of the optimization process we want to store the optimal schedule obtained in a new database table First we must collect the results of the optimization in a new OPL set This set called resultSet will contain a record of type Schedule for each task involved in the bridge construction Each record stores the name of the task and its start and end times which were optimally computed by OPL Schedule resultSet lt task t startTime a t start endTime a t start a t duration gt t in Task By using the OPL statement DBexecute you can create a new table called Result which has three columns corresponding to the fields of the record Sche
168. mined 1 Generate cover cuts moderately MIP cover cuts indicator 2 Generate cover cuts aggressively cplexLogFile string Empty by default otherwise a string containing a file Empty 177 name Generates the CPLEX log file ILOG OPL STUDIO 3 7 USER S MANUAL 245 Parameter Name and Description Type Possible Values Default Page cralnd int Primal 1 180 0 Ignore object coefficients during crash 1 or 1 Alternative ways of using objective coefficients Dual 1 Default starting basis Simplex crash ordering 0 or 1 Aggressive starting basis cutLo float Any number 1e75 199 MIP lower cutoff tolerance cutPass int 1 None 0 196 0 Automatically determined Number of cutting plane passes Any positive value to indicate number of passes cutsFactor float Any non negative number 4 0 194 MIP row multiplier factor for cuts cutUp float Any number 1e75 199 MIP upper cutoff tolerance depInd int 1 Determined automatically 1 187 0 Off 1 On at beginning of preprocessing 2 On atend of preprocessing Dependency checker 3 On at beginning and end of preprocessing diveType int 0 Automatically determined 0 193 1 Traditional dive 2 Probing dive MIP dive strategy 3 Guided dive disjCuts int 1 Do not generate disjunctive cuts 0 203 0 Automatically determined 1 Generate disjunctive cuts moderately MIP disjunctive cuts indicator 2 Generate disjunctive cuts aggressively dPrilnd int 0 Determined automatically 0 181
169. minimizing the overall production cost meeting the demand and satisfying the resource constraints Code Sample 2 1 shows the OPL model for this example This model is found in the distributed product mod file enum Products enum Resources struct ProductData float float float float demand insideCost outsideCost consumption Resources ProductData product Products float capacity Resources var float inside Products var float outside Products minimize sum product p insideCost inside p product p outsideCost outside p subject to forall r in Resources sum p in Products product p consumption r inside p lt capacity r forall p in Products inside p outside p gt product p demand y Code Sample 2 1 OPL Model for the Production Planning Example product mod 52 ILOG OPL STUDIO 3 7 USER S MANUAL THE PRODUCTION PLANNING EXAMPLE Code Sample 2 2 shows the data initialization for the problem This can be found in the product dat file of the product distribution Products kluski capellini fettucine Resources flour eggs product kluskt 5 100 O28 O28 5 227 4 capellini lt 200 0 8 0 9 0 4 0 4 gt fettucine lt 300 0 3 0 4 0 3 0 6 gt 1 capacity 20 40 Code Sample 2 2 OPL Data for the Production Planning Example product dat Your first task in this tutorial will be
170. mouse with a wheel between the two buttons you can use the wheel to scroll up and down 22 ILOG OPL STUDIO 3 7 USER S MANUAL ILOG OPL STUDIO MAIN WINDOW Menu Bar Use these menus to choose various commands such as Save in the File menu and to display dialog boxes to perform various tasks Certain menu commands have their own buttons just below the menu bar Tool Bar These buttons are provided for frequently used commands Execution Tool Bar Contains the buttons for commands used during execution mode Work Space Contains a notebook with two pages OIPNIS IdO Projects More than one project can be open at the same time This page displays project tree structures containing all the files related to each project It also displays stand alone models and scripts x O lt 2 lt 24 O Q Model This page displays the model browser containing information about the data structures defined in the active model From the model browser you can select display options for the variables before executing a model and open visualization windows after execution The active model is browsed using one of the following methods e Click the Rebuild Browser Information button li in the tool bar e Select Browse Active Model from the Execution menu e Select Browse Active Model from the model browser root contextual menu accessible through right clicking on the root item e Select Browse Model from the context sensitiv
171. n the menu bar select Options gt Customize Active Project Options In the project tree right click on the project name then select Project Options from the menu Options and files associated with the active project are saved by right clicking on the project name in the project tree then selecting Save the Project See Setting Project Options on page 60 Navigating in the Options Dialog Boxes To select a notebook page either click on a tree item or click on the corresponding tab You can also use the navigation arrows in the top right corner ILOG OPL STUDIO 3 7 USER S MANUAL SETTING CONSTRAINT PROGRAMMING OPTIONS Setting Constraint Programming Options Use the Constraint Prog notebook page to set the default search strategy and search procedure for ILOG Solver Bel ES Constraint Prog MP General Simplex Preprocessing me Strategy mF Lel Default Option onstraint Programming MP General Solver Search Simplex Strategy Preprocessing sanan oo E Mixed Integer Programming io Lip Strategy Procedure P Limits Depth First Search y P Tolerances P Cuts Barrier OIPNIS IdO OK Apply Cancel Reset Sai le lt n O 3 N 5 To e Q Figure 8 1 Default Options Constraint Programming Strategy You can choose from Standard default Dichotomic Procedure You can choose from Depth First Search default Sliced Based Search
172. n the online help select Board and press the F1 key inthe ILOG OPL Studio Language Manual ILOG OPL STUDIO 3 7 USER S MANUAL 119 THE SQUARE EXAMPLE The Square Example Using the distributed model squaregr mod you can execute the model examine the first solution look at the algorithm animation when searching for the remaining solutions If you used the default directories at installation time you can find the squaregr mod file at the following location For UNIX systems lt installation directory gt OPLSt37 examples opl scheduler For Windows XP Windows 2000 Windows NT 4 and Windows 98 c ILOG OPLSt37 examples opl scheduler The aim of the square example is to place a set of small squares of different sizes into a large square The model is solved using scheduling algorithms but the Gantt chart representation used by default for scheduling representation does not fit the natural representation of the problem In our example we create a specific 2D representation by using the Drawing Board In the model we declare a color table containing standard X11 names string colors 1 21 red green blue yellow pink brown magenta cyan white black turquoisel SeaGreenl gold1 IndianRed1 Siennal tanl salmonl orangel tomatol HotPink1 orchid2 1 Next we declare the Drawing Board Note that you can declare more than one if you need to Board b In the
173. nd 196 247 fracCuts 203 248 fracPass 196 248 GUBCovers 248 gubCovers 202 heurFreg 190 248 imp1lBd 202 248 intSolLim 195 248 itLim 183 248 MIPEmphasis 178 248 MIPOrdInd 192 248 MIPOrdType 190 249 MIPThreads 197 249 MIRCuts 204 249 netEpopt 210 249 netEpRHS 210 249 netFind 210 249 netItLim 210 249 netPPriInd 209 249 nodeFilelInd 197 249 nodeLim 194 249 nodeSe1 191 250 ob3Dif 199 250 objLLim 184 250 objULim 184 250 INDEX perInd 184 250 perLim 182 250 PiecewiseCuts 179 250 pPrilnd 181 250 preCompress 186 250 preDual 188 251 prelnd 187 251 prePass 187 251 pres1Nd 192 251 priceLim 182 251 probe 192 251 reduce 188 251 reInv 182 251 relaxPrelInd 187 251 relobjDi 200 251 RINSHeur 193 252 scalnd 181 252 singLim 182 252 startAlg 191 252 strongCandLim 195 252 strongItLim 195 252 strongThreadLim 195 252 subAlg 191 252 subMIPNodeLim 197 252 symmetry 186 252 tiLim 176 253 treLim 196 197 253 varSel 191 253 workDir 179 253 workMem 179 253 Paste button 31 Paste command 27 pathname for compiled models 173 for include files 172 of current file 23 perInd parameter 184 250 perLim parameter 182 250 PiecewiseCuts parameter 179 250 pPrilnd parameter 181 250 preCompress parameter 186 250 preDual parameter 188 251 prelnd parameter 187 200 251 prePass parameter 187 251 preslNd parameter 192 251 ILOG OPL STUDIO 3 7 USER S MANUAL 271 IN
174. ndow lists all the activities for the project The center area shows the starting and ending dates of each task and the precedence relationships among the tasks You can see that masonry begins at day 0 has a duration of 7 days and ends on day 7 Carpentry begins on day 7 has a duration of 3 days and ends on day 10 e 0 uOnnjos y 0 ie O Qa E Q U e E O 3 ILOG OPL STUDIO 3 7 USER S MANUAL 101 EXAMINING THE SOLUTION Solution 1 a olx 9 10 11 1213 14 15 16 17 18 19 20 21 carpentry plumbing ceiling E nad Figure 4 6 Gantt Chart of Activities Results for house2 mod Example Using the Gantt Chart The Gantt chart can display either activities alone or activities and resource allocation Activities are displayed e inthe Activities and Sorted Activities output area e or by double clicking on Activities items in the model browser Activities and resource allocation are displayed for unary resources only by double clicking on the UnaryResources items in the model browser Note Before using the keyboard with the Gantt chart click on the chart in order to give it the keyboard focus In the Activities and Sorted Activities notebook pages if the cursor is outside the chart the z key will take you to the Optimization tab To zoom You can zoom in and zoom out of the chart using the keyboard or the mouse e To zoom in on the time axis there are two possibilities pr
175. nerating Gomory fractional cuts ILOG OPL STUDIO 3 7 USER S MANUAL 247 Parameter Name and Description Type Possible Values Default Page fracCuts int 1 Do notgenerate Gomory fractional cuts 0 203 0 Automatically determined MIP Gomory fractional cuts 1 Generate Gomory fractional cuts moderately indicator 2 Generate Gomory fractional cuts aggressively fracPass int Any non negative integer 0 196 Pass limit for generating Gomory fractional cuts GUBCovers int 1 Do not generate GUB cuts 0 202 0 Automatically determined 1 Generate GUB cuts moderately MIP GUB cuts indicator 2 Generate GUB cuts aggressively heurFreq int 1 None 0 190 0 Automatic MIP heuristic frequency or Any positive integer imp1Bd int 1 Do not generate implied bound cuts 0 202 0 Automatically determined 1 Generate implied bound cuts moderately MIP implied bound cuts 2 Generate implied bound cuts aggressively indicator intSolLim int Any positive integer 2 100 000 000 195 MIP solution limit itLim int Any non negative integer 2 100 000 000 183 Simplex maximum iteration limit MIPEmphasis int 0 Balance optimality and feasibility 0 178 1 Emphasize feasibility over optimality 2 Emphasize optimality over feasibility 3 Emphasize moving best bound MIP emphasis indicator 4 Emphasize hidden feasibles MIPOrdInd int 0 Off 1 192 1 On MIP priority order indicator 248 ILOG OPL STUDIO 3
176. ng over 26 36 in capacity 1666 consumed by a garden over 15 38 in capacity 1666 consumed by a facade over 15 36 in capacity 2666 consumed by a windows over 11 36 in capacity 1666 consumed by a painting over 18 36 in capacity 2000 i consumed by a roofing over 16 36 in capacity 1666 consumed by a ceiling over 15 38 in capacity 3666 consumed by a plumbing over 7 36 in capacity 8666 consumed by a carpentry over 7 36 in capacity 30090 consumed by a masonry over 8 38 in capacity 7666 Console Solutions Optimization Log Solver CPLEX Activities Sorted Activities 4 next solution Ln 3 Col 52 Waiting Figure 4 10 Discrete Resource Results for house2 mod Example The results show how the budget resources for each task are consumed for the life of the project The tasks are listed in reverse order of their precedence Go to the last line to look at the masonry budget resources This line shows that masonry consumes 7 000 1 000 for each day of its 7 day duration The 0 30 indicates that the resource is consumed from day 0 which is the start time of the masonry task to day 30 which is the end of the project The value of 30 comes from the scheduleHorizon 30 statement in the model file see Code Sample 4 1 The carpentry task consumes 3000 of the budget beginning at day 7 and ILOG OPL STUDIO 3 7 USER S MANUAL 107 e 0 uonnjos y wn ie 3 O Qa E 5 Q U
177. ng basis factorization Increasing the Markowitz threshold may improve the numerical properties of the solution The value can be any number between 0 0001 and 0 99999 Default le Optimality tolerance Sets the OPL parameter epopt Influences the reduced cost tolerance for optimality This parameter governs how closely CPLEX must approach the theoretically optimal solution 09 04 The value can be any number between le and le Default 1e9 Feasibility tolerance Sets the OPL parameter epRHS The feasibility tolerance specifies the degree to which a problem s basic variables may violate their bounds This tolerance influences the selection of an optimal basis and can be reset to a lower value when a problem is having difficulty maintaining feasibility during optimization You may also wish to lower this tolerance after finding an optimal solution if there is any doubt that the solution is truly optimal If the feasibility tolerance is set too low CPLEX may falsely conclude that a problem is infeasible If you encounter reports of infeasibility during Phase II of the optimization a small adjustment in the feasibility tolerance may improve performance 09 0101 118100 31 5703 22 o z D a gt O 3 D le 9 04 The value can be any number between le and le Default 1e 9 ILOG OPL STUDIO 3 7 USER S MANUAL 183 OPTIMIZATION USING SIMPLEX Upper objective value limit Sets the OPL parameter ob
178. ning solutions without further intervention For this example let s go to the next solution Click the Next button in the tool bar Sse M ILOG OPL STUDIO 3 7 USER S MANUAL 71 CONTINUING THE EXECUTION ILOG OPL Studio continues its computation Since there is only one solution to this model it completes its execution and returns to its idle state The status bar displays OPL Studio is idle 1 solution s found and the color patch returns to blue OPL Studio olx Ele Edt View Project Execution Debug Options window Help ATATA EEE BATEA R E Model Browser emply i lexamplestopiproductdat Sp Bi iexamplestopiiproduct mod enum Products proc enum Resources struct ProductData lt float demand float insideCost float outsideCost float consumption Resources ProductData product Products float capacity Resources YE Model 1 Projects 44 jOptimal Solution ba JO tectie Value 372 6066 inside kluski inside capellini inside fettucine outside kluski 66 6666 outside capellini 266 6666 outside fettucine 366 6666 Console Solutions Optimization Log Solver CPLEX La forista Studio is idle 1 solution s found Ln 12 Colt Figure 2 18 Main Window After Executing product prj Example Notice also that in the model browser the tree structure has collapsed and no longer shows the data structures 72 IL
179. nnannnnnenenannnna unne na 86 Alternative View of slot Variable Results for Solution 1 enenununeuennunua 86 setup Variable Results for Solution 1 enrnuunuunannununeuannunan nunna 87 Alternative View of setup Variable Results for Solution 1 enennunuunnannne 87 Model Browser for car pr3 Floating State ennnnunenaenununnnenannnnnne 89 Selecting a Dynamic Display Option enenennanenenen nene nen enne ne nene nn 91 Setup Notebook Page Showing Boolean Display uenuanunnunnnan unne nen 92 Main Window for the House Building Example ee eee eee eee eee nn nn 96 Model Browser for house2 mod Floating State nnnuenannunuunuanannenane 97 Main Window with house2 mod Solution nuenennnnenenaenununnnanan nen nne 99 Activities Results for house2 mod Example neuen uanuanuanuan naa nen nen nunnu 100 Alternative View of Activities Results for house2 mod Example ces cee cence eee eee eee eee 101 Gantt Chart of Activities Results for house2 mod Example 00 cece cece eee eens 102 Gantt Chart Split into Four Views 2 4 it a Be ea Siete ue ee Ae esti eels taani 104 Activities Notebook Page for house2 mod Example cece cece eee nee eee eee eee eee 105 Sorted Activities Gantt Chart for house2 mod Example 0 cece eee eee eee eee eee eee 106 Discrete Resource Results for house2 mod EXample cece c
180. nning linear programming displaying solution Next solution Console Solutions Optimization Log Solver CPLEX La Next solution tn 1 con Waiting Figure 2 13 Log Notebook Page for product prj Example The information displayed in the log notebook page is of the following type status changes 64 ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING A SOLUTION TO THE MODEL file loadings results of analyzing a model You can consult this log information to find out which kind of algorithm OPL Studio has switched to when analyzing a model In our example the Log notebook page displays the linear programming message OPL Studio has detected a linear problem so it uses ILOG CPLEX as the solving engine The type of algorithm used varies according to the model analyzed and can be one of the following linear programming CPLEX piecewise linear programming CPLEX MIP piecewise linear programming Solver MIP integer programming CPLEX MIP N 38 2x 0 5 20 g integer programming Solver integer programming Solver MIP mixed integer programming CPLEX MIP mixed integer programming Solver MIP Solver Solver Scheduler Solver Hybrid 9 9 9 9 9 48 0 9 0 9 OH 2 Solver Hybrid Scheduler Solver Notebook Page Click the Solver tab to view statistics that ILOG OPL Studio gathered while solving the model They correspond to ILOG Solver library statistics i 4
181. nodes Figure 7 25 Exploring the Search Tree in the Slice Based Search The corresponding state of the Drawing Board is shown below the colors have no special meaning ILOG OPL STUDIO 3 7 USER S MANUAL 161 42 O o 2 TS 42 tet e O Q lt N UT T O ec 5 e ee gt O TERMINATING ILOG OPL STUDIO Drawing Board x pr 7 mas t Kaama E ree j NAN A AQUEL A A 7 Click on the Abort button Return to the Options dialog box and reselect the Depth First Search as search strategy Click on OK Terminating ILOG OPL Studio This completes the explanation of displaying the search with ILOG OPL Studio This also concludes the ILOG OPL Studio tutorial By now you should be able to perform all the basic tasks and start creating and executing your own projects with ILOG OPL Studio If you are finished using ILOG OPL Studio you can terminate the session by selecting Quit from the File menu 162 ILOG OPL STUDIO 3 7 USER S MANUAL Customizing ILOG OPL Studio To customize ILOG OPL Studio to suit your particular needs you can set constraint programming options specify editor options OIPNIS IdO specify output options 2 O E o 9 3 N 5 a e e specify options for makefile generation indicate paths for model and script files 9 9 9 0 4 set options for mathematical programming described in Chapter 9 Mathematical Programmin
182. nt 1 No node presolve 0 192 0 Automatic Node presolve selector 1 Force node presolve priceLim int 0 Determined automatically 0 182 or Any positive integer Simplex pricing candidate list size probe int 1 No probing 0 192 0 Automatic 1 Probing level 1 2 Probing level 2 MIP probe 3 Probing level 3 reduce int 0 No primal and dual reductions 3 188 1 Only primal reductions 2 Only dual reductions Primal and dual reduction type 3 Both primal and dual reductions relnv int 0 Determined automatically 0 182 or Any positive integer Simplex refactorization frequency relaxPreInd int 0 Off 0 187 1 On Relaxed LP presolve indicator relObjDif float Any non negative number 0 0 200 MIP relative objective difference cutoff ILOG OPL STUDIO 3 7 USER S MANUAL 251 Parameter Name and Description Type Possible Values Default Page RINSHeur int 1 None 0 193 0 Automatic MIP strategy RINS heuristic or any positive integer scalnd int 1 No scaling 0 181 0 Equilibration scaling method Scale parameter 1 More aggressive scaling singLim int Any non negative integer 10 182 Simplex singularity repair limit startAlg int 0 Controlled by LP Method 0 191 1 Primal simplex 2 Dual simplex 3 Network simplex 4 Barrier MIP starting LP algorithm strongCandLim int Any positive integer 10 195 MIP candidate list strongItLim int Any positive integer 0 195 MIP simplex iterations strongTh
183. nt 29 Stop at Solution 29 Edit Comment 27 Complete Word 27 Copy 27 Cut 27 Find 27 Find Next 27 Find Previous 27 Go To 27 Indent Lines 27 Kill Line 27 Outdent Lines 27 USER S MANUAL Paste 27 Recenter 27 Redo 26 Replace 27 Select All 27 Uncomment 27 Undo 26 Execution Abort 28 All Solutions 28 Browse Active Model 28 Continue Run 29 Next 29 Run 28 Step Out 29 File Close Active Project 26 Close Current Editor 26 Dump Active Model and 26 Generate Compiled Model File 26 New 26 Open 26 Quit 26 Recent Files 26 Save 26 Save All 26 Save As 26 Help Contents 30 Keyword Help 30 Options Customize Active Project Options 29 164 Customize Default Options 29 164 Project Add New Data File 28 Add New Model File 28 Browse Model 28 Close Project 28 Insert Existing Data File 28 Insert Existing Model File 28 Project Options 28 Save the Project 28 Save the Project As 28 Set as Active Project 28 ILOG OPL STUDIO 3 7 INDEX View Choice Stack 28 Inspect Current Node 28 Output 28 Workspace 27 Window Cascade 29 Tile Horizontally 29 Tile Vertically 29 comment colors 168 Comment command 27 compiled model files 26 compiled models 173 Complete Word command 27 configuration file op1st3 config 18 Console notebook page 40 constraint programming options 165 Continue Run button 32 40 71 Continue Run command 29 continuing executions car sequencing 88 production planning 71 Copy button 31 Copy command 27 co
184. nteger solutions that are worse than or the same as those previously generated but will not necessarily result in the generation of all possible integer solutions Suuwe1bB01d o z D a gt O 3 D le 9 The value can be any number Default 0 ILOG OPL STUDIO 3 7 USER S MANUAL 199 MIXED INTEGER PROGRAMMING Relative objective difference cutoff Sets the OPL parameter rel0b3Dif Used to update the cutoff each time a MIP solution is found The value is multiplied by the absolute value of the integer objective and subtracted from added to the newly found integer objective when minimizing maximizing This forces the MIP optimization to ignore integer solutions that are not at least this amount better than the one found so far This parameter can be adjusted to improve problem solving efficiency by limiting the number of nodes however setting this parameter at a value other than zero the default can cause some integer solutions including the true integer optimum to be missed If both re10b3Dif and objDif are nonzero the value of ob3Dif will be used The value can be any positive number Default 0 Backtracking tolerance Sets the OPL parameter bt Tol Controls how often backtracking is done during the branching process The decision when to backtrack depends on three values that change during the course of the optimization the objective function value of the best integer feasible solution incumben
185. ntinue Run button ILOG OPL Studio continues the execution and produces all the remaining solutions if they exist Otherwise to terminate the execution you can click the Abort button ES 152 ILOG OPL STUDIO 3 7 USER S MANUAL COOPERATING SOLVERS COMBINED LP AND CP Cooperating Solvers Combined LP and CP The keywords minimize with linear relaxation instead of minimize ensure that OPL uses the linear relaxation on all linear constraints Thus CPLEX will produce a lower bound at each node of the Solver search tree In this section we will take the example wareboth prj to visualize the search tree which will be explored in both cases using linear relaxation not using linear relaxation First open the project examples opl wareboth prj The example is described in the ILOG OPL Studio Language Manual In this problem a company is considering a number of locations for building warehouses to supply its existing stores Each possible warehouse has a fixed maintenance cost and a maximum capacity specifying how many stores it can support In addition each store can be supplied by only one warehouse and the supply cost to the store varies according to the warehouse selected The application consists of choosing a the warehouses to build and b which of them should supply the various stores in order to minimize the total cost i e the sum of the fixed and supply costs po y O 0 os Cc G Qe kn IN 9 5 82 gt
186. ny positive number gt Le Default 1e8 ILOG OPL STUDIO 3 7 USER S MANUAL BARRIER ALGORITHM 4 Growth limit Sets the OPL parameter barGrowth This parameter is used to detect unbounded optimal faces At higher values the barrier algorithm will be less likely to conclude that the problem has an unbounded optimal face but more likely to have numerical difficulties if the problem has an unbounded face The value can be any positive number Default 1e Objective range Sets the OPL parameter barObjRng to specify the maximum absolute value of the objective function The barrier algorithm looks at this limit to detect unbounded problems The value can be any positive number Default 1e Column nonzeros Sets the OPL parameter barCo1Nz This parameter is used in the recognition of dense columns If columns in the presolved and aggregated problem exist with more entries than the given value such columns will be considered dense and will be treated specially by CPLEX barrier to reduce their effect Note If the problem contains fewer than 400 rows dense column handling will not be initiated The value can be dynamically calculated or any positive integer Default 0 Suuwe1bB01d o z D a gt O 3 D le 9 ILOG OPL STUDIO 3 7 USER S MANUAL 207 BARRIER ALGORITHM Iteration limit Sets the OPL parameter barItLim Specifies the number of barrier iterations before termination When set t
187. o 0 no barrier iterations occur but problem set up occurs and information about the setup is displayed such as Cholesky factorization information The value can be 0 No barrier iterations or any positive integer Default 2 100 000 000 Maximum correction limit Sets the OPL parameter barMaxCor to specify the maximum number of centering corrections done on each iteration An explicit value greater than 0 may improve the numerical performance of the algorithm at the expense of computation time The value can be 1 Automatically determined default 0 None or any positive integer Out of core barrier indicator Sets the OPL parameter barooc to specify whether the barrier optimizer should use out of core storage on disk for the Cholesky factorization Disk usage is controlled by the parameters workmem and workDir By default this parameter is set to off Check the box to use out of core storage Barrier thread limit Sets the OPL parameter barThreads 0 Limit determined by global thread default gt 0 Upper limit on threads for Parallel Barrier 208 ILOG OPL STUDIO 3 7 USER S MANUAL NETWORK SIMPLEX ALGORITHM Network Simplex Algorithm Default Options 0 y Constraint Programming Mathematical Programming Pricing Optimality tolerance 1e 006 Automatic zl Feasibility tolerance 1e 006 B Mixed Integer Programming Network extraction level Iteration limit 2100000000 MIP Limits MIP Toleran
188. oduct prJ Example uuuunuuuununuunnnunna nen u nne ne E 59 2 9 Project Options Notebook xnenneruenunnunnnannnenaenaenaennana 60 2 10 Model Browser for product pr3 Example cece cece nen eens 62 2 11 Nextsolution Mess ge 4 4 2 see ats mid a ee nie later Maa aaa era Rake lade eee aa 63 2 12 Solutions Notebook Page for product prj Example cece cece cece ee eee eee 64 ILOG OPL STUDIO 3 7 USER S MANUAL 255 FIGURES 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 13 4 14 4 15 7 1 7 2 7 3 256 Log Notebook Page for product prj EXample 2 0 cece eee 64 Solver Notebook Page for product prj Example 2 eee eee eee 65 CPLEX Notebook Page for product prj Example 2 ce cece eee eee 66 Model Browser for product mod Fil cc eee ec ee ee eee eee ees 67 Open View Button x aii A A erin ede 1900 0 tala Grane le ate 68 Main Window After Executing product prj Example 2 e eee eee 72 Project Tree in the Work Space 1 cece cece eee eee eee eee eee eee eee 74 Setting an Active Projects clei iid eee A Ce eke en edited 75 Loading a Data File for the Car Sequencing Example n n eee eee eee eee 83 Main Window for the Car Sequencing Example nnunnueuannununn eee eee 84 slot Variable Results for Solution 1 ennnuuuu
189. oject data or script file Opens a file Displays a submenu to specify a model project data script or C file Files that you have used recently can be opened by selecting the file names from the submenu Saves the current edited file Saves the current edited file with a new name Saves all the open files Closes the current edited file Closes the active project Allows you to save current ILOG OPL Studio information to a file OPL Studio saves all the model and data files for the active project anything in the Solutions and Optimization windows and the current user settings for solving the problem Generates a compiled OPL model op1 file from the active model Quit Exits ILOG OPL Studio Edit Undo Undoes an unlimited number of nested actions in the current editor Redo Redoes previously undone actions in the current editor unlimited ILOG OPL STUDIO 3 7 USER S MANUAL ILOG OPL STUDIO MAIN WINDOW Table 1 1 Commands in the Menu Bar Continued Find Previous Replace Go To Recenter Indent Lines Outdent Lines Command Description Cut Deletes the selected text from the editor and puts it in the clipboard Copy Copies the selected text from the editor or output window to the clipboard Paste Pastes from the clipboard to the current editor Kill Line Deletes a line from the cursor position onward and appends it to the clipboard Select All Selects the entire c
190. ojects viewer and select the menu item Set As Active Project as shown in Figure 2 20 Workspace XI i config mod Se ive Project L esi mai 9 Add New Model File E vellino osc 18 Add New Data File 9 Insert Existing Model File ta Insert Existing Data File 8 Save the Project E Save the Project As Close Project E Browse Model pe Project Options v 2 o Q 7 YUM BUOM Z E Model Projects Figure 2 20 Setting an Active Project To change a project s options or close a non active project right click on the corresponding tree item Removing a File from a Project To remove a model or data file from a project right click on the corresponding file name and select Remove from Project Ed config pri co nfig mod 3 Load E Remove from Project ILOG OPL STUDIO 3 7 USER S MANUAL 75 WORKING WITH SEVERAL PROJECTS Setting the Active Model For a stand alone model select Set As Active Model E Aexamplestopli product prj 8 productmod a productn dat EF B examples ophtconfig prj ik config mod E 3 config dat LE vellino osc Set as Active Model EX Close Browse Model y Customize Default Options E Model Projects Setting the Active Script For a stand alone script select Set As Active Script a Aexamplesroplkproduct prj pod product mod i beig productn dat oD examples opl contig prj
191. olver CPLEX Activities Sorted Activities J o ps pi ls gt 2 pue ou a ne son solution tn 1 ott Waiting Figure 4 3 Main Window with house2 mod Solution Note that because the model file contains an optimization statement minimize ILOG OPL Studio has found the optimal solution to the problem While OPL Studio is in the waiting state and before you continue you have the opportunity to examine the results e OL uOnnjos y e le 3 O Qa E Q U e O 3 ILOG OPL STUDIO 3 7 USER S MANUAL 99 EXAMINING THE SOLUTION Examining the Solution The results of Activities and Resources are the important things to look at in this example Let s first look at the Activities results and see how ILOG OPL Studio displays those results Then let s look at how ILOG OPL Studio displays the results for Resources Looking at the Activities Results First go to the Solutions notebook page The first line shows that the duration of the project taking into account the precedence and budget constraints is 21 days The next part of the solution shows the schedule for the tasks These are the results for the Activities of the problem and are shown as an activity vector The data is in the format of s a gt e The activity starts at time s for a duration of d units of time and is completed at time e For example you can see that masonry begins at time 0 has a duration of
192. on 94 Add New Data File command 28 Add New Model File command 28 Add Remove Breakpoint button 32 adding data files to projects 57 58 model files to projects 55 58 advanced options 171 aggCutLim parameter 203 243 aggFill parameter 186 243 aggInd parameter 186 243 algorithm animation 116 algorithms used for solving 65 All Solutions command 28 alternative data files 73 B backtrackable 2D graphics 119 ILOG OPL STUDIO 3 7 barAlg parameter 205 244 barColNz parameter 207 244 barCrossAlg parameter 206 244 barEpComp parameter 206 244 barGrowth parameter 207 244 barItLim parameter 208 244 barMaxCor parameter 208 244 barObjRng parameter 207 244 bar00C parameter 244 bar00C parameter 208 barOrder parameter 206 244 barStartAlg parameter 206 245 barThreads parameter 208 245 basic concepts checking for syntactic errors 39 creating files 36 executing models or projects 38 opening files 36 processing directives 40 terminating ILOG OPL Studio 40 basInterval parameter 183 245 batch mode 18 BBInterval parameter 190 245 bndStrenInd parameter 185 245 Board keyword 119 brDir parameter 190 245 breakpoints 240 Browse Active Model command 28 Browse Model command 28 btTol parameter 245 USER S MANUAL Index 263 INDEX building the data structure 89 96 buttons Abort 32 40 71 Add Remove Breakpoint 32 Close Current Editor 31 Continue Run 32 40 71 Copy 31 Cut 31 Generate Compiled Model File
193. one of three ways click the Continue Run button click the Abort button click the Next button to follow the entire execution of the script instruction by instruction In this case in order to avoid loops you may use the Step Out button as explained previously ILOG OPL STUDIO 3 7 USER S MANUAL 239 ADDING AND REMOVING BREAKPOINTS Adding and Removing Breakpoints You can place breakpoints against lines of code at which you want the execution to stop either to display the value of a variable or to continue the execution by clicking the Next button 1 Uncheck the Stepping in Script option from the Debug menu In the editor click on the line if pro nextSolution 2 Select the menu item Debug gt Add Remove Breakpoint A red dot appears in the margin 3 Run the script It stops at the specified line 4 By clicking on Next you can step in the subsequent lines of the script You can also continue the execution by clicking the Continue Run button Closing the Script File 240 When you have completed the execution of a script you can close the script file by selecting Close Current Editor from the File Menu ILOG OPL STUDIO 3 7 USER S MANUAL 12 Generating Compiled Models In this chapter you will learn how to generate compiled models that can be used with the OPL Component Libraries Here the basic steps are given for generating a compiled model Examples and more detailed information are provided
194. ons that are similar to the current incumbent 4 RINS heuristic Sets the OPL parameter RINSHeur to determine how often to apply the relaxation induced neighborhood search RINS heuristic The values are 1 Turns off the RINS heuristic 0 Applies the RINS heuristic at an interval chosen automatically by CPLEX default Any positive integer to apply the RINS heuristic at the requested node interval For example setting RINSHeur to 20 indicates that the RINS heuristic will be called at nodes 0 20 40 60 etc Burwiweiboldg o z D a gt O 3 D le 9 ILOG OPL STUDIO 3 7 USER S MANUAL 193 MIXED INTEGER PROGRAMMING MIP Limits Default Options Constraint Programming E Mathematical Programming MP General 4e 000 Simplex Preprocessing ixed Integer Programming 2100000000 2100000000 MIP Tolerances MIP Cuts Barrier Network Graphical User Interface Editor 1 28e 002 Output Advanced Miscellaneous Node file in memory and compressed E 0K _ Apply canosi Reset Row multiplier factor for cuts Sets the OPL parameter cutsFactor Limits the number of both cligue and cover cuts that can be added The number of rows in the problem with cuts added is limited to this value times the original number of rows The value can be any positive number Default 4 Node limit Sets the OPL parameter nodeLim Determines the maximum number of nodes solved
195. ontent of the current editor Find Displays the Find dialog box for specifying search criteria Find Next Finds the next occurrence of the text displayed in the Find box Finds the previous occurrence of the text displayed in the Find box Displays the Replace dialog box for specifying search criteria and replacing specified strings Displays the Go To dialog box for specifying a line where the cursor should be placed in the work space Places the current line in the middle of the window if possible Adds a tabulation at the beginning of selected lines Removes a tabulation from the beginning of selected lines Comment Transforms selected lines to comments Uncomment Uncomments selected lines Complete Word Searches upward for a string in the same file and completes with the first string that matches the same beginning letters The search begins upward at the left of the current cursor position View Workspace Displays the Workspace notebook containing the model browser and the project tree ILOG OPL STUDIO 3 7 USER S MANUAL 27 OIPNIS IdO O lt 2 lt lt e Q ILOG OPL STUDIO MAIN WINDOW 28 Table 1 1 Commands in the Menu Bar Continued Command Description Output Choice Stack Inspect Current Node Displays the Output area Displays the Stack dialog box Displays the Inspect dialog box Project Set as Active Project Add New Model
196. ontrol Ctrl x Control and x keys simultaneously Table 1 2 Editor Functions Action Visual Mode Emacs Mode Save Ctrl s Ctrl x Ctrl s or ESC x save buffer Save All Ctrl x s or ESC x save some buffers Save As Ctrl x Ctrl w or ESC x write file Undo Ctrl z Ctrl x u or Ctrl or ESC x undo Redo Ctrl y Ctrl xr Next character right gt Ctrl f or gt or ESC x forward char Previous character left lt Ctrl b or lt or ESC x backward char Next line down Ctrl n or 4 or ESC x next line Previous line up T Ctrl p or or ESC x previous line Next screen down Page Down Ctrl v or PageDown or ESC x scroll down Previous screen up Page Up ESC v or PageUp or ESC x scroll up Beginning of file Ctrl Home ESC lt or Home or beginning of buffer ILOG OPL STUDIO 3 7 USER S MANUAL 43 OIPNIS IdO ey e lt 2 lt lt O Q THE TEXT EDITOR 44 Table 1 2 Editor Functions Continued Action Visual Mode Emacs Mode End of file Ctrl End ESC gt or End or ESC x end of buffer Next word right Ctrl Ctrl gt or ESC f or ESC x forward word Previous word left Ctrl lt Ctrl lt or ESC b or ESC x backward word Beginning of line Home Ctrl a or ESC x beginning of line End of line End Ctrl e or ESC x end of line Delete character af
197. oop 237 OPLScript features 231 oplst3 config file 18 Optimization notebook page 64 109 optimization statement 99 109 options activities 170 advanced 171 console font 170 constraint programming 165 270 ILOG OPL STUDIO 3 7 output 169 pathname for compiled models 173 precision 170 project 60 61 sorted activities 170 textual result 170 Options menu Customize Active Project Options 29 164 Customize Default Options 29 164 options setting 75 Oracle 224 225 Outdent Lines command 27 Output command 28 output notebook description 23 output options hide zeros 169 setting 169 square matrix 169 p parameters aggCutLim 203 243 aggFi11 186 243 aggind 186 243 barAlg 205 244 barColnz 207 244 barCrossAlg 206 244 barEpComp 206 244 barGrowth 207 244 barItLim 208 244 barMaxCor 208 244 barO0bjRng 207 244 barooc 208 244 barOrder 206 244 barStartAlg 206 245 barThreads 208 245 basInterval 183 245 BBInterval 190 245 bndStrenInd 185 245 brDir 190 245 btTol 200 245 cliques 201 245 coeRedInd 186 245 covers 201 245 USER S MANUAL cplexLogFile 177 245 craInd 180 246 cutLo 199 246 cutPass 196 246 cutsFactor 194 246 cutUp 199 246 depind 187 246 disjCuts 203 246 diveType 193 246 dPriInd 181 246 epAGap 198 247 epGap 198 247 epInt 199 247 epMrk 183 247 epOpt 183 247 epPer 184 247 epRHS 183 247 finalFactor 181 247 flowCovers 202 247 flowPaths 203 247 fracCa
198. options for a model debugging session Stepping in model ILOG OPL Studio stops at each instruction in the search procedure Stop at choice point ILOG OPL Studio stops at each choice point Stop at solution ILOG OPL Studio stops at each solution in an optimization Display Search Tree The search tree is displayed 6 Add Remove Breakpoint A breakpoint breaks the execution in the search procedure This is useful when you want to run guickly through part of the execution then stop and display the value of a variable or continue the execution by clicking Next To begin this example we will run ILOG OPL Studio in debug mode and stop at each choice point Select the option Stop at Choice Point Once you have selected a debug option from the menu ILOG OPL Studio is in debug mode File Edit View Project Execution Debug Options Window Help BSLBEUAE __ Stepping inModel Stepping m Script Y Stop at Choice Point Stop at Solution Display Search Tree M Add Remove Breakpoint F9 Figure 7 6 Debug Menu ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE FREQUENCY ALLOCATION PROJECT Executing the Frequency Allocation Project You can now execute the project with ILOG OPL Studio in debug mode Click the Run button E in the tool bar of the Main window Note If you happen to have other models open in the Main window ILOG OPL Studio always gives precedence to the model associated w
199. ption 142 Stop at Choice Point 136 debugging OPL scripts stepping in a script 236 stepping out from a loop 237 Default Options dialog box 164 depInd parameter 187 246 266 ILOG OPL STUDIO 3 7 dialog boxes Color Chooser 168 Default Options 164 Font Chooser 167 Project Options 60 disjCuts parameter 203 246 displaying activities results 100 101 105 Inspector window 139 144 model data structure 89 96 results 90 sorted activities 106 Stack window 139 144 variable arrays 87 diveType parameter 193 246 dockable elements 33 docking a window 34 dPrilnd parameter 181 246 drawing board docking undocking 119 121 setting the docking option 171 172 the Euler example 122 the map example 122 the square example 120 Dump Active Model and Result command 26 dynamic display 90 113 E Edit menu Comment 27 Complete Word 27 Copy 27 Cut 27 Find 27 Find Next 27 Find Previous 27 Go To 27 Indent Lines 27 Kill Line 27 Outdent Lines 27 Paste 27 Recenter 27 Redo 26 Replace 27 USER S MANUAL Select All 27 Uncomment 27 Undo 26 editing area description 23 editing mode 37 editor customizing 46 Emacs mode 43 how to use 41 loading data 133 Multi Document Interface 41 quick reference 43 visual mode 43 46 editor colors 168 epAGap parameter 198 247 epGap parameter 198 247 epInt parameter 199 247 epMrk parameter 183 247 epOpt parameter 183 247 epPer parameter 184 247 epRHS parameter 183 247 error check
200. r of each window reminds you of the file type e model file e data file e script file T C file Resizing an Editor Window An editor window may have three states minimized normal or maximized By default it is maximized The buttons on the right hand side of the menu bar 2 5 xj enable you to minimize restore to normal size or close the editor By hiding the docked windows you can use almost all the screen for editing as shown in Figure 1 11 OPL Studio 1examplestopliknapsack mod Al x Ele Edit View Project Execution Debug Options Window Help lal xl 606885049 22 Bb08 EA int nbltens int nbResources range Items 1 nbItens range Resources 1 pi ajad int capacity Resources 5 int value Items int use Resources Itens int maxValue max r in Resources capacity r var int take Items in 8 maxValue maximize sum i in Items value i x take i subject to forall r in Resources sum i in Items use r i take i lt capacity r Console Solutions Optimization Log Solver CPLEX Project loaded Ln 1 Col1 Figure 1 11 Text Editor after Hiding the Output and Model Windows ILOG OPL STUDIO 3 7 USER S MANUAL THe Vexr EDITOR Editor Quick Reference In addition to the default Visual Mode see Setting Editor Options on page 166 an Emacs mode that emulates Emacs key bindings is available Note Ctrl C
201. r syntactic or semantic errors 4 executes the model displaying ILOG OPL Studio is running in the status bar showing the name house2 mod in the Path Name area and changing the color patch to green displays the results in the notebook pages of the output window enters a waiting state when the optimal solution is found displays Next solution in the status bar and changes the color patch to yellow ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE MODEL The Main window now looks like this OPL Studio examples opl scheduler house2_ mod olx File Edit View Project Execution Debug Options Window Help TES enum Tasks masonry carpentry plumbing ceiling roofing painting windows facade garden moving int duration Tasks 7 3 8 3 1 2 1 2 1 1 scheduleHorizon 36 Activity a t in Tasks duration t a 8 Discrete Resources E i budget DiscreteResource budget 29000 minimize a moving end subject to lt a masonry precedes a carpentry a masonry precedes a plumbing a masonry precedes a ceiling a carpentry precedes a roofing E Model Projects 8 7 gt 7 a carpentry 7 3 gt 18 a plumbing 7 8 gt 15 15 3 gt 18 18 1 gt 11 a painting 18 2 gt 28 a windows 11 1 gt 12 15 2 gt 17 Console Solutions Optimization Log S
202. rances H MIP Cuts i Barrier L Network Graphical User Interface Editor Output Advanced Miscellaneous EO NOR Figure 2 9 Project Options Notebook 60 ILOG OPL STUDIO 3 7 USER S MANUAL CREATING A PROJECT To navigate through the notebook you can either click on elements in the tree structure or click on a tab Within the notebook pages you can set options for constraint programming for ILOG Solver and ILOG Scheduler linear optimization for ILOG CPLEX optimization using simplex for ILOG CPLEX mixed integer programming for ILOG CPLEX the barrier algorithm for ILOG CPLEX the network simplex algorithm for ILOG CPLEX the text editor labels and output 9 9 9 9 4 paths for OPL and OPLScript files and for compiled model generation N 38 2x 0 5 20 g To set the project options click Apply then OK in the notebook To save these options right click on the project name in the project tree then select a Save the Project The new options are stored in the current pr j file and restored automatically when the project is re opened They do not affect files that are not associated with the current project To set default options for all files see Chapter 8 Customizing ILOG OPL Studio For the present production planning example you are going to use the delivered defaults so just click Cancel ILOG OPL STUDIO 3 7 USER S MANUAL 61 EXE
203. ray cell is associated with a Boolean variable that is still unassigned A blue cell is true and a beige cell is false pauljapaid U lt 3 D 3 Q a gt D lt The following screen shows how the setup notebook page looks after the first solution is found and ILOG OPL Studio is in its waiting state ILOG OPL STUDIO 3 7 USER S MANUAL 91 CLOSING THE PROJECT Console Solutions Optimization Log Solver CPLEX setup La next solution 1examplestop waiting Figure 3 9 Setup Notebook Page Showing Boolean Display Click on the Next button E and watch as ILOG OPL Studio computes the second solution Continue clicking on the Next button to see more solutions of the model displayed To complete the execution click on Continue Run El Note In dynamic display mode the execution may be slower Closing the Project This completes the car sequencing example To close the files associated with a project you have to close the project This is done in one of three ways Select File gt Close Active Project from the menu bar Click on the Close Active Project button in the tool bar Right click on the project name in the work space and select Close Project The project file and its associated files are saved and closed 92 ILOG OPL STUDIO 3 7 USER S MANUAL Tutorial Examining the Solution to a Scheduling Problem In this chapter you will see how ILOG OPL Studio handles a schedul
204. readLim int Any positive integer 1 195 MIP parallel threads subAlg int 0 Automatic 0 191 1 Primal simplex 2 Dual simplex 3 Network optimizer followed by dual simplex 4 Barrier MIP subproblem LP algorithm subMIPNodeLim int Any positive integer 500 197 MIP subnode limit symmetry int 0 Off 0 186 1 On Symmetry breaking cuts 252 ILOG OPL STUDIO 3 7 USER S MANUAL Parameter Name and Description Type Possible Values Default Page tiLim float Any non negative number 1e 75 176 Global time limit treLim float Any positive number 128 196 MIP tree memory limit varSel int 1 Branch on variable with minimum infeasibility 0 191 0 Branch variable automatically selected 1 Branch on variable with maximum infeasibility 2 Branch based on pseudo reduced costs 3 Strong branching MIP variable selection strategy 4 Branch based on pseudo reduced costs workDir string Any valid string 179 The name of an existing directory in which CPLEX may The default value is a dot meaning the current store temporary working files local directory workMem double Any positive number 128 179 Memory available in megabytes for working storage ILOG OPL STUDIO 3 7 USER S MANUAL 253 254 ILOG OPL STUDIO 3 7 USER S MANUAL F G U R E S List of Figures 1 1 Switching from the Japanese Version to the English US Version nnanenenuane 21 1 2 LOG OPL Studio Ma
205. ribution car mod car dat car prj ILOG OPL STUDIO 3 7 USER S MANUAL 79 THE CAR SEQUENCING EXAMPLE If you used the default directories at installation time you can find these files at the following location For UNIX systems lt installation directory gt OPLSt37 examples opl For Windows XP Windows 2000 Windows NT 4 and Windows 98 c ILOG OPLSt37 examples opl The Car Sequencing Example 80 This example centers around the car sequencing model that appears in Chapter 14 of the ILOG OPL Studio Language Manual The problem is as follows Cars in production are placed on an assembly line and move through various units that install various options such as air conditioning or car radios The assembly line is composed of slots and each car must be allocated to a single slot The cars cannot be allocated arbitrarily because each production unit has a limited capacity and the options must be added to the cars as the assembly line passes in front of the unit The capacity constraints for this problem are expressed using the form outof u They indicate that the unit can produce at most cars with the option out of each sequence of u cars The purpose is to find an assignment of cars to the slots of the assembly line that satisfies the capacity constraints Code Sample 3 1 shows the OPL model for this example This file is car mod of your release distribution ILOG OPL STUDIO 3 7 USER S MANUAL THE CAR SEQUENCING E
206. rj for an example ILOG OPL STUDIO 3 7 USER S MANUAL EXAMINING THE SOLUTION The Optimization Notebook Page In the previous two examples in Chapters 2 and 3 the Optimization notebook page was empty When a model contains an optimization statement as this one does the minimize statement in Code Sample 4 1 this notebook page contains information El ET Solution with Objective Value 21 Console Solutions Optimization Log Solver CPLEX Activities Sorted Activities a next solution Ln 3 Col52 Waiting Figure 4 12 Optimization Notebook Page for house2 mod Example The Optimization page displays the optimal solution The Solver Notebook Page As with the other examples the Solver notebook page contains statistics generated by ILOG OPL Studio during the execution of the model x E Solver Constraints 24 Variables Solver memory 181656 Failures 10 Choice points 10 Solving time 0 49 Console Solutions Optimization Log Solver CPLEX Activities Sorted Activities La Next solution tn 1 Col Waiting Figure 4 13 Solver Notebook Page for house2 mod Example ILOG OPL STUDIO 3 7 USER S MANUAL 109 wn ie 3 O Qa E 5 o U e 2 o 3 e OL UOHNIOS y COMPLETING THE EXECUTION Completing the Execution 110 While you have been examining the results after running the model file ILOG OPL Studio has been in a waiting s
207. ro nbBin nbSol cout lt lt nbSol lt lt nbSol lt lt endl Console Solutions Optimization Log Solver CPLEX aj Next instruction Jlexampleslopliscriptst Waiting Figure 11 4 A Loop in a Script 238 ILOG OPL STUDIO 3 7 USER S MANUAL STEPPING IN A SCRIPT Now continue by clicking the Step Out button 4 You will see that OPL Studio is not stepping inside the while loop and that the current instruction becomes pro nbBin nbSol which is the first instruction after the while loop OPL Studio 1examplestopliscriptstvellino osc File Edit View Project Execution Debug Options Window Help Deo au LEi 6 5 ja 2 gt Q e a r on 2 me Model bin genBin mod genBin dat import enum Colors bin Colors import enum Components bin Components Model pro chooseBin mod vellino osc int nbSol 8 while bin nextSolution do lt pro bin addh pro bin nbSo1 c bin c forall c in Components pro bin nbSo1 n c bin n c nbSol nbSol 1 gt pro nbBin nbSol cout lt lt nbSol lt lt nbSol lt lt endl Console Solutions Optimization Log Solver CPLEX Next instruction Jlexampleslopliscriptst Waiting Figure 11 5 Stepping Out of a Loop in OPLScript To Complete the Execution While stepping through a script you can take ILOG OPL Studio to the idle state in
208. rreererneeeennee 239 Adding and Removing BreakpointS oooooccocnnccnc eee eee 240 Closing the Script File aci as 240 Generating Compiled Models nnenunnnnnnna 241 ILOG OPL STUDIO 3 7 USER S MANUAL CONTENTS Appendix A OPL Parameters neuen nunnana nunnana nan nn na 243 List of FIGUFES ihc ts R EAEE ROON ANEA A jala aga create fe eas 255 List ol TADIES 41 kn ee E TAARE RE EIERN 259 List of Code Sample ieee a A dde 261 O A ee ht eee ieee ee eee Sha ee I eee ie eee bt 263 ILOG OPL STUDIO 3 7 USER S MANUAL 9 CONTENTS 10 ILOG OPL STUDIO 3 7 USER S MANUAL Before You Begin This manual provides you with all the information you need for installing and using ILOG OPL Studio It contains several tutorials with examples and step by step explanations About ILOG OPL Studio ILOG OPL Studio is an integrated development environment for mathematical programming and combinatorial optimization applications It is the graphic user interface for the OPL modeling language All development effort is supported through the various modules accessible via ILOG OPL Studio With ILOG OPL Studio you can create and modify model and project files using the editing capabilities execute a model or project debug OPL statements using the debug facilities visualize OPL results using 2D graphic representation or textual representation dynamically visualize the state of variables d
209. ry in megabytes that the branch and bound tree can consume The action taken by CPLEX when the amount of memory required to store the branch and bound information exceeds the treLim parameter depends on the setting of the node file parameter nodeFileInd If the parameter is set to 0 no node file CPLEX terminates optimization Otherwise CPLEX continues optimization transferring nodes from the branch and bound tree to node files to keep the required memory below the tree memory limit The value can be any non negative number Default 128 Number of cutting plane passes Sets the OPL parameter cutPass Sets the upper limit on the number of passes CPLEX performs when generating cutting planes on a MIP model The value can be 1 None 0 Automatically determined default Any positive integer to indicate the number of passes to perform Candidate limit for Gomory fractional cuts Sets the OPL parameter fracCand Limits the number of candidate variables for generating Gomory fractional cuts The value can be any non negative integer Default 200 Pass limit for Gomory fractional cuts Sets the OPL parameter fracPass Limits the number of passes for generating Gomory fractional cuts At the default setting of 0 CPLEX decides The parameter is ignored if the Gomory fractional cut parameter fracCuts is set to a nonzero value The value can be any positive integer Default 0 ILOG OPL STUDIO 3 7 USER S MANUAL MI
210. s oooooccoccococo ttt eens 220 The Precedence Table sii etiani e oi a A rea 221 The Requirements Fable sy isi be iah ad bret ety ae 221 The OPL Model serena a A e Oe 222 Record Definitions y 6 uti a Whe eee be Se EREN 222 Connecting to the Database from OPL o ooococcococooc eee 223 Reading From the Database e neerneneneeeereneneee 224 Creating a New Table and Updating the Database n nanana anaana 225 Executing the Bridge Example 2 c cece eee eee eee nan nan nan nan nne 226 Viewing the Result in the Database o ooo ooocooocorcrr eens 226 Consulting the Result From Another Model 000 ccc eee eee eee eee eee 229 Using OPEL Script 4 03 24 tet eee cote ae A ed Pee ee 231 The Vellino Example 00 0 see eee eee eee eee eee nen nn na 232 Opening the Script File ennunenenannenenennen eee 233 Executing the Script as e ai Meee 234 Stepping ina Seript 1 5 5 cresi a ama 236 To Step to the First Instruction r eereeerneeeeeeee 236 To Step to the Next Instruction rueeeerneeeeenee 237 To Abort the Executions 21 2 seen kh pha la a kl E di 237 To Deselect the Stepping Opti0N oocococcccccoco teens 237 To Continue without Stepping 0 eee 237 To Step Outota LOOP 13 13 05744 Aled last be eek hate eae eee eh pe ad 237 To Complete the Execution r
211. s in the files you create Click the Fore or Back button next to the type of text whose color you want to change ILOG OPL Studio displays the Color Chooser dialog box Select Color Names or the Color Disk Color Chooser x Color Chooser x NE Color Names ass gt Max X Max y wi wl X a Min R G B 255 255 255 Apply Figure 8 4 Color Chooser Dialog Boxes You can use the sliders on the left side of the panels to obtain a color click the color name in the Names dialog box or mix colors in the Color Disk The color box at the bottom of the dialog box shows the results of your selection Click Apply to return to the Default Options dialog box You must also click Apply in the Default Options dialog box for your changes to appear in the Main window The options will then be restored the next time you start OPL Studio ILOG OPL STUDIO 3 7 USER S MANUAL SETTING OUTPUT OPTIONS Setting Output Options Use the Output notebook page to set the display options for ILOG OPL Studio Default Options Al x y Constraint Programming MIP Cuts Barrier Network Editor Output advanced Miscellaneous gt E Mathematical Programming r Model Browser Display Windows F Square matrix Hide the zeros MIP Strategy E bie Font The quick brown Fox Font MIP Tolerances Data colors The quick brown fox Fore Back MIP Cuts Label colors
212. s means that all string data from a database must contain standard single byte characters This applies whether the regional settings are Japanese or English ILOG OPL STUDIO 3 7 USER S MANUAL 21 ILOG OPL STUDIO MAIN WINDOW ILOG OPL Studio Main Window When you launch ILOG OPL Studio the Main window appears All tasks and commands for using ILOG OPL Studio are carried out from this window The figure below shows the Main window with three projects open OPL Studio E EG Menu Bar File Edit View Project Execution Debug Options Window Help Tool Bar TTF ERETTE DER Execution Tool Bar REMO Ss ER B examplestoplimulprod mod Aexamplestoplkmulprod pri 8 mulprod mod a mulprod dat eb Aexamplestopliconfig prj struct cardType lt rea int power Work Space int quantity 8 config dat 7 modelType model Models cardType car Cards int maxConn max r in Models model r connectors int maxPrice max r in Models model r price int maxCost nbCard maxPrice int powerData i in Models model i power int connData i in Models model i connectors int priceData i in Models model i price E Model Bb Projects armsa Output Notebook Console Solutions Optimization Log Solver CPLEX Nex solution examples piiconfig prj Status Bar Line and Column Status Box or Path Name Figure 1 2 ILOG OPL Studio Main Window Note If you have a
213. script 76 advanced options 171 constraint programming options 165 output options 169 project options 60 61 setting the active project 75 setup notebook page 91 singLim parameter 182 252 Solutions notebook page 63 100 ILOG OPL STUDIO 3 7 INDEX solutions examining 88 100 Solver notebook page 65 109 solving algorithms used 65 Sorted Activities notebook page 106 spreadsheet paste results to 88 square example 120 Stack window 139 144 stack window 124 stand alone models and scripts 74 startAlg parameter 191 252 status bar description 23 status box description 24 status colors 24 status messages after execution 88 during execution 62 85 98 Step Out command 29 stepping in model debug mode 142 stepping in script debug mode 236 stepping out of a script 32 237 strongCandLim parameter 195 252 strongItLim parameter 195 252 strongThreadLim parameter 195 252 subAlg parameter 191 252 subMIPNodeLim parameter 197 252 symmetry parameter 186 252 T terminating executions 152 ILOG OPL Studio 40 162 text editor customizing 46 Emacs mode 43 how to use 41 Multi Document Interface 41 guick reference 43 visual mode 43 46 tiLim parameter 176 253 tool bar description 23 tree in project workspace 74 133 search layout 151 visualizing search tree 148 USER S MANUAL 273 INDEX treLim parameter 196 197 253 U Uncomment command 27 Undo button 31 Undo command 26 updating a database creating
214. t the best remaining objective function value of any unexplored node best node the objective function value of the most recently solved node current objective If a cutoff tolerance see cutUp and cut Lo has been set by the user then that value is used as the incumbent until an integer feasible solution is found The target gap is defined to be the absolute value of the difference between the incumbent and the best node multiplied by this backtracking parameter CPLEX does not backtrack until the absolute value of the difference between the current objective and the best node is at least as large as the target gap Low values of this backtracking parameter thus tend to increase the amount of backtracking which makes the search process more of a pure best bound search Higher parameter values tend to decrease backtracking making the search more of a pure depth first search The backtracking value has effect only after an integer feasible solution is found or when a cutoff has been specified Note that this backtracking value merely permits backtracking but does not force it CPLEX may choose to continue searching a branch of the tree if it seems a promising candidate for finding an integer feasible solution The value can be any number between 0 and 1 Default 0 9999 200 ILOG OPL STUDIO 3 7 USER S MANUAL MIXED INTEGER PROGRAMMING MIP Cuts y Constraint Programming MIP Strategy MIP Limits
215. tate You can now complete the execution Click the Abort button E in the execution tool bar of the Main window As it completes the execution ILOG OPL Studio closes all the panels that were opened from the Model browser However the solutions and results remain in the Solutions Optimization Activities and Sorted Activities notebook pages You can also close all the panels by right clicking on the root item in the model browser Workspace xi et Aexamplestoplischedulerthouse2 mod z Type Ase Active Model how All Activities how Sorted Activities do o w a KE Projects ILOG OPL STUDIO 3 7 USER S MANUAL CLOSING THE MODEL FILE Closing the Model File This completes the house building example You can close the model file in one of the following ways Select Close Current Editor from the File menu Press the keys Ctrl F4 In the Projects notebook page right click on the active model house2 mod and select Close from the menu as shown in Figure 4 14 Workspace XI Set as Active Model YE Browse Model M Customize Default Options YE Model f Projects Figure 4 14 Closing a Model in the Projects Page Inthe editing area when the window is in cascade mode select Close from the menu or click on the button with an X in it as shown in Figure 4 15 OPL Studio olx Ele Edt View Project Execution Debug Options window Help DOSBLEGK 22 x TAA EE Bi examplestopl
216. tely and does not continue with the execution All errors appear in the Console notebook page of the output area in the lower half of the Main window In addition the line containing the error is highlighted in the current model file and a blue arrow appears in the margin Figure 1 10 shows ILOG OPL Studio as it reports a syntactic error OIPNIS IdO O lt 2 lt o a F O Q OPL Studio examples opl gas mod OL x File Edit View Project Execution Debug Options Window Help lal xl KETTI TEER AA E EE A i dexemplestopigas mod enum Products enum Components float demand Products Components float profit Products float stock Components var float production Products maximize sum p in Products profit p production p subject to forall c Components sum p in Products demand p c production p lt stock c 5 Projects examples opl gas mod 14 syntax error got token Components Identifier expecting token in lt in 3 Console Solutions Optimization Log Solver CPLEX 4 errors Ln 14 Col1 Figure 1 10 Error Message Displayed in Console Notebook Page ILOG OPL STUDIO 3 7 USER S MANUAL 39 ILOG OPL STUDIO BASICS 40 CNE An error message has the following format when displayed in the Console notebook page The first element indicates where the error was detected In Figure 1 10 the file
217. tepping in Model debug option you see all the nodes including the choices that have failed The number between brackets indicates the depth in the search tree At the same level the same variable is selected but different values are tried Notice that the order in which the values must be tried is specified by the statement ordered by decreasing nbOccur f freq ILOG OPL STUDIO 3 7 USER S MANUAL 147 VISUALIZING THE SEARCH TREE For instance look at the 7 and 8 nodes You will notice that the value 3 is tried before the value 2 for the variable freq lt c 5 t 2 gt In the path 1 2 5 the frequencies and 3 are used once each for the variables freq lt c 4 t 1 gt and freq lt c 5 t 2 gt respectively The value 2 is not yet used so has lower priority than the values 1 and 3 You see that the statement prioritizes the use of already allocated frequencies Click on the Abort button to stop execution of the project Visualizing the Search Tree We are going to execute alloc prj again this time displaying the search strategy in the search tree Two search procedures will be used the Depth First Search the Slice Based Search Using the Depth First Search When declaring a search specification you declare the search tree that the OPL engine must explore You do not specify how the search tree is to be explored By default the search tree is explored by a Depth First Search 1 In the Debug Menu deselect Stepping
218. teps to the following instruction in the execution flow By repeatedly clicking on the Next button you can follow the execution of the script one instruction after another mb G o 5 e e 7 a wn le gt mal To Abort the Execution At any moment during the stepping in the script you can abort the execution by clicking the Abort button Es in the execution tool bar of the Main window In this case you will get the message OPLScript Execution has aborted in the Console notebook page The status bar will indicate that OPL Studio is idle and the color patch will change to blue After aborting you can relaunch the script in stepping mode from the beginning by clicking on Run To Deselect the Stepping Option If you want to run the script from the beginning without stepping deselect the option Stepping in Script from the Debug menu prior to clicking on Run As long as the option Stepping in Script is not deselected the script will stop at the first instruction each time the Run button is clicked To Continue without Stepping At any moment during the stepping in the script you can ask ILOG OPL Studio to continue until completion by clicking the Continue Run button 24 in the tool bar of the Main window OPL Studio will execute the rest of the script without stopping at instructions The possible outputs of the script are printed in the Console notebook page At the end of the execution the stat
219. ter cursor Delete Ctrl d or Delete or ESC x delete char Delete character before Backspace Backspace or cursor ESC x delete backward char Cumulative cut from cursor to Ctrl k Ctrl k or end of line ESC x kill line Cut Ctrl x or Ctrl w on selection or Shift Delete on selection ESC x kill region Copy Ctrl c or Ctrl Insert ESC w or Ctrl Insert on on selection selection or ESC x kill ring save Paste Ctrl v or Shift Insert Ctrl y or Shift Insert or right click or ESC x yank Scroll down one line Ctrl Ctrl 4 Scroll up one line Ctrl t Ctrl T Recenter on current line Ctrl Ctrl 1 or ESC x recenter Mark the beginning of a selection Click left mouse button and drag cursor or use arrow keys Ctrl SPACE or ESC x set mark command ILOG OPL STUDIO 3 7 USER S MANUAL Table 1 2 Editor Functions Continued IEEE OTE Action Visual Mode Emacs Mode Mark the end of a selection or extend a selection Release left mouse button or press Shift left button or Shift arrow keys or Shift Page keys or Ctrl Shift arrow keys or drag mouse Change the caret location after marking the beginning of the selection Stop command in progress Release selection Ctrl g or ESC x keyboard quit Select line Click on the margin or triple Click on the margin or triple click click Select word Double click on word Double click
220. ters lt c t gt c in Cells amp t in 1 nbTrans c var Fregs freg Transmitters var Fregs maxFreg solve forall c in Cells amp ordered tl t2 in 1 nbTrans c abs freq lt c t1 gt freq lt c t2 gt gt 16 forall ordered cl c2 in Cells distance cl c2 gt 0 forall t1 in 1 nbTrans cl amp t2 in 1 nbTrans c2 abs freq lt c1 t1 gt freq lt c2 t2 gt gt distance cl c2 y search forall t in Transmitters ordered by increasing lt dsize freq t nbTrans t c gt tryall f in Freqs ordered by decreasing nbOccur f freq freq t f po y U 0 os Cc G Qe 9 5 ge gt gt maxFreg sum i in Fregs nbOccur i freq gt 0 5 Code Sample 7 1 OPL Model for the Frequency Allocation Example with Search Procedure ILOG OPL STUDIO 3 7 USER S MANUAL 131 THE FREQUENCY ALLOCATION EXAMPLE Code Sample 7 2 shows the data initialization for the problem This code can be found in the alloc dat file of the product distribution nbCells 25 nbFreqs nbTrans 256 on d d foe SI ACOA FA FAA AHA AA ATH AANNNANNANNAN wn qd 35 4 NANNN AARNA t O lt dn H400o0oo0ooo0o0ooooo ooo Ne foe ddd NO00o00o0o0o0o AHH INN rt rin OO oO HANAN nOooooooori NA Ne co ANANA ooo NN NNN NN o AAHO AA H ooo iHa faded 1 ANN AN O ANAHONAO ooo 1 NA ANNA rt aa O 7 8 lt AAACOOFA AH ANNAN AANO ANNANNANN 0 AADACOOFA AA ANNAN HE AO ANNAN THNNANHNaA
221. ting the Load option as shown in Figure 3 1 paujapaild iw lt 5 D 3 5 Q a gt D lt OPL Studio ol x File Edit View Project Execution Debug Options Window Help 6602385095 oy bR EIA EE Bi texamplestopiicar mod Eb Aexamplestoplicar prj ARE nDCars Er stud int nbOptions cardat dal int nbSlots 7 Remove from Project range Cars nbCars Options nbOptions Slots 1 nbSlots int demand Cars int option Options Cars struct Tcapacity lt int 1 int u i Model Projects Figure 3 1 Loading a Data File for the Car Sequencing Example ILOG OPL STUDIO 3 7 USER S MANUAL 83 SETTING UP THE PROJECT 84 ILOG OPL Studio has now opened the files associated with the project in the work space of the Main window For this example it has opened car mod and car dat OPL Studio MC El Ele Edit View Project Execution Debug Options Window Help SPOeSBLEGK SBAEN eb Aexamplestoplicar prj i car mod nbCars 6 nbOptions 5 nbSlots 16 1 capacity 415235 lt 2 3 gt lt 1 3 gt YE Model Projects Console Solutions Optimization Log Solver CPLEX La Project loaded tn 1 Colt Figure 3 2 Main Window for the Car Sequencing Example ILOG OPL STUDIO 3 7 USER S MANUAL EXECUTING THE PROJECT Executing the Project Now that everything is set up in the project
222. tion gt OPLSt37 examples opl scheduler For Windows XP Windows 2000 Windows NT 4 and Windows 98 c ILOG OPLSt37 examples opl scheduler However this time for the purposes of the example shown here the data items are stored in tables in a relational database In this chapter you will see how to establish a connection to a database from OPL Studio read database relations into OPL sets create a new relational table from OPL write an OPL set to a database by inserting new rows into a table Note OPL cannot read a double byte string from a database This means that all string data from a database must contain standard single byte characters md o E 2 9 a 2 5 o D a o s gt o ILOG OPL STUDIO 3 7 USER S MANUAL 213 SUPPORTED DATABASES Supported Databases OPL Studio 3 7 interfaces with the RDBMS supported by ILOG DB Link 5 0 The specific database systems supported by each of the UNIX and Windows platforms are listed in the README file For example On UNIX systems Oracle 8 1 Solaris HP Linux RS6000 On Windows XP Windows 2000 Windows NT 4 and Windows 98 Oracle 7 3 8 0 8 1 9i Database Connectivity 214 The Connection Command The OPL instruction DBconnection establishes a connection to a database It reguires two arguments the database client you want to use and the connection string The first argument is a string indicating the name of a database system as known by ILO
223. tion to the model ILOG OPL STUDIO 3 7 USER S MANUAL 63 EXAMINING A SOLUTION TO THE MODEL Le Lx Optimal Solution with Objective Value 372 6666 inside kluski 46 6666 inside capellini 0 0009 inside fettucine 6 6066 outside kluski 66 6666 outside capellini 266 6606 outside fettucine 366 6606 Console Solutions Optimization Log Solver CPLEX a next solution Ln 10 Col 8 Waiting Figure 2 12 Solutions Notebook Page for product prj Example By default all variables are displayed However you can specify which variables are displayed and in what format See Chapter 9 of the ILOG OPL Studio Language Manual for more information Optimization Notebook Page When you click the Optimization tab you will see that the notebook page is empty The Optimization notebook page contains information 4 only when there is an optimization statement in the model that is a minimize or maximize statement and only when optimization is obtained by improving on successive solutions When these two conditions are met all the solutions found and their costs are displayed If the model contains only a solve statement the first solution is supplied in the Solutions page and the Optimization page is empty Log Notebook Page Click either the Log tab or the arrow at the left of the status bar to view log details E KT Project loaded Options saved in default prj Ru
224. to create a project file that associates these two files product mod and product dat You will then see how to execute the project look at the results of the solution and close the project N 3 3 2x 0 5 20 Ors gt ILOG OPL STUDIO 3 7 USER S MANUAL 53 CREATING A PROJECT Creating a Project After launching ILOG OPL Studio as described in Launching ILOG OPL Studio on page 18 create the project file that will contain the product mod and product dat files by selecting New gt Project from the File menu ILOG OPL Studio displays the project tree in the work space to which you can add all files related to the project Notice that it creates a project called noname prj at the top of the tree structure Project files are displayed in the Projects page and use the prj extension Workspace x f noname pri 3 Projects Ye Model Figure 2 1 Project Window Floating State To close the active project use either the command File gt Close Active Project or the button gt in the main tool bar 54 ILOG OPL STUDIO 3 7 USER S MANUAL CREATING A PROJECT Inserting an Existing Model File into a Project OPL Studio Splash File Edit View Project Execution Debug Options Set as Active Project 6 Add New Model File 8 Add New Data File sting Model File 9 Insert Existing Data File E Save the Project E Save the Project As Close Project E Brows
225. to launch OPL Studio as described in Launching ILOG OPL Studio on page 18 When the Main window is open you are ready to start the house building tutorial by opening the model file Select Open gt Model from the File ILOG OPL STUDIO 3 7 USER S MANUAL 95 LOOKING AT THE MODEL STRUCTURE menu or click on the Load Model button afin the tool bar and select house2 mod from the scheduler directory ILOG OPL Studio then displays the house2 moa file in the work space Looking at the Model Structure Before executing the model let s take a look at the data structure of house2 mod to see what has been defined in this model Right click on the model name in the Projects window then select E Browse Model as shown in Figure 4 1 OPL Studio 01x Ele Edit View Project Execution Debug Options Window Help j oee28280B 200 keetes amp roofing painting windows facade garden moving duration Tasks 7 3 8 3 1 2 1 2 1 1 scheduleHorizon 36 Activity a t in Tasks duration t DiscreteResource budget 29000 minimize a moving end subject to a masonry precedes a carpentry a masonry precedes a plumbing a masonry precedes a ceiling YE Model gt Projects 24 Console Solutions Optimization Log Solver CPLEX a Fiie toadea Ln1 Colt Figure 4 1 Main Window for the House Building Example 96 ILOG OPL STUDIO 3 7 USER S MANUAL LOOKING AT THE MODEL S
226. tschedulerthouse2 mod we Model Browser empty enum Tasks masonry carpentri Pesce roofing painting Minimize garden moving Maximize int duration Tasks 7 3 8 3 MPAA I e 0 uonnjos y scheduleHorizon 38 e le 3 O Qa Q U e g O 3 Figure 4 15 Closing a Model in the Editing Area ILOG OPL STUDIO 3 7 USER S MANUAL 111 CLOSING THE MODEL FILE 112 ILOG OPL STUDIO 3 7 USER S MANUAL Tutorial Scheduling Specific Dynamic Display In this chapter you will see how to use the Activity Domains window OPL Studio enables you to define scheduling specific dynamic display The Activity Domains dockable window shows the algorithm reducing the domains of the activities during a search Buinpeyos G 42 y D Q 2 U lt gt Q a EN lt ILOG OPL STUDIO 3 7 USER S MANUAL THE ACTIVITY DOMAINS WINDOW The Activity Domains Window Activity Domains Eg Mode Selectors The vertical bar to the left of the Activity Domains window contains mode selectors First click a selector button then click in the main part of the window for the selected mode to become effective 114 ILOG OPL STUDIO 3 7 USER S MANUAL THE ACTIVITY DOMAINS WINDOW Mode Selectors e Time selector Click on the arrow button then click on the beginning of the activity and drag the cursor across the activity holding down the left mouse button An approx
227. ture of the rows in the different tables of the database The OPL record TaskDuration is an example struct TaskDuration string task int duration y This record corresponds to the two column structure of the table Task The field task corresponds to the column Name and the field duration corresponds to the column Duration in the table Task 222 ILOG OPL STUDIO 3 7 USER S MANUAL THE OPL MODEL You will notice the type concordance between the table columns and the OPL fields The column Name contains character strings so the field task is of type string the column Duration contains integers so the field duration is of type int Note Depending on your actual database system it is possible that columns storing integer values need to be mapped to OPL fields of type float rather than of type int This is the case for example if you are using ODBC connected to an Excel database source as the numeric values manipulated in Excel are of type float Similarly the OPL record Distance corresponds to the column structure of the tables MAX_EF MAX_NF MIN_AF MIN_NF MIN_SF The OPL record Precedence corresponds to the column structure of the table Precedence and the OPL record TaskResource corresponds to the column structure of the table Requirements The OPL record Schedule corresponds to a new table Result that will be created at the end of the computation in order to store the results of the optimization Conn
228. tution will not be made The value can be any positive number Default 10 Preprocessing aggregator application limit Sets the OPL parameter aggInd Invokes the aggregator to use substitution where possible to reduce the number of rows and columns before the problem is solved If set to a positive value the aggregator will be applied the specified number of times or until no more reductions are possible The value can be 1 Automatic 1 for LP infinite for MIP 0 Do not use any aggregator Default 1 ILOG OPL STUDIO 3 7 USER S MANUAL PREPROCESSING Simplification with Presolve By default the OPL parameter preInd is set to on Invokes CPLEX Presolve to simplify and reduce problems Uncheck the box to turn off this function Use LP Presolve on initial MIP relaxation Sets the OPL parameter relaxPreInd If you check this box OPL Studio will invoke CPLEX Presolve for the initial relaxation of MIP problems Limit on the number of Presolve passes made Sets the OPL parameter prePass When set to a nonzero value will invoke the CPLEX Presolve to simplify and reduce problems When set to a positive value the Presolve will be applied the specified number of times or until no more reductions are possible At the default value of 1 Presolve should continue only if it seems to be helping The value can be 1 Determined automatically default 0 Do not use Presolve or any positive integer Use dependency checker
229. um Colors bin Colors import enum Components bin Components Model pro chooseBin mod int mbSol 6 while bin nextSolution do lt pro bin addh pro bin nbSol c bin c forall c in Components pro bin nbSol n c bin n c nbSol nbSol 1 pro nbBin nbSol cout lt lt nbSol lt lt nbSol lt lt endl if pro nextSolution then lt cout lt lt Solution at cost lt lt pro objectiveValue lt lt endl forall i in 8 nbSol 1 if pro produce i gt 1 then 4 cout lt lt produce lt lt pro produce i lt lt units of bin lt lt endl cout lt lt color lt lt pro bin i c lt lt endl Projects Console Solutions Optimization Log Solver CPLEX La Fite loaded in 1 col Figure 11 1 vellino osc OPL Script Example ILOG OPL STUDIO 3 7 USER S MANUAL 233 EXECUTING THE SCRIPT Executing the Script 234 In order to execute the loaded script simply click the Run button E in the tool bar of the Main window Note If you happen to have a project open in the Main window ILOG OPL Studio always gives precedence to the project file The opened project file always gets executed You will need to close the project before trying to execute the script file Once the script is open ILOG OPL Studio does the following checks for syntactic or semantic errors executes the script displaying the
230. uring the search for a solution display the constraint programming search tree select mathematical programming options 9 9 9 9 0 o 2 connect to a database ILOG OPL STUDIO 3 7 USER S MANUAL 11 work with OPLScript the OPL scripting language generate a compiled model What You Need to Know This manual assumes that you are familiar with the UNIX or PC environment in which you are going to use ILOG OPL Studio including its particular windowing system You should also be familiar with the OPL modeling language The tutorial examples referred to in this manual are taken from the ILOG OPL Studio Language Manual In the present manual the programming and language concepts behind the examples are not explained You will need to refer to the ILOG OPL Studio Language Manual for an explanation of the modeling language of these examples The present manual describes only how to use the features of ILOG OPL Studio What This Manual Contains 12 Chapter 1 Overview of ILOG OPL Studio describes the basics of ILOG OPL Studio how to launch the product the Main window and its elements the text editor the keyword help Chapter 2 Tutorial Working with Projects A simple production planning example introduces you to ILOG OPL Studio Chapter 3 Tutorial Predefined Dynamic Display The car sequencing example contains a constraint model showing constraint programming constructs Chapter 4 Tutorial Examining th
231. us bar indicates that ILOG OPL Studio is idle You can relaunch the script in stepping mode from the beginning by clicking on Run To Step Out of a Loop When you are stepping in a script and the current instruction is a looping instruction i e forall while or repeat you can ask ILOG OPL Studio to execute the loop without stopping at instructions by clicking the Step Out button 494 in the tool bar ILOG OPL STUDIO 3 7 USER S MANUAL 237 STEPPING IN A SCRIPT OPL Studio will proceed with the entire loop then it will stop at the first instruction after the loop in the execution flow For example if you launched the script vellino osc in stepping mode you can first proceed by clicking the Next button several times until the current instruction indicated by the yellow arrow in the editor margin see Figure 11 4 becomes the while statement while bin nextSolution do OPL Studio 1examplestopliscriptsivellino osc iof x File Edit View Project Execution Debug Options Window Help 15 x ETZIE BERG A TT EROS Model bin genBin mod genBin dat import enum Colors bin Colors import enum Components bin Components Model pro chooseBin mod amp vellino osc int nbSol 8 while bin nextSolution do lt pro bin addh pro bin nbSol c bin c forall c in Components pro bin nbSo1 n c bin n c nbSol nbSol 1 gt p
232. ve 0 gt forall t in Transmitters 0 gt tryall f in Fregs 1 gt freg 4 lt c 4 t 1 gt 4 1 1 gt tryall in Fregs 2 gt freg f lt c 5 t 1 gt 4 It has jumped in the tree The corresponding search tree exploration order is as follows 150 ILOG OPL STUDIO 3 7 USER S MANUAL VISUALIZING THE SEARCH TREE 1 freq lt c 4 t 1 gt 1 2 freq lt c 5 t 1 gt 1 2 freq lt c 5 t1 gt 2 2 freq lt c 5 t 1 gt 3 2 freg lt c 5 t1 gt 4 lt current 3 freq lt c 5 t 2 gt 1 3 freq lt c 5 t 2 gt 3 Figure 7 19 Part of the Search tree Exploration Order with the SBS po y U 0 os sc fto Qe bo IN 9 5 es gt gt You see that the SBS explores the same tree in a different order See the ILOG OPL Studio Language Manual for more information You can abort and rerun with the Display Search Tree item checked After clicking 11 times on the Next button you will obtain the following tree layout t When you have a feel for how the Stepping in Model option works stop the execution and reopen the Project Options dialog box Return to the Depth First Search procedure which is in fact more suitable in this example Uncheck the Debug options and run the project again Note that an example demonstrating the usefulness of the SBS strategy is given at the following location examples opl scheduler jobshop20 pr
233. ve Project from the menu bar because product prj is the active project Click on the Close Active Project button in the tool bar as product prj is the active project Right click on product prj in the project tree then select Close Project You will notice that when you close the project you also close all the files associated with it Working with Several Projects 74 ILOG OPL Studio allows you to load more than one project at the same time Of course only one of the loaded projects is the active one The active project name and its model name are displayed in red A project tree structure is displayed in the work space Bd Aexamplestopliproduct prj 8 product mod i a productn dat ae examples opl config pr config mod config dat shipload mod Bun amp vellino osc Model Projects Figure 2 19 Project Tree in the Work Space As shown in Figure 2 19 stand alone models and scripts are also displayed on the Projects page although they are not true projects You can set a stand alone model as the active model or a script as the active script Stand alone models do not have their own settings they take them from the default options ILOG OPL STUDIO 3 7 USER S MANUAL WORKING WITH SEVERAL PROJECTS Setting the Active Project By default the last loaded project is the active one If you want to change the active project right click on the new project name in the Pr
234. ve instructions in your model such as int n lt lt number of queens which is used in the model queens mod and displays a window requiring input from the user ILOG OPL STUDIO 3 7 USER S MANUAL LAUNCHING ILOG OPL STUDIO Launching an OPL Script in Batch Mode On UNIX oplst batch examples opl scripts gomory osc o s U On Windows 5 A bat file is available in the bin directory E E h opl bat examples opl scripts gomory osc o oO e Batch Mode for OPL Models On UNIX oplst batch examples opl gas mod examples opl gas dat On Windows opl bat examples opl gas mod examples opl gas dat Other Command Line Options Path Option path lt include_path gt The path option specifies a directory in which an OPL script can find the OPL model files and include files Help Option help The help option displays a message describing the documented options available in command line mode then exits Version Option version The version option displays a message with the version number and build date of the executable then exits ILOG OPL STUDIO 3 7 USER S MANUAL 19 LAUNCHING ILOG OPL STUDIO Japanese Localization If you run OPL Studio on a Windows platform with the Japanese regional settings you will see labels in Japanese There is no need to install another executable or a message database OPL Studio Splash olx 27440 BEE Ez IOV KTM FIO
235. vers parameter 201 245 CPLEX notebook page 211 cplexLogFile parameter 177 245 cralInd parameter 180 246 creating files 36 creating projects 54 59 current node inspector 124 Customize Active Project Options command 29 Customize Default Options command 29 customizing default options 164 customizing OPL Studio changing colors 168 changing fonts 167 constraint programming options 165 setting advanced options 171 setting output options 169 customizing project options 60 61 164 Cut button 31 Cut command 27 cutLo parameter 199 246 cutPass parameter 196 246 USER S MANUAL 265 INDEX cutsFactor parameter 194 246 cutUp parameter 199 246 D data files 58 83 data files description 35 data initialization 73 data structure information 89 96 data loading into editor 133 database connection bridge example 213 216 226 installing the database 217 ODBC 223 225 Oracle 224 225 reading from a database 224 storing results in a database 225 the OPL model 222 updating a database 225 viewing the data tables 218 database connectivity 214 databases supported in OPL 214 DBconnection OPL instruction 214 Debug menu Add Remove Break Point 29 Display Search Tree 29 Stepping in Model 29 Stepping in Script 29 Stop at Choice Point 29 Stop at Solution 29 debugging OPL models executing in debug mode 137 142 Inspector window 139 options 136 processing directives 141 setting options 136 Stack window 139 Stepping in Model o
236. window appears To set your options for the current session click Apply or OK To reset the default values click Reset Burwweiboldg Default options are saved in the default prj file when you quit an application This file is stored in your home directory on UNIX platforms and in your profile directory on Windows platforms The options will be restored the next time you start OPL Studio Only an option whose value differs from its default value is saved in the default prj file Appendix A OPL Parameters contains an alphabetical list of the OPL parameters with their types and values ILOG OPL STUDIO 3 7 USER S MANUAL 175 o z D gt O 3 D le 9 MP GENERAL MP General 176 Default Options Of x y Constraint Programming Constraint Prog MP General simplex Preprocessing MIP Strategy M d gt Mathematical Programming a Time limit 1e 075 Simplex Preprocessing Refresh rate tsi 1 Mixed Integer Programmin j MIP Strategy Export format LP Method MIP Limits Da No export y Ja MIP Tolerances MIP Cuts Barrier CPLEX Log File m Solver Search Network LP First Method Graphical User Interface Dual Mixed integer programming LP Search Method CPLEX MIP Dual E MIP emphasis indicator Balance optimality and fe y Piecewise Cuts M Memory available for working storage 1 28e 002 gt j Directory for working files
237. word in the text editor To navigate in the help use the contents list the index or the search function Click on an item in the contents list to display the corresponding page In the index field type the beginning of a word then double click on the listed item you want to display In the search field type the word you want to find then click on List Topics The search function lists all the pages that reference the word you entered OPL keyword or natural language When you double click an item in the list the page is displayed with all the referenced words highlighted UNIX Platforms Prerequisite you need Netscape Communicator 4 0 After clicking Fl if a Netscape window is available the appropriate help page will be opened in the existing Netscape window If not you will be told to launch Netscape Important If Netscape is launched from a different machine sharing the same display ensure that the disk mount allows Netscape to find the directory in which OPL Studio is installed Itis recommended to launch Netscape after OPL Studio as Netscape uses a large number of colors leaving very few for OPL Studio ILOG OPL STUDIO 3 7 USER S MANUAL 49 THE ONLINE HELP 50 ILOG OPL STUDIO 3 7 USER S MANUAL Tutorial Working with Projects N 3 3 2x 0 5 29a ors gt This chapter provides an introduction to ILOG OPL Studio through the use of a simple production planning example In
238. xist between the different tasks of the project For each row the task stored in the column Before must be completed before the beginning of the task stored in the column After The Requirements Table Finally the table Requirements stores the resources needed by different tasks For each row the first column TaskName indicates the name of a task while the second column ResName contains the name of the particular resource needed by the task A oZ 2 9 a 2 5 o D o z gt o ILOG OPL STUDIO 3 7 USER S MANUAL 221 THE OPL MODEL The OPL Model From the File menu in OPL Studio select Open gt Model then select the appropriate model file On Windows XP Windows 2000 Windows NT 4 and Windows 98 c ILOG OPLSt37 examples opl database abridge mod On UNIX lt installation directory gt OPLSt37 examples opl database obridge mod Record Definitions At the beginning of the model there are several definitions of OPL records as shown in Code Sample 10 1 struct TaskDuration string task int duration struct Distance string before Task string after Task int dist 1 struct Precedence string before Task string after Task struct TaskResource string tas string resource r struct Schedule strin EMS sk int s art tihe int endTime 7 Code Sample 10 1 Record Definitions in the abridge mod File These record definitions closely follow the actual struc
Download Pdf Manuals
Related Search
Related Contents
Instrucciones de Servicio - FMC Technologies Chile Ltda Pioneer VSX-823-K User's Manual Automatically registers when the car is being driven and parked LE BOISE MANUAL DEL PROPIETARIO 35192 PKZ UM spitfire MK IX BNFRTF manual multi.indb SINUMERIK 810D / 840D Upgrade Instructions ShopMill V06.04.23 Biberon Jules et Charlotte VCL-Ethernet over FE1 - Data Sheet System User Forum I6S Copyright © All rights reserved.
Failed to retrieve file