IBM ILOG OPL IDE Tutorials
Total Page:16
File Type:pdf, Size:1020Kb
IBM ILOG OPL V6.3 IBM ILOG OPL IDE Tutorials © Copyright International Business Machines Corporation 1987, 2009 US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Copyright COPYRIGHT NOTICE © Copyright International Business Machines Corporation 1987, 2009. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Trademarks IBM, the IBM logo, ibm.com, WebSphere, ILOG, the ILOG design, and CPLEX are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at http://www.ibm.com/legal/copytrade.shtml Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries. Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of others. Acknowledgement The language manuals are based on, and include substantial material from, The OPL Optimization Programming Language by Pascal Van Hentenryck, © 1999 Massachusetts Institute of Technology. CONTENTS Table of contents IDE Tutorials................................................................................................................7 About IDE tutorials......................................................................................................................9 Understanding solving statistics and progress (MP models)...............................................11 Purpose of the tutorial..................................................................................................................................13 The scalable warehouse example................................................................................................................14 The scalable warehouse project...................................................................................................................15 Executing the warehouse project with scalable data....................................................................................18 Examining the statistics and progress chart (MP)........................................................................................19 The Progress Chart (MP models).....................................................................................................20 The Statistics table (MP models)......................................................................................................21 Examining the engine log.............................................................................................................................22 Examining the results and the data..............................................................................................................24 Changing a CPLEX parameter value...........................................................................................................26 Understanding solving statistics and progress (CP models)...............................................29 Purpose of the tutorial..................................................................................................................................30 The steel mill example..................................................................................................................................31 Executing the model in the OPL IDE............................................................................................................32 Coloring of CP keywords and functions in the IDE.......................................................................................33 Examining the statistics and progress chart (CP)........................................................................................35 Statistics............................................................................................................................................36 The progress chart (CP models).......................................................................................................37 The statistics table (CP models).......................................................................................................38 Examining the engine log.............................................................................................................................39 © Copyright IBM Corp. 1987, 2009 3 Changing a CP parameter value..................................................................................................................41 Working with external data.......................................................................................................43 Purpose and prerequisites...........................................................................................................................44 Using data sources.......................................................................................................................................45 The oil database example............................................................................................................................47 Description of the example................................................................................................................48 The oil database tables.....................................................................................................................50 The oil database project....................................................................................................................53 The oil database data file..................................................................................................................55 Executing the oil database example..................................................................................................58 Viewing the result in the database....................................................................................................60 The Result table after execution........................................................................................................61 The oil sheet example..................................................................................................................................63 Description of the example................................................................................................................64 The oil data spreadsheet...................................................................................................................65 The oil sheet project..........................................................................................................................67 The oil sheet data file........................................................................................................................69 Executing the oil sheet example........................................................................................................71 Viewing the result in the spreadsheet...............................................................................................73 The RESULT sheet after execution...................................................................................................74 Using IBM ILOG Script for OPL................................................................................................75 Purpose and prerequisites...........................................................................................................................76 Features of IBM ILOG Script for OPL...........................................................................................................78 The multiperiod production planning example..............................................................................................79 Presenting the multiperiod production planning example.................................................................80 Setting up the multiperiod production model and data......................................................................82 Executing a flow control script...........................................................................................................83 Purpose of the flow control script......................................................................................................84 Debugging a flow control script.........................................................................................................85 The transportation example..........................................................................................................................91 Presenting the transportation example.............................................................................................92 Setting up the transportation model and data...................................................................................94 Executing preprocessing scripts.......................................................................................................95