Aimms Language Reference Provides a Complete Description of the Aimms Reference Modeling Language, Its Underlying Data Structures and Advanced Language Con- Structs
Total Page:16
File Type:pdf, Size:1020Kb
AIMMS The Language Reference AIMMS 4 AIMMS The Language Reference AIMMS Marcel Roelofs Johannes Bisschop Copyright c 1993–2019 by AIMMS B.V. All rights reserved. Email: [email protected] WWW: www.aimms.com ISBN 978–0–557–06379–6 Aimms is a registered trademark of AIMMS B.V. IBM ILOG CPLEX and CPLEX is a registered trademark of IBM Corporation. GUROBI is a registered trademark of Gurobi Optimization, Inc. Knitro is a registered trademark of Artelys. Windows and Excel are registered trademarks of Microsoft Corporation. TEX, LATEX, and AMS-LATEX are trademarks of the American Mathematical Society. Lucida is a registered trademark of Bigelow & Holmes Inc. Acrobat is a registered trademark of Adobe Systems Inc. Other brands and their products are trademarks of their respective holders. Information in this document is subject to change without notice and does not represent a commitment on the part of AIMMS B.V. The software described in this document is furnished under a license agreement and may only be used and copied in accordance with the terms of the agreement. The documentation may not, in whole or in part, be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form without prior consent, in writing, from AIMMS B.V. AIMMS B.V. makes no representation or warranty with respect to the adequacy of this documentation or the programs which it describes for any particular purpose or with respect to its adequacy to produce any particular result. In no event shall AIMMS B.V., its employees, its contractors or the authors of this documentation be liable for special, direct, indirect or consequential damages, losses, costs, charges, claims, demands, or claims for lost profits, fees or expenses of any nature or kind. In addition to the foregoing, users should recognize that all complex software systems and their docu- mentation contain errors and omissions. The authors, AIMMS B.V. and its employees, and its contractors shall not be responsible under any circumstances for providing information or corrections to errors and omissions discovered at any time in this book or the software it describes, whether or not they are aware of the errors or omissions. The authors, AIMMS B.V. and its employees, and its contractors do not recommend the use of the software described in this book for applications in which errors or omissions could threaten life, injury or significant loss. This documentation was typeset by AIMMS B.V. using LATEX and the Lucida font family. About Aimms Aimms was introduced as a new type of mathematical modeling tool in 1993— History an integrated combination of a modeling language, a graphical user inter- face, and numerical solvers. Aimms has proven to be one of the world’s most advanced development environments for building optimization-based decision support applications and advanced planning systems. Today, it is used by leading companies in a wide range of industries in areas such as sup- ply chain management, energy management, production planning, logistics, forestry planning, and risk-, revenue-, and asset- management. In addition, Aimms is used by universities worldwide for courses in Operations Research and Optimization Modeling, as well as for research and graduation projects. Aimms is far more than just another mathematical modeling language. True, What is Aimms? the modeling language is state of the art for sure, but alongside this, Aimms offers a number of advanced modeling concepts not found in other languages, as well as a full graphical user interface both for developers and end-users. Aimms includes world-class solvers (and solver links) for linear, mixed-integer, and nonlinear programming such as baron, cplex, conopt, gurobi, knitro, path, snopt and xa, and can be readily extended to incorporate other ad- vanced commercial solvers available on the market today. In addition, con- cepts as stochastic programming and robust optimization are available to in- clude data uncertainty in your models. Mastering Aimms is straightforward since the language concepts will be intu- Mastering itive to Operations Research (OR) professionals, and the point-and-click graph- Aimms ical interface is easy to use. Aimms comes with comprehensive documentation, available electronically and in book form. Aimms provides an ideal platform for creating advanced prototypes that are Types of Aimms then easily transformed into operational end-user systems. Such systems can applications than be used either as stand-alone applications, or optimization components. vi About Aimms Stand-alone Application developers and operations research experts use Aimms to build applications complex and large scale optimization models and to create a graphical end- user interface around the model. Aimms-based applications place the power of the most advanced mathematical modeling techniques directly into the hands of end-users, enabling them to rapidly improve the quality, service, profitabil- ity, and responsiveness of their operations. Optimization Independent Software Vendors and OEMs use Aimms to create complex and components large scale optimization components that complement their applications and web services developed in languages such as C++, Java, .NET, or Excel. Appli- cations built with Aimms-based optimization components have a shorter time- to-market, are more robust and are richer in features than would be possible through direct programming alone. Aimms users Companies using Aimms include ABN AMRO Merck Areva Owens Corning Bayer Perdig˜ao Bluescope Steel Petrobras BP Philips CST PriceWaterhouseCoopers ExxonMobil Reliance Gaz de France Repsol Heineken Shell Innovene Statoil Lufthansa Unilever Universities using Aimms include Budapest University of Technology, Carnegie Mellon University, George Mason University, Georgia Institute of Technology, Japan Advanced Institute of Science and Technology, London School of Eco- nomics, Nanyang Technological University, Rutgers University, Technical Uni- versity of Eindhoven, Technische Universit¨at Berlin, UIC Bioengineering, Uni- versidade Federal do Rio de Janeiro, University of Groningen, University of Pittsburgh, University of Warsaw, and University of the West of England. A more detailed list of Aimms users and reference cases can be found on our website www.aimms.com. Contents About Aimms v Contents vii Preface xvii What’s new in Aimms 4........................ xvii What is in the Aimms documentation . xviii WhatisintheLanguageReference. xx Theauthors............................... xxiii Part I Preliminaries 3 1 Introduction to the Aimms language 3 1.1 Thedepotlocationproblem..................... 3 1.2 Formulationofthemathematicalprogram. 6 1.3 Datainitialization ........................... 9 1.4 Anadvancedmodelextension . 11 1.5 Generalmodelingtips ........................ 14 2 Language Preliminaries 17 2.1 Managingyourmodel......................... 17 2.2 Identifierdeclarations ........................ 20 2.3 Lexicalconventions .......................... 21 2.4 Expressionsandstatements. 25 2.5 Datainitialization ........................... 27 Part II Non-Procedural Language Components 31 3 Set Declaration 31 3.1 Setsandindices ............................ 31 3.2 Set declarationandattributes. 32 3.2.1 Simplesets .......................... 32 viii Contents 3.2.2 Integersets .......................... 36 3.2.3 Relations............................ 38 3.2.4 Indexedsets.......................... 39 3.3 INDEX declarationandattributes . 40 4 Parameter Declaration 42 4.1 Parameter declarationandattributes. 43 4.1.1 Propertiesand attributesfor uncertaindata . 47 5 Set, Set Element and String Expressions 49 5.1 Setexpressions............................. 49 5.1.1 Enumeratedsets ....................... 50 5.1.2 Constructedsets.................... ... 53 5.1.3 Setoperators ......................... 54 5.1.4 Setfunctions ......................... 55 5.1.5 Iterativesetoperators . 57 5.1.6 Set element expressions as singleton sets . 59 5.2 Setelementexpressions .................... ... 60 5.2.1 Intrinsic functions for sets and set elements . 61 5.2.2 Element-valued iterative expressions . 62 5.2.3 Lag and lead element operators . 64 5.3 Stringexpressions........................... 65 5.3.1 Stringoperators ....................... 66 5.3.2 Formattingstrings. 67 5.3.3 Stringmanipulation . 70 5.3.4 Converting strings to set elements . 71 6 Numerical and Logical Expressions 73 6.1 Numericalexpressions ..................... ... 73 6.1.1 Real values and arithmetic extensions . 74 6.1.2 Listexpressions ....................... 75 6.1.3 References........................... 76 6.1.4 Arithmeticfunctions . 78 6.1.5 Numericaloperators . 78 6.1.6 Numericaliterativeoperators . 80 6.1.7 Statisticalfunctionsandoperators. 81 6.1.8 Financialfunctions . 84 6.1.9 Conditionalexpressions . 85 6.2 Logicalexpressions .......................... 87 6.2.1 Logicaloperatorexpressions . 88 6.2.2 Numericalcomparison . 89 6.2.3 Set and element comparison . 90 6.2.4 Stringcomparison................... ... 92 6.2.5 Logicaliterativeexpressions. 92 6.3 Operatorprecedence ......................... 93 6.4 MACRO declarationandattributes . 93 Contents ix 7 Execution of Nonprocedural Components 96 7.1 Dependencystructureofdefinitions . 96 7.2 Expressions and statements allowed in definitions . 98 7.3 Nonproceduralexecution . 101 Part III Procedural Language Components 105 8 Execution Statements 105 8.1 Proceduralandnonproceduralexecution. 105 8.2 Assignmentstatements . 106 8.3 Flowcontrolstatements