Sie sind auf Seite 1von 252

ILOG OPL Studio 3.

7
Component Libraries Reference Manual
September 2003

Copyright 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.
JavaTM 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.

Contents

Component Libraries Reference Manual


Preface

Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
What are the OPL Component Libraries? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
How this Document is Organized . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
What You Need to Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Notation and Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Users Mailing List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Web Site. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Part I

The COM/ActiveX API . . . . . . . . . . . . . . . . . . . . . . . . . . . 15


COPLscriptSolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
COPLsolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
IOPLactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
IOPLarray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
IOPLbasisStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
IOPLchar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
IOPLconstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL 3

CONTENTS

IOPLdata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
IOPLenum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
IOPLenumIterator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
IOPLenumValue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
IOPLenumVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
IOPLerrorReporter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
IOPLfloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
IOPLfloatRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
IOPLfloatVar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
IOPLint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
IOPLintRange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
IOPLintVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
IOPLscriptSolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
IOPLset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
IOPLsetIterator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
IOPLsolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
IOPLstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
IOPLstruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

Part II

The C++ API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93


OPLactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
OPLalternativeResource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
OPLarray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
OPLbasisStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
OPLchar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
OPLconstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
OPLdata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
OPLdiscreteEnergy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
OPLdiscreteResource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
OPLenum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
OPLenumIterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

4I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

CONTENTS

OPLenumValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
OPLenumVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
OPLerrorReporter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
OPLfloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
OPLfloatRange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
OPLfloatVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
OPLint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
OPLinternalError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
OPLintRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
OPLintVar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
OPLreservoir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
OPLruntimeError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
OPLscriptSolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
OPLsemanticError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
OPLset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
OPLsetIterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
OPLsolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
OPLstateResource. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
OPLstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
OPLstruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
OPLsyntaxError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
OPLunaryResource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

Part III

The Java API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161


OPLactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
OPLadaptable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
OPLadaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
OPLarray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
OPLbasisStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
OPLchar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
OPLconstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL 5

CONTENTS

OPLdata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
OPLenum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
OPLenumIterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
OPLenumValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
OPLenumVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
OPLerrorReporter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
OPLexception. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
OPLfloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
OPLfloatRange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
OPLfloatVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
OPLint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
OPLintRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
OPLintVar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
OPLrequirement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
OPLrulesAdaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
OPLscriptSolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
OPLset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
OPLsetIterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
OPLsolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
OPLstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
OPLstruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
OPLsymmetricRequirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

6I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

Preface

This reference manual describes the ILOG OPL Component Libraries.

What are the OPL Component Libraries?


The ILOG OPL Component Libraries comprise different APIs that allow access to the OPL
solving engine. These APIs include the Microsoft COM/ActiveX component, a C++
component and a Java component.
The OPL engine is available as a COM/ActiveX component, through a dynamic library
(oplServer.dll) on Windows platforms. Microsofts Component Object Model

(COM) allows Windows users to access OPL from within languages such as
Visual Basic, C++, VBScript, JScript and Delphi.
The OPL engine is available as a C++ component, through a static library on both UNIX
platforms (libopl.a) and Windows platforms (opl.lib). The static library provides

the same functionality as the COM component, and in addition accesses the underlying
C++ library objects.
The OPL engine is available as a Java component, through a dynamic library on both
UNIX platforms (libopljni.so) and Windows platforms (opljni.dll).

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL 7

How this Document is Organized


This reference manual contains three parts, each one describing an interface to the OPL
solving engine.
Part 1 documents a COM/ActiveX layer on Microsoft Windows operating systems. For

each COM interface, the manual gives:

its description

its synopsis in IDL (Interface Definition Language)

separate language dependent synopses, in Visual Basic and C++

a description of each member function.

Part 2 documents the C++ interface.


Part 3 documents the Java interface. The Java classes act as wrappers around the OPL

solving engine and OPL declared entities.

What You Need to Know


This manual assumes that you can write Visual Basic, C++, or Java code and that you know
the basic concepts of Microsoft COM/ActiveX and IDL (Interface Definition Language).

Notation and Naming Conventions


Throughout this manual, the following typographic conventions apply:
Samples of code are written in this typeface.
The names of member functions appear in this typeface in the section where they are

documented.
Important ideas are emphasized like this.
The letters COPL prefix the names of the COM classes, also known as coclasses.
The letters IOPL prefix the names of the COM interfaces.
The letters OPL prefix the names of the C++ classes.

8I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

Related Documents
The ILOG OPL Component Libraries come with:
An online version of this reference manual in HTML. It is part of the standard

distribution of the product, accessible through conventional HTML browsers.


ILOG OPL Studio: Component Libraries Users Manual

This document contains examples showing how to use the APIs in order to access OPL
from Visual Basic, C++, and Java.
ILOG OPL Studio: Language Manual

This book, containing a description of the OPL programming language, is based on


The OPL Optimization Programming Language by Pascal Van Hentenryck, published by
The MIT Press, 1999, Cambridge, Massachusetts.
ILOG OPL Studio: Language Quick Reference

This online document provides a handy reference to OPL and OPLScript syntax.
ILOG OPL Studio: Users Manual

Describes the graphical user interface for the OPL modeling language. All development
effort is supported through the various modules accessible via ILOG OPL Studio.
Source code for examples delivered in the standard distribution.
A README file delivered as part of the standard distribution. This file contains the most

recent information about platform prerequisites for the ILOG OPL Component Libraries.

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL 9

For More Information


For technical support of ILOG OPL Component Libraries, you should 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
(numro vert)

+33 (0)1 49 08 35 10

Germany

oplstudio-support@ilog.de

+49 6172 40 60 - 0

+49 6172 40 60 -10

Japan

oplstudio-support@ilog.jp

+81 3 5211 5770

+81 3 5211 5771

North America

oplstudio-support@ilog.com

1-877-ILOG-TECH
(toll free)

+1 650 567 8001

Singapore

oplstudio-support@ilog.com.sg +65 773 06 26

+65 773 04 39

Spain

oplstudio-support@ilog.es

+34 91 372 9976

United Kingdom oplstudio-support@ilog.co.uk

+34 91 710 2480

+44 (0)1344 661 630 +44 (0)1344 661 601

We encourage you to use e-mail for faster, better service.


Users Mailing List
The electronic mailing list oplstudio-list@ilog.fr is available for you to share your
development experience with other OPL Studio users. This list is not moderated, but
subscription is subject to an on-going maintenance contract. To subscribe to oplstudiolist, send e-mail without any subject to oplstudio-list-owner@ilog.fr, with the
following contents:
subscribe oplstudio-list
your e-mail address if different from the From field
first name, last name
your location (company and country)
maintenance contract number
maintenance contract owners last name

10I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

Web Site
The technical support pages on our world wide web sites 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

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 11

12I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

Part I

The COM/ActiveX API

This part of the manual documents the COM/ActiveX API, which provides access to the
OPL solving engine.
The OPL engine is available as a COM/ActiveX component on Windows platforms. This
means that Windows users can solve an OPL model and examine the solution from Visual
Basic, Visual Basic for Applications (VBA*), VBScript, JScript*, HTML, Delphi, or C++
applications.
* VBA is the Microsoft Excel scripting language. JScript is the Microsoft implementation of
of JavaScript.
Note: The.dll file implementing The OPL Component Library is loaded into the client
process, and all the OPL objects will reside in the client's address space.
Each COM/ActiveX interface, class, or enumeration contains:
a description of its function
its synopsis in IDL (Interface Definition Language)
separate language dependent synopses in Visual J++, Visual Basic and C++
a description of each of its member functions, where applicable.

As the synopsis of each COM/ActiveX interface contains the method signatures for all three
languages (IDL, Visual Basic, and C++), the Member Functions section gives the signatures
for IDL methods only. Again, this is done for the sake of clarity and simplicity.
I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 15

16I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

COPLscriptSolver

COPLscriptSolver
Category

COM/ActiveX class

Implementation

IOPLscriptSolver, IClassFactory

Description

This COM class encapsulates the OPL engine and implements the IOPLscriptSolver
interface. The way you instantiate a COPLscriptSolver, and obtain an
IOPLscriptSolver interface reference to it, depends on the language you use.

IDL Synopsis

coclass COPLscriptSolver {
[default] interface IOPLscriptSolver;
interface IClassFactory;
}

Examples

Visual Basic
The example in Visual basic below shows you how to instantiate the
COPLscriptSolver COM class from a Visual Basic program.
Dim solver As COPLscriptSolver
Set solver = New COPLscriptSolver

C++
The example in C++ below shows you how to obtain a pointer to the IOPLsolver
interface while instantiating the COPLscriptSolver COM class.
#include <objbase.h>
#include <ilopl/oplitf.h>
#include <ilopl/oplitf_i.c>
.
.
IOPLsolver* itf = 0;
HRESULT hr = CoInitializeEx(0);
if (SUCCEEDED(hr)) {
hr = CoCreateInstance(CLSID_COPLscriptSolver,0,CLSCTX_ALL,
IID_IOPLsolver,(void **)&itf);
if (SUCCEEDED(hr) && itf) {
// Use of interface pointer itf
.....
itf->Release();
}
CoUninitialize();
}
.
.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 17

COPLscriptSolver

JScript
var solver = new
ActiveXObject("COPLscriptSolver.scriptSolverMeta.7");

Visual Basic Script


Dim solver
Set solver =
CreateObject("COPLscriptSolver.scriptSolverMeta.7")

HTML
<OBJECT ID="solver" CLASSID="Clsid:4326caa4-743c-11d4-a9d700c04f68a8a8"></OBJECT>

See Also

IOPLscriptSolver

18 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

COPLsolver

COPLsolver
Category

COM/ActiveX class

Implementation

IOPLsolver, IClassFactory

Description

This COM class encapsulates the OPL engine and implements the IOPLsolver
interface. The way you instantiate a COPLsolver object, and obtain an IOPLsolver
interface reference to it, depends on the language you use.
In Visual Basic you can obtain a reference to an IOPLsolver interface by allocating
an object of the class COPLsolver.
In C++, you can obtain a pointer to the IOPLsolver abstract class through the
CoCreateInstance function, by specifying the COM interface identifier (IID) and

the COM class identifier (CLSID).


IDL Synopsis

coclass COPLsolver {
[default]interface IOPLsolver;
interface IClassFactory;
};

Examples

Visual Basic
The example in Visual basic below shows you how to instantiate the COPLsolver COM
class from a Visual Basic program.
Dim solver As COPLsolver
Set solver = New COPLsolver

C++
The example in C++ below shows you how to obtain a pointer to the IOPLsolver
interface while instantiating the COPLsolver COM class.
#include <objbase.h>
#include <ilopl/oplitf.h>
#include <ilopl/oplitf_i.c>
...
IOPLsolver* itf = 0;
HRESULT hr = CoInitializeEx(0);
if (SUCCEEDED(hr)) {
hr = CoCreateInstance(CLSID_COPLsolver,0,CLSCTX_ALL,
IID_IOPLsolver,(void **)&itf);
if (SUCCEEDED(hr) && itf) {
// Use of interface pointer itf
.....
itf->Release();
}
CoUninitialize();
}
....

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 19

COPLsolver

JScript
var solver = new ActiveXObject(COPLsolver.solverMeta.7);

Visual Basic Script


Dim solver =
CreateObject(COPLsolver.solverMeta.7);

HTML
<OBJECT ID=solver CLASSID=ba54d0f8-6dde-11d4-a9d1-00c04f68a8a8
/OBJECT>

See Also

IOPLsolver

20 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLactivity

IOPLactivity
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

IOPLactivity is an interface to objects of the type Activity defined in an OPL

model.
IDL Synopsis

interface IOPLactivity : IOPLdata {


HRESULT getDuration([out,retval] int* v);
HRESULT getEnd([out,retval] int* v);
HRESULT getStart([out,retval] int* v);
};

Visual Basic Synopsis


Class IOPLactivity
Function getDuration() As Long
Function getEnd() As Long
Function getStart() As Long

C++ Synopsis

class IOPLactivity:public IOPLdata


{
public:
virtual STDMETHODIMP getDuration(int* v) = 0;
virtual STDMETHODIMP getEnd(int* v) = 0;
virtual STDMETHODIMP getStart(int* v) = 0;
};

Member Functions
HRESULT getDuration([out,retval] int* v);

This member function enables the client code to access the duration field of the OPL
activity interfaced with the invoking object.
HRESULT getEnd([out,retval] int* v);

This member function enables the client code to access the end field of the OPL activity
interfaced with the invoking object.
HRESULT getStart([out,retval] int* v);

This member function enables the client code to access the start field of the OPL
activity interfaced with the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 21

IOPLarray

IOPLarray
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

IOPLarray provides an interface to array data structures defined in an OPL model.

IDL Synopsis

interface IOPLarray : IOPLdata {


HRESULT eltActivity([in] int i,[out,retval] IOPLactivity** v);
HRESULT eltArray([in] int i,[out,retval] IOPLarray** v);
HRESULT eltChar([in] int i,[out,retval] IOPLchar** v);
HRESULT eltConstraint([in] int i,
[out,retval] IOPLconstraint** v);
HRESULT eltEnumValue([in] int i,[out,retval] IOPLenumValue** v);
HRESULT eltEnumVar([in] int i,[out,retval] IOPLenumVar** v);
HRESULT eltFloat([in] int i,[out,retval] IOPLfloat** v);
HRESULT eltFloatVar([in] int i,[out,retval] IOPLfloatVar** v);
HRESULT eltInt([in] int i,[out,retval] IOPLint** v);
HRESULT eltIntVar([in] int i,[out,retval] IOPLintVar** v);
HRESULT eltSet([in] int i,[out,retval] IOPLset** v);
HRESULT eltString([in] int i,[out,retval] IOPLstring** v);
HRESULT eltStruct([in] int i,[out,retval] IOPLstruct** v);
HRESULT getActivity([in] IOPLdata* i,
HRESULT getArray([in] IOPLdata* i,[out,retval] IOPLarray** v);
HRESULT getChar([in] IOPLdata* i,[out,retval] IOPLchar** v);
HRESULT getClone([out,retval] IOPLarray** ret);
HRESULT getConstraint([in] IOPLdata* i,
[out,retval] IOPLconstraint** v);
HRESULT getEnumValue([in] IOPLdata* i,
[out,retval] IOPLenumValue** v);
HRESULT getEnumVar([in] IOPLdata* i,[out,retval] IOPLenumVar** v);

HRESULT getFloat([in] IOPLdata* i,[out,retval] IOPLfloat** v);


HRESULT getFloatVar([in] IOPLdata* i,
[out,retval] IOPLfloatVar** v);
HRESULT getHigh([out,retval] int* ar);
HRESULT getInt([in] IOPLdata* i,[out,retval] IOPLint** v);
HRESULT getIntVar([in] IOPLdata* i,[out,retval] IOPLintVar** v);

HRESULT getLow([out,retval] int* ar);


HRESULT getSet([in] IOPLdata* i,[out,retval] IOPLset** v);
HRESULT getSize([out,retval] int* ar);
HRESULT getString([in] IOPLdata* i,[out,retval] IOPLstring** v);
HRESULT getStruct([in] IOPLdata* i,[out,retval] IOPLstruct** v);

};

22 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLarray
Visual Basic Synopsis
Class IOPLarray
Function eltActivity(i As Long) As IOPLactivity
Function eltArray(i As Long) As IOPLarray
Function eltChar(i As Long) As IOPLchar
Function eltConstraint(i As Long) As IOPLconstraint
Function eltEnumValue(i As Long) As IOPLenumValue
Function eltEnumVar(i As Long) As IOPLenumVar
Function eltFloat(i As Long) As IOPLfloat
Function eltFloatVar(i As Long) As IOPLfloatVar
Function eltInt(i As Long) As IOPLint
Function eltIntVar(i As Long) As IOPLintVar
Function eltSet(i As Long) As IOPLset
Function eltString(i As Long) As IOPLstring
Function eltStruct(i As Long) As IOPLstruct
Function getActivity(i As IOPLdata) As IOPLactivity
Function getArray(i As IOPLdata) As IOPLarray
Function getChar(i As IOPLdata) As IOPLchar
Function getClone() As IOPLarray
Function getConstraint(i As IOPLdata) As IOPLconstraint
Function getEnumValue(i As IOPLdata) As IOPLenumValue
Function getEnumVar(i As IOPLdata) As IOPLenumVar
Function getFloat(i As IOPLdata) As IOPLfloat
Function getFloatVar(i As IOPLdata) As IOPLfloatVar
Function getHigh() As Long
Function getInt(i As IOPLdata) As IOPLint
Function getIntVar(i As IOPLdata) As IOPLintVar
Function getLow() As Long
Function getSet(i As IOPLdata) As IOPLset
Function getSize() As Long
Function getString(i As IOPLdata) As IOPLstring
Function getStruct(i As IOPLdata) As IOPLstruct

C++ Synopsis

class IOPLarray : public IOPLdata


{
public:
virtual STDMETHODCALLTYPE eltActivity(int i,
IOPLactivity * *v) = 0;
virtual STDMETHODCALLTYPE eltArray(int i, IOPLarray * *v) = 0;
virtual STDMETHODCALLTYPE eltChar(int i, IOPLchar * *v) = 0;
virtual STDMETHODCALLTYPE eltConstraint
(int i, IOPLconstraint * *v) = 0;
virtual STDMETHODCALLTYPE eltEnumValue
(int i, IOPLenumValue * *v) = 0;
virtual STDMETHODCALLTYPE eltEnumVar(int i,
IOPLenumVar * *v) = 0;
virtual STDMETHODCALLTYPE eltFloat(int i, IOPLfloat * *v) = 0;
virtual STDMETHODCALLTYPE eltFloatVar(int i,
IOPLfloatVar * *v) = 0;
virtual STDMETHODCALLTYPE eltInt(int i, IOPLint * *v) = 0;
virtual STDMETHODCALLTYPE eltIntVar(int i,
IOPLintVar * *v) = 0;

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 23

IOPLarray

virtual STDMETHODCALLTYPE eltSet(int i, IOPLset * *v) = 0;


virtual STDMETHODCALLTYPE eltString(int i,
IOPLstring * *v) = 0;
virtual STDMETHODCALLTYPE eltStruct(int i,
IOPLstruct * *v) = 0;
virtual STDMETHODCALLTYPE getActivity(IOPLdata *i,
IOPLactivity * *v) = 0;
virtual STDMETHODCALLTYPE getArray
(IOPLdata *i, IOPLarray * *v) = 0;
virtual STDMETHODCALLTYPE getChar
(IOPLdata *i, IOPLchar * *v) = 0;
virtual STDMETHODCALLTYPE getClone(IOPLarray * *ret) = 0;
virtual STDMETHODCALLTYPE getConstraint
(IOPLdata *i, IOPLconstraint * *v) = 0;
virtual STDMETHODCALLTYPE getEnumValue
(IOPLdata *i, IOPLenumValue * *v) = 0;
virtual STDMETHODCALLTYPE getEnumVar
(IOPLdata *i, IOPLenumVar * *v) = 0;
virtual STDMETHODCALLTYPE getFloat
(IOPLdata *i, IOPLfloat * *v) = 0;
virtual STDMETHODCALLTYPE getFloatVar
(IOPLdata *i, IOPLfloatVar * *v) = 0;
virtual STDMETHODCALLTYPE getHigh(int *ar) = 0;
virtual STDMETHODCALLTYPE getInt(IOPLdata

*i, IOPLint * *v) = 0;

virtual STDMETHODCALLTYPE getIntVar


(IOPLdata *i, IOPLintVar * *v) = 0;
virtual STDMETHODCALLTYPE getLow(int *ar) = 0;
virtual STDMETHODCALLTYPE getSet(IOPLdata

*i, IOPLset

* *v) = 0;

virtual STDMETHODCALLTYPE getSize(int *ar) = 0;


virtual STDMETHODCALLTYPE getString
(IOPLdata *i, IOPLstring * *v) = 0;
virtual STDMETHODCALLTYPE getStruct
(IOPLdata *i, IOPLstruct * *v) = 0;
};

Member Functions
HRESULT eltActivity([in] int i,[out,retval] IOPLactivity** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of activities indexed by an integer range. The integer argument i is the index
of the element being accessed. When successfully called from Visual Basic, this member
function returns an interface object of the class IOPLactivity. When successfully
called from C++, this member function will fill the memory pointed to by the pointer
argument v with a pointer to an interface object of the class IOPLactivity.
HRESULT eltArray([in] int i,[out,retval] IOPLarray** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of arrays indexed by an integer range. The integer argument i is the index of
the element being accessed. When successfully called from Visual Basic, this member
24 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLarray

function returns an interface object of the class IOPLarray. When successfully called
from C++, this member function will fill the memory pointed to by the pointer argument
v with a pointer to an interface object of the class IOPLarray.
HRESULT eltChar([in] int i,[out,retval] IOPLchar** v);

Returns the vth element of the array and interprets it as a char (if possible, otherwise
it raises a runtime error).
HRESULT eltConstraint([in] int i,[out,retval] IOPLconstraint** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of constraints, indexed by an integer range. The integer argument i is the
index of the element being accessed. When successfully called from Visual Basic, this
member function returns an interface object of the class IOPLconstraint. When
successfully called from C++, this member function will fill the memory pointed to by
the pointer argument v with a pointer to an interface object of the class
IOPLconstraint.
HRESULT eltEnumValue([in] int i,[out,retval] IOPLenumValue** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated values, indexed by an integer range. The integer argument i is
the index of the element being accessed. When successfully called from Visual Basic,
this member function returns an interface object of the class IOPLenumValue. When
successfully called from C++, this member function will fill the memory pointed to by
the pointer argument v with a pointer to an interface object of the class
IOPLenumValue.
HRESULT eltEnumVar([in] int i,[out,retval] IOPLenumVar** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated variables indexed by an integer range. The integer argument i
is the index of the element being accessed. When successfully called from Visual Basic,
this member function returns an interface object of the class IOPLenumVar. When
successfully called from C++, this member function will fill the memory pointed to by
the pointer argument v with a pointer to an interface object of the class IOPLenumVar.
HRESULT eltFloat([in] int i,[out,retval] IOPLfloat** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of floats, indexed by an integer range. The integer argument i is the index of
the element being accessed. When successfully called from Visual Basic, this member

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 25

IOPLarray

function returns an interface object of the class IOPLfloat. When successfully called
from C++, this member function will fill the memory pointed to by the pointer argument
v with a pointer to an interface object of the class IOPLfloat.
HRESULT eltFloatVar([in] int i,[out,retval] IOPLfloatVar** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of float variables indexed by an integer range. The integer argument i is the
index of the element being accessed. When successfully called from Visual Basic, this
member function returns an interface object of the class IOPLfloatVar. When
successfully called from C++, this member function will fill the memory pointed to by
the pointer argument v with a pointer to an interface object of the class IOPLfloatVar.
HRESULT eltInt([in] int i,[out,retval] IOPLint** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integers, indexed by an integer range. The integer argument i is the index
of the element being accessed. When successfully called from Visual Basic, this member
function returns an interface object of the class IOPLint. When successfully called from
C++, this member function will fill the memory pointed to by the pointer argument v
with a pointer to an interface object of the class IOPLint.
HRESULT eltIntVar([in] int i,[out,retval] IOPLintVar** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integer variables indexed by an integer range. The integer argument i is the
index of the element being accessed. When successfully called from Visual Basic, this
member function returns an interface object of the class IOPLintVar. When
successfully called from C++, this member function will fill the memory pointed to by
the pointer argument v with a pointer to an interface object of the class IOPLintVar.
HRESULT eltSet([in] int i,[out,retval] IOPLset** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of sets, indexed by an integer range. The integer argument i is the index of
the element being accessed. When successfully called from Visual Basic, this member
function returns an interface object of the class IOPLset. When successfully called from
C++, this member function will fill the memory pointed to by the pointer argument v
with a pointer to an interface object of the class IOPLset.
HRESULT eltString([in] int i,[out,retval] IOPLstring** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of strings, indexed by an integer range. The integer argument i is the index of
26 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLarray

the element being accessed. When successfully called from Visual Basic, this member
function returns an interface object of the class IOPLstring. When successfully called
from C++, this member function will fill the memory pointed to by the pointer argument
v with a pointer to an interface object of the class IOPLstring.
HRESULT eltStruct([in] int i,[out,retval] IOPLstruct** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of records, indexed by an integer range. The integer argument i is the index
of the element being accessed. When successfully called from Visual Basic, this member
function returns an interface object of the class IOPLstruct. When successfully called
from C++, this member function will fill the memory pointed to by the pointer argument
v with a pointer to an interface object of the class IOPLstruct.
HRESULT getActivity([in] IOPLdata* i,[out,retval] IOPLactivity** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of activities. The input argument i is the index of the element being accessed.
The index must be an object of the class IOPLdata. When successfully called from
Visual Basic, this member function returns an interface object of the class
IOPLactivity. When successfully called from C++, this member function will fill the
memory pointed to by the pointer argument v with a pointer to an interface object of
class IOPLactivity.
HRESULT getArray([in] IOPLdata* i,[out,retval] IOPLarray** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of arrays. The input argument i is the index of the element being accessed.
The index must be an object of the class IOPLdata. When successfully called from
Visual Basic, this member function returns an interface object of the class IOPLarray.
When successfully called from C++, this member function will fill the memory pointed
to by the pointer argument v with a pointer to an interface object of the class
IOPLarray.
HRESULT getChar([in] IOPLdata* i,[out,retval] IOPLchar** v);

Returns the vth element of the array and interprets it as a char (if possible, otherwise it
raises a runtime error).
HRESULT getClone([out,retval] IOPLarray** ret);

This member function enables the client code to construct a new interface object of the
same class as the invoking object. The new object interfaces to the same OPL data item
as the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 27

IOPLarray

HRESULT getConstraint([in] IOPLdata* i,


[out,retval] IOPLconstraint** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes the array in the OPL model being declared
as an array of constraints. The input argument 'i' is the index of the element being
accessed. The index must be an object of class IOPLdata. When successfully called from
Visual Basic, this member function returns an interface object of the class
IOPLconstraint. When successfully called from C++, this member function will fill
the memory pointed to by the pointer argument v with a pointer to an interface object of
the class IOPLconstraint.
HRESULT getEnumValue([in] IOPLdata* i,[out,retval] IOPLenumValue** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated values. The input argument i is the index of the element being
accessed. The index must be an object of the class IOPLdata. When successfully called
from Visual Basic, this member function returns an interface object of the class
IOPLenumValue. When successfully called from C++, this member function will fill the
memory pointed to by the pointer argument v with a pointer to an interface object of the
class IOPLenumValue.
HRESULT getEnumVar([in] IOPLdata* i,[out,retval] IOPLenumVar** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated variables. The input argument i is the index of the element
being accessed. The index must be an object of the class IOPLdata. When successfully
called from Visual Basic, this member function returns an interface object of the class
IOPLenumVar. When successfully called from C++, this member function will fill the
memory pointed to by the pointer argument v with a pointer to an interface object of the
class IOPLenumVar.
HRESULT getFloat([in] IOPLdata* i,[out,retval] IOPLfloat** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of floats. The input argument i is the index of the element being accessed. The
index must be an object of the class IOPLdata. When successfully called from Visual
Basic, this member function returns an interface object of the class IOPLfloat. When
successfully called from C++, this member function will fill the memory pointed to by
the pointer argument v with a pointer to an interface object of the class IOPLfloat.
HRESULT getFloatVar([in] IOPLdata* i,[out,retval] IOPLfloatVar** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of float variables. The input argument i is the index of the element being
28 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLarray

accessed. The index must be an object of the class IOPLdata. When successfully called
from Visual Basic, this member function returns an interface object of the class
IOPLfloatVar. When successfully called from C++, this member function will fill the
memory pointed to by the pointer argument v with a pointer to an interface object of the
class IOPLfloatVar.
HRESULT getHigh([out,retval] int* ar);

This member function enables the client code to retrieve the highest value allowed to
index the OPL array interfaced by the invoking object. It assumes that the OPL array is
indexed by an integer range.
HRESULT getInt([in] IOPLdata* i,[out,retval] IOPLint** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integers. The input argument i is the index of the element being accessed.
The index must be an object of class IOPLdata. When successfully called from Visual
Basic, this member function returns an interface object of the class IOPLint. When
successfully called from C++, this member function will fill the memory pointed to by
the pointer argument v with a pointer to an interface object of the class IOPLint.
HRESULT getIntVar([in] IOPLdata* i,[out,retval] IOPLintVar** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integer variables. The input argument i is the index of the element being
accessed. The index must be an object of the class IOPLdata. When successfully called
from Visual Basic, this member function returns an interface object of the class
IOPLintVar. When successfully called from C++, this member function will fill the
memory pointed to by the pointer argument v with a pointer to an interface object of the
class IOPLintVar.
HRESULT getLow([out,retval] int* ar);

This member function enables the client code to retrieve the lowest value allowed to
index the OPL array interfaced by the invoking object. It assumes that the OPL array is
indexed by an integer range.
HRESULT getSet([in] IOPLdata* i,[out,retval] IOPLset** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of sets. The input argument i is the index of the element being accessed. The
index must be an object of the class IOPLdata. When successfully called from Visual
Basic, this member function returns an interface object of the class IOPLset. When
successfully called from C++, this member function will fill the memory pointed to by
the pointer argument v with a pointer to an interface object of the class IOPLset.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 29

IOPLarray

HRESULT getSize([out,retval] int* ar);

This member function enables the client code to retrieve the size, as a number of
elements, of the OPL array interfaced by the invoking object.
HRESULT getString([in] IOPLdata* i,[out,retval] IOPLstring** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of strings. The input argument i is the index of the element being accessed.
The index must be an object of the class IOPLdata.When successfully called from
Visual Basic, this member function returns an interface object of the class IOPLstring.
When successfully called from C++, this member function will fill the memory pointed
to by the pointer argument v with a pointer to an interface object of the class
IOPLstring.
HRESULT getStruct([in] IOPLdata* i,[out,retval] IOPLstruct** v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of records. The input argument i is the index of the element being accessed.
The index must be an object of the class IOPLdata. When successfully called from
Visual Basic, this member function returns an interface object of the class IOPLstruct.
When successfully called from C++, this member function will fill the memory pointed
to by the pointer argument v with a pointer to an interface object of the class
IOPLstruct.

30 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLbasisStatus

IOPLbasisStatus
Category

COM enumeration

Description

This enumeration provides identifiers that describe the possible basis statuses for any
float variable or linear constraint occurring in a linear OPL model.
Use the member functions:
IOPLfloatVar::getBasisStatus,
IOPLconstraint::getBasisStatus

in order to obtain the basis status for a float variable or a linear constraint respectively.
The identifiers listed below, when associated with a variable, have the following
meanings:
IOPLnoBasis: no basis information was defined for the variable
IOPLatLower: the variable is at lower bound
IOPLinBasis: the variable is basic
IOPLatUpper: the variable is at upper bound
IOPLfreeSuper: the variable is free and non-basic.

The identifiers listed below, when associated with a constraint, have the following
meanings:
IOPLnoBasis: no basis information was defined for the constraint
IOPLatLower: associated slack/surplus/artificial variable non-basic at value 0.0
IOPLinBasis: associated slack/surplus/artificial variable basic.

IDL Synopsis

enum IOPLbasisStatus
{IOPLnoBasis = 0, IOPLatLower, IOPLinBasis, IOPLatUpper,
IOPLfreeSuper};

C++ Synopsis

enum IOPLbasisStatus
{IOPLnoBasis = 0,
IOPLatLower = IOPLnoBasis +
IOPLinBasis = IOPLatLower +
IOPLatUpper = IOPLinBasis +
IOPLfreeSuper = IOPLatUpper
};

See Also

1,
1,
1,
+ 1

IOPLfloatVar::getBasisStatus, IOPLconstraint::getBasisStatus

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 31

IOPLchar

IOPLchar
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLchar provides an interface to character types defined in an OPL model.

IDL Synopsis

interface IOPLchar : IOPLdata {


HRESULT getClone([out,retval] IOPLchar** ret);
HRESULT getValue([out,retval] wchar_t* v);
HRESULT setValue([in] wchar_t v);
};

Visual Basic Synopsis


Class IOPLchar
Function getClone() As IOPLchar
Function getValue() As char
Sub setValue(v As char)

C++ Synopsis

class IOPLchar : public


{
public:
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP
};

IOPLdata

getClone(IOPLchar** ret) = 0;
getValue(wchar_t* v) = 0;
setValue(wchar_t v) = 0;

Member Functions
HRESULT getClone([out,retval] IOPLchar** ret);

Creates a clone of the char object. Enables the client code to construct a new object of
the same class as the invoking object. The new object interfaces with the same OPL data
item as the invoking object.
HRESULT getValue([out,retval] wchar_t* v);

Returns the character stored in the object.


HRESULT setValue([in] wchar_t v);

Changes the character stored in the object to ch.

32 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLconstraint

IOPLconstraint
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLconstraint provides an interface to the constraints defined in an OPL


model.

IDL Synopsis

interface IOPLconstraint : IOPLdata {


HRESULT getBasisStatus([out,retval] enum IOPLbasisStatus*
ret);
HRESULT getBasisStatus([out,retval] double* ret);
HRESULT getBasisStatus([out,retval] IOPLconstraint** ret);
HRESULT getLhs([out,retval] double* ret);
HRESULT getRhs([out,retval] double* ret);
HRESULT getRight([out,retval] IOPLconstraint** ret);
HRESULT getSlack([out,retval] double* ret);
};

Visual J++ Synopsis


public interface IOPLconstraint extends oplserver.IOPLdata
{
public int getBasisStatus();
public double getDual();
public IOPLconstraint getLeft();
public double getLhs();
public double getBasisStatus();
public IOPLconstraint getRight();
public double getSlack();
}

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 33

IOPLconstraint
C++ Synopsis

class IOPLconstraint :
{
public:
virtual STDMETHODIMP
= 0;
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP
};

public IOPLdata

getBasisStatus(enum IOPLbasisStatus

*ret)

getDual(double *ret) = 0;
getLeft(IOPLconstraint * *ret) = 0;
getLhs(double *ret) = 0;
getRhs(double *ret) = 0;
getRight(IOPLconstraint * *ret) = 0;
getSlack(double *ret) = 0;

Member Functions
HRESULT getBasisStatus([out,retval] enum IOPLbasisStatus* ret);

This member function enables the client code to retrieve the basis status associated, in a
linear OPL model, with the linear constraint interfaced by the invoking object.
HRESULT getDual([out,retval] double* ret);

This member function enables the client code to get the dual value associated, in a linear
OPL model, with the linear constraint interfaced by the invoking object.
HRESULT getLeft([out,retval] IOPLconstraint** ret);

This member function enables the client code to retrieve an individual constraint
component of the constraint interfaced by the invoking object. It assumes that the
invoking object interfaces a constraint of the form l <= m <= u, or a constraint built
with binary logical operators.
HRESULT getLhs([out,retval] double* ret);

This member function enables the client code to access the value of the left-hand side of
the linear constraint interfaced by the invoking object.
HRESULT getRhs([out,retval] double* ret);

This member function enables the client code to access the value of the right-hand side
of the linear constraint interfaced by the invoking object.
HRESULT getRight([out,retval] IOPLconstraint** ret);

This member function enables the client code to retrieve an individual constraint
component of the constraint interfaced by the invoking object. It assumes that the
invoking object interfaces a constraint of the form l <= m <= u, or a constraint built
with binary logical operators.
HRESULT getSlack([out,retval] double* ret);

This member function enables the client code to retrieve the value of the slack
associated, in a linear OPL model, with the linear constraint interfaced by the invoking
object.
34 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLdata

IOPLdata
Category

Abstract COM/ActiveX interface

Inheritance Path

IDispatch

Description

This interface is the base interface for the other IOPL* COM/ActiveX interfaces that
refer to the data items of an OPL model.

IDL Synopsis

interface IOPLdata : IDispatch {


HRESULT getImpl([out,retval] IUnknown** impl);
}

Visual Basic Synopsis


Class IOPLdata
Function getImpl() As IUnknown

C++ Synopsis

class IOPLdata : public IDispatch


{
public:
virtual STDMETHODIMP getImpl(
/* [retval][out] */ IUnknown
};

* *impl) = 0;

Member Function
HRESULT getImpl([out,retval] IUnknown** impl);

This member function provides a reference to the object internally used by the OPL
engine in order to implement the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 35

IOPLenum

IOPLenum
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLenum provides an interface to enumeration types defined in an OPL


model.

IDL Synopsis

interface IOPLenum : IOPLdata {


HRESULT getCard([out,retval] int* c);
HRESULT getFirst([out,retval] IOPLenumValue** ppEv);
HRESULT getIterator([out,retval] IOPLenumIterator** ppIt);
HRESULT getLast([out,retval] IOPLenumValue** ppEv);
HRESULT getNext([in] IOPLenumValue* ev,
[out,retval] IOPLenumValue** ppEv);
HRESULT getNextc([in] IOPLenumValue* ev,
HRESULT getOrd([in] IOPLenumValue* pEv,
[out,retval] int* ordinal);
HRESULT getPrev([in] IOPLenumValue* ev,
[out,retval] IOPLenumValue** ppEv);
HRESULT getPrevc([in] IOPLenumValue* ev,
[out,retval] IOPLenumValue** ppEv);
HRESULT getValue([in] BSTR valName,
[out,retval] IOPLenumValue** ppEv);
};

Visual Basic Synopsis


Class IOPLenum
Function getCard() As Long
Function getFirst() As IOPLenumValue
Function getIterator() As IOPLenumIterator
Function getLast() As IOPLenumValue
Function getNext(ev As IOPLenumValue) As IOPLenumValue
Function getNextc(ev As IOPLenumValue) As IOPLenumValue
Function getOrd(pEv As IOPLenumValue) As Long
Function getPrev(ev As IOPLenumValue) As IOPLenumValue
Function getPrevc(ev As IOPLenumValue) As IOPLenumValue
Function getValue(valName As String) As IOPLenumValue

36 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLenum
C++ Synopsis

class IOPLenum : public IOPLdata


{
public:
virtual STDMETHODIMP getCard(int *c) = 0;
virtual STDMETHODIMP getFirst(IOPLenumValue * *ppEv) = 0;
virtual STDMETHODIMP getIterator
(IOPLenumIterator * *ppIt) = 0;
virtual STDMETHODIMP getLast(IOPLenumValue * *ppEv) = 0;
virtual STDMETHODIMP getNext(IOPLenumValue *ev,
IOPLenumValue * *ppEv) = 0;
virtual STDMETHODIMP getNextc(IOPLenumValue *ev,
IOPLenumValue * *ppEv) = 0;
virtual STDMETHODIMP getPrev(IOPLenumValue *ev,
IOPLenumValue * *ppEv) = 0;
virtual STDMETHODIMP getPrevc(IOPLenumValue *ev,
IOPLenumValue * *ppEv) = 0;
virtual STDMETHODIMP getValue(BSTR valName,
IOPLenumValue * *ppEv) = 0;
};

Member Functions
HRESULT getCard([out,retval] int* c);

This member function enables the client code to obtain the cardinality (i.e. the number of
values) of the OPL enumeration interfaced by the invoking object.
HRESULT getFirst([out,retval] IOPLenumValue** ppEv);

This member function enables the client code to access the first enumerated value of the
OPL enumeration interfaced by the invoking object. When successfully called from
Visual Basic, this member function returns an interface object of the class
IOPLenumValue. When successfully called from C++, this member function will fill the
memory pointed to by the pointer argument ppEv with a pointer to an interface object of
the class IOPLenumValue.
HRESULT getIterator([out,retval] IOPLenumIterator** ppIt);

This member function constructs a new iterator object, instance of the class
IOPLenumIterator. Further, this iterator object will enable the client code to obtain
the enumerated values of the OPL enumeration interfaced by the invoking object.
HRESULT getLast([out,retval] IOPLenumValue** ppEv);

This member function enables the client code to access the last enumerated value of the
OPL enumeration interfaced by the invoking object. When successfully called from
Visual Basic, this member function returns an interface object of the class
IOPLenumValue. When successfully called from C++, this member function will fill the
memory pointed to by the pointer argument ppEv with a pointer to an interface object of
the class IOPLenumValue.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 37

IOPLenum

HRESULT getNext([in] IOPLenumValue* ev,


[out,retval] IOPLenumValue** ppEv);

This member function enables the client code to access the enumerated value which
follows, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. When successfully called from Visual Basic, this member
function returns an interface object of the class IOPLenumValue. When successfully
called from C++, this member function will fill the memory pointed to by the pointer
argument ppEv with a pointer to an interface object of the class IOPLenumValue.
HRESULT getNextc([in] IOPLenumValue* ev,

This member function enables the client code to access the enumerated value which
follows, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. The OPL enumeration is considered as circular, i.e. the last
value is followed by the first value and the first value is preceded by the last value. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLenumValue. When successfully called from C++, this member function
will fill the memory pointed to by the pointer argument ppEv with a pointer to an
interface object of the class IOPLenumValue.
HRESULT getOrd([in] IOPLenumValue* pEv,[out,retval] int* ordinal);

This member function enables the client code to retrieve the ordinal of the enumerated
value interfaced by the argument pEV, in the OPL enumeration interfaced by the invoking
object.
HRESULT getPrev([in] IOPLenumValue* ev,
[out,retval] IOPLenumValue** ppEv);

This member function enables the client code to access the enumerated value which
precedes, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. When successfully called from Visual Basic, this member
function returns an interface object of the class IOPLenumValue. When successfully
called from C++, this member function will fill the memory pointed to by the pointer
argument ppEv with a pointer to an interface object of the class IOPLenumValue.
HRESULT getPrevc([in] IOPLenumValue* ev,
[out,retval] IOPLenumValue** ppEv);

This member function enables the client code to access the enumerated value which
precedes, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. The OPL enumeration is considered as circular, i.e. the last
value is followed by the first value and the first value is preceded by the last value. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLenumValue. When successfully called from C++, this member function
will fill the memory pointed to by the pointer argument ppEv with a pointer to an
interface object of the class IOPLenumValue.

38 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLenum

HRESULT getValue([in] BSTR valName,


[out,retval] IOPLenumValue** ppEv);

This member function enables the client code to access the enumerated value with the
name valName in the OPL enumeration interfaced by the invoking object. When
successfully called from Visual Basic, this member function returns an interface object
of class IOPLenumValue. When successfully called from C++, this member function
will fill the memory pointed to by the pointer argument ppEv with a pointer to an
interface object of the class IOPLenumValue.
See Also

IOPLenumIterator

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 39

IOPLenumIterator

IOPLenumIterator
Category

COM/ActiveX interface

Inheritance Path

IDispatch

Description

The class IOPLenumIterator provides a way to find out the enumerated values of an
enumerated type defined in an OPL model. An instance of the class
IOPLenumIterator (an iterator object) can be constructed by calling the member
function IOPLenum::getIterator, where the invoking object, of the class IOPLenum,
interfaces the OPL enumeration to be iterated. Upon successful construction, the iterator
object initially points to the first value of the iterated OPL enumeration.

IDL Synopsis

interface IOPLenumIterator : IUnknown {


HRESULT get([out,retval] IOPLenumValue** ppEv);
HRESULT next();
HRESULT ok([out,retval] int* doneFlag);
HRESULT reset();
};

C++ Synopsis

class IOPLenumIterator : public IUnknown


{
public:
virtual STDMETHODIMP get(IOPLenumValue * *ppEv) = 0;
virtual STDMETHODIMP next(void) = 0;
virtual STDMETHODIMP ok(int *doneFlag) = 0;
virtual STDMETHODIMP reset(void) = 0;
};

40 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLenumIterator
Member Functions
HRESULT get([out,retval] IOPLenumValue** ppEv);

This member function can be used in order to access the enumerated value currently
pointed to by the invoking iterator. Prior to invoking this member function, use the
member function ok in order to ensure that the invoking object does not point "past the
end" of the iterated OPL enumeration. When successfully called from Visual Basic, this
member function returns an interface object of the class IOPLenumValue. When
successfully called from C++, this member function will fill the memory pointed to by
the pointer argument ppEv with a pointer to an interface object of the class
IOPLenumValue.
HRESULT next();

This member function enables the invoking object to point to the next enumerated value
of the iterated OPL enumeration.
HRESULT ok([out,retval] int* doneFlag);

This member function can be used in order to test whether the invoking object is pointing
"past the end" of the iterated OPL enumeration. If the returned value is non-zero, then the
member function IOPLenumIterator::get can be used further in order to access the
enumerated value currently pointed to by the invoking object.
HRESULT reset();

This member function re-initializes the invoking object such that it can be reused to
iterate over the same OPL enumeration, starting from its first value.
See Also

IOPLenum

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 41

IOPLenumValue

IOPLenumValue
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLenumValue provides an interface to values of enumerated types defined


in an OPL model.

IDL Synopsis

interface IOPLenumValue : IOPLdata {


HRESULT getClone([out,retval] IOPLenumValue** ret);
HRESULT getClone([out,retval] BSTR* str);
HRESULT getClone([out,retval] int* v);
HRESULT getClone([in] IOPLenumValue* e,[out,retval] int* b);
HRESULT isGreaterOrEqualTo([in] IOPLenumValue* e,
[out,retval] int* b);
HRESULT isGreaterThan([in] IOPLenumValue* e,
[out,retval] int* b);
HRESULT isNotEqualTo([in] IOPLenumValue* e,
[out,retval] int* b);
HRESULT isSmallerOrEqualTo([in] IOPLenumValue* e,
[out,retval] int* b);
HRESULT isSmallerThan([in] IOPLenumValue* e,
[out,retval] int* b);
HRESULT setValue([in] IOPLenumValue* v);
};

Visual Basic Synopsis


Class IOPLenumValue
Function getClone() As IOPLenumValue
Function getName() As String
Function getValue() As Long
Function isEqualTo(e As IOPLenumValue) As Long
Function isGreaterOrEqualTo(e As IOPLenumValue) As Long
Function isGreaterThan(e As IOPLenumValue) As Long
Function isNotEqualTo(e As IOPLenumValue) As Long
Function isSmallerOrEqualTo(e As IOPLenumValue) As Long
Function isSmallerThan(e As IOPLenumValue) As Long
Sub setValue(v As IOPLenumValue)

42 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLenumValue
C++ Synopsis

class IOPLenumValue : public IOPLdata


{
public:
virtual STDMETHODIMP getClone(IOPLenumValue * *ret) = 0;
virtual STDMETHODIMP getName(BSTR *str) = 0;
virtual STDMETHODIMP getValue(int *v) = 0;
virtual STDMETHODIMP isEqualTo(IOPLenumValue *e, int *b) = 0;
virtual STDMETHODIMP isGreaterOrEqualTo
(IOPLenumValue *e, int *b) = 0;
virtual STDMETHODIMP isGreaterThan
(IOPLenumValue *e, int *b) = 0;
virtual STDMETHODIMP isNotEqualTo
(IOPLenumValue *e, int *b) = 0;
virtual STDMETHODIMP isSmallerOrEqualTo
(IOPLenumValue *e, int *b) = 0;
virtual STDMETHODIMP isSmallerThan
(IOPLenumValue *e, int *b) = 0;
virtual STDMETHODIMP setValue(IOPLenumValue *v) = 0;
};

Member Functions
HRESULT getClone([out,retval] IOPLenumValue** ret);

This member function enables the client code to construct a new interface object of the
same class as the invoking object. The new object interfaces to the same OPL data item
as the invoking object.
HRESULT getName([out,retval] BSTR* str);

This member function enables the client code to retrieve the name of the OPL
enumerated value interfaced by the invoking object.
HRESULT getValue([out,retval] int* v);

This member function enables the client code to retrieve the integer value corresponding
to the OPL enumerated value interfaced by the invoking object.
HRESULT isEqualTo([in] IOPLenumValue* e,[out,retval] int* b);

This member function returns a non-zero value if the OPL enumerated value interfaced
by the invoking object is equal to the OPL enumerated value interfaced by the input
argument e.
HRESULT isGreaterOrEqualTo([in] IOPLenumValue* e,
[out,retval] int* b);

This member function returns a non-zero value if the OPL enumerated value interfaced
by the invoking object is greater or equal to the OPL enumerated value interfaced by the
input argument e.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 43

IOPLenumValue

HRESULT isGreaterThan([in] IOPLenumValue* e,[out,retval] int* b);

This member function returns a non-zero value if the OPL enumerated value interfaced
by the invoking object is greater than the OPL enumerated value interfaced by the input
argument e.
HRESULT isNotEqualTo([in] IOPLenumValue* e,[out,retval] int* b);

This member function returns a non-zero value if the OPL enumerated value interfaced
by the invoking object is not equal to the OPL enumerated value interfaced by the input
argument e.
HRESULT isSmallerOrEqualTo([in] IOPLenumValue* e,
[out,retval] int* b);

This member function returns a non-zero value if the OPL enumerated value interfaced
by the invoking object is smaller or equal to the OPL enumerated value interfaced by the
input argument e.
HRESULT isSmallerThan([in] IOPLenumValue* e,[out,retval] int* b);

This member function returns a non-zero value if the OPL enumerated value interfaced
by the invoking object is smaller than the OPL enumerated value interfaced by the input
argument e.
HRESULT setValue([in] IOPLenumValue* v);

This member function enables the client code to modify the invoking object. Upon a
successful call, the invoking object interfaces the same OPL enumerated value as the
input argument v.

44 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLenumVar

IOPLenumVar
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLenumVar provides an interface to enumerated variables defined in an


OPL model.

IDL Synopsis

interface IOPLenumVar : IOPLdata {


HRESULT getValue([out,retval] IOPLenumValue** ev);
};

Visual Basic Synopsis


Class IOPLenumVar
Function getValue() As IOPLenumValue

C++ Synopsis

IOPLenumVar : public IOPLdata


{
public:
virtual STDMETHODIMP getValue(IOPLenumValue * *ev) = 0;
};

Member Function
HRESULT getValue([out,retval] IOPLenumValue** ev);

This member function enables the client code to retrieve the value assigned to the OPL
enumerated variable interfaced by the invoking object. It assumes that the OPL
enumerated variable is bound.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 45

IOPLerrorReporter

IOPLerrorReporter
Category

COM/ActiveX interface

Inheritance Path

IUnknown

Description

The interface IOPLerrorReporter enables the client code to handle the errors that
may be raised during the interaction with the OPL engine.
In order to ensure error handling, the client code must:
1. Implement a new class derived from IOPLerrorReporter and redefine the member
functions notify*.
1. Create an instance of this new class; such an object is called an error reporter.
2. Use the member function IOPLsolver::setErrorReporter in order to assign the
error reporter to an instance of IOPLsolver.

Whenever the OPL engine raises errors concerning the syntax, the semantics or the
solving of the model loaded into the IOPLsolver instance, the execution flow is
transferred to the appropriate member function of the error reporter.
IDL Synopsis

interface IOPLerrorReporter : IUnknown {


HRESULT notifyInternalError([in] BSTR msg);
HRESULT notifyRuntimeError([in] int line,[in] BSTR msg);
HRESULT notifyRuntimeWarning([in] int line,[in] BSTR msg);
HRESULT notifySemanticError([in] int line,[in] BSTR msg);
HRESULT notifySyntaxError([in] int line,[in] BSTR msg);
};

Visual Basic Synopsis


Class IOPLerrorReporter
Sub notifyInternalError(msg As String)
Sub notifyRuntimeError(line As Long, msg As String)
Sub notifyRuntimeWarning(line As Long, msg As String)
Sub notifySemanticError(line As Long, msg As String)
Sub notifySyntaxError(line As Long, msg As String)

C++ Synopsis

class IOPLerrorReporter : public IUnknown


{
public:
virtual STDMETHODIMP notifyInternalError(BSTR msg)=0;
virtual STDMETHODIMP notifyRuntimeError(int line, BSTR msg)=0;
virtual STDMETHODIMP notifyRuntimeWarning(int line, BSTR msg)=0;
virtual STDMETHODIMP notifySemanticError(int line, BSTR msg)=0;
virtual STDMETHODIMP notifySyntaxError(int line, BSTR msg)=0;
};

46 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLerrorReporter
Member Functions
HRESULT notifyInternalError([in] BSTR msg);

The flow of control is transferred to this member function in case the OPL engine raises
an internal error.
HRESULT notifyRuntimeError([in] int line,[in] BSTR msg);

The flow of control is transferred to this member function whenever the OPL engine
detects an error during model solving.
HRESULT notifyRuntimeWarning([in] int line,[in] BSTR msg);

This virtual member function handles warning messages that are received when solving
with CPLEX. The default error reporter prints the runtime warnings without exiting the
process.
HRESULT notifySemanticError([in] int line,[in] BSTR msg);

The flow of control is transferred to this member function whenever the OPL engine
detects a semantic error.
HRESULT notifySyntaxError([in] int line,[in] BSTR msg)

The flow of control is transferred to this member function whenever the OPL engine
detects a syntax error.
See Also

IOPLsolver::setErrorReporter

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 47

IOPLfloat

IOPLfloat
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

IOPLfloat provides an interface to float data defined in an OPL model.

IDL Synopsis

interface IOPLfloat : IOPLdata {


HRESULT getClone([out,retval] IOPLfloat** ret);
HRESULT getValue([out,retval] double* v);
HRESULT setValue([in] double v);
};

Visual Basic Synopsis


Class IOPLfloat
Function getClone() As IOPLfloat
Function getValue() As Double
Sub setValue(v As Double)

C++ Synopsis

class IOPLfloat : public IOPLdata


{
public:
virtual STDMETHODIMP getClone(IOPLfloat * *ret) = 0;
virtual STDMETHODIMP getValue(double *v) = 0;
virtual STDMETHODIMP setValue(double v) = 0;
};

Member Functions
HRESULT getClone([out,retval] IOPLfloat** ret);

This member function enables the client code to construct a new interface object of the
same class as the invoking object. The new object interfaces to the same OPL data item
as the invoking object.
HRESULT getValue([out,retval] double* v);

This member function enables the client code to retrieve the value of the OPL float data
interfaced by the invoking object.
HRESULT setValue([in] double v);

This member function enables the client code to set the value of the OPL float data
interfaced by the invoking object.

48 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLfloatRange

IOPLfloatRange
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLfloatRange provides an interface to float ranges defined in an OPL


model.

IDL Synopsis

interface IOPLfloatRange : IOPLdata {


HRESULT getHigh([out,retval] double* v);
HRESULT getLow([out,retval] double* v);
};

Visual Basic Synopsis


Class IOPLfloatRange
Function getHigh() As Double
Function getLow() As Double

C++ Synopsis

class IOPLfloatRange : public IOPLdata


{
public:
virtual STDMETHODIMP getHigh(double *v) = 0;
virtual STDMETHODIMP getLow(double *v) = 0;
};

Member Functions
HRESULT getHigh([out,retval] float* v);

This member function enables the client code to retrieve the highest value of the OPL
float range interfaced by the invoking object.
HRESULT getLow([out,retval] float* v);

This member function enables the client code to retrieve the lowest value of the OPL
float range interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 49

IOPLfloatVar

IOPLfloatVar
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLfloatVar provides an interface to the float variables defined in an OPL
model.

IDL Synopsis

interface IOPLfloatVar : IOPLdata {


HRESULT getBasisStatus([out,retval] enum IOPLbasisStatus* v);
HRESULT getMax([out,retval] double* v);
HRESULT getMin([out,retval] double* v);
HRESULT getReducedCost([out,retval] double* v);
HRESULT getValue([out,retval] double* v);
};

Visual Basic Synopsis


Class IOPLfloatVar
Function getBasisStatus() As IOPLbasisStatus
Function getMax() As Double
Function getMin() As Double
Function getReducedCost() As Double
Function getValue() As Double

C++ Synopsis

public:
virtual
virtual
virtual
virtual
virtual
0;
};

STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP

getValue(double *v) = 0;
getMin(double *v) = 0;
getMax(double *v) = 0;
getReducedCost(double *v) = 0;
getBasisStatus(enum IOPLbasisStatus *v) =

Member Functions
HRESULT getBasisStatus([out,retval] enum IOPLbasisStatus* v);

This member function enables the client code to retrieve the basis status associated, in a
linear OPL model, with the float variable interfaced by the invoking object.
HRESULT getMax([out,retval] double* v);

This member function enables the client code to retrieve the maximal value of the
domain associated with the OPL float variable interfaced by the invoking object.
HRESULT getMin([out,retval] double* v);

This member function enables the client code to retrieve the minimal value of the domain
associated with the OPL float variable interfaced by the invoking object.
50 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLfloatVar

HRESULT getReducedCost([out,retval] double* v);

This member function enables the client code to retrieve the reduced cost associated, in a
linear OPL model, with the float variable interfaced by the invoking object.
HRESULT getValue([out,retval] double* v);

This member function enables the client code to retrieve the value assigned to the OPL
float variable interfaced by the invoking object. It assumes that the OPL float variable is
bound.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 51

IOPLint

IOPLint
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

IOPLint provides an interface to integer data defined in an OPL model.

IDL Synopsis

interface IOPLint : IOPLdata {


HRESULT getClone([out,retval] IOPLint** ret);
HRESULT getValue([out,retval] int* v);
HRESULT setValue([in] int v);
};

Visual Basic Synopsis


Class IOPLint
Function getClone() As IOPLint
Function getValue() As Long
Sub setValue(v As Long)

C++ Synopsis

class IOPLint : public IOPLdata


{
public:
virtual STDMETHODIMP getClone(IOPLint * *ret) = 0;
virtual STDMETHODIMP getValue(int *v) = 0;
virtual STDMETHODIMP setValue(int v) = 0;
};

Member Functions
HRESULT getClone([out,retval] IOPLint** ret);

This member function enables the client code to construct a new interface object of the
same class as the invoking object. The new object interfaces to the same OPL data item
as the invoking object.
HRESULT getValue([out,retval] int* v);

This member function enables the client code to retrieve the value of the OPL integer
data interfaced by the invoking object.
HRESULT setValue([in] int v);

This member function enables the client code to set the value of the OPL integer data
interfaced by the invoking object.

52 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLintRange

IOPLintRange
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLintRange provides an interface to integer ranges defined in an OPL


model.

IDL Synopsis

interface IOPLintRange : IOPLdata {


HRESULT getHigh([out,retval] int* v);
HRESULT getLow([out,retval] int* v);
};

Visual Basic Synopsis


Class IOPLintRange
Function getHigh() As Long
Function getLow() As Long

C++ Synopsis

class IOPLintRange : public IOPLdata


{
public:
virtual STDMETHODIMP getLow(int *v) = 0;
virtual STDMETHODIMP getHigh(int *v) = 0;
};

Member Functions
HRESULT getHigh([out,retval] int* v);

This member function enables the client code to retrieve the highest value of the OPL
integer range interfaced by the invoking object.
HRESULT getLow([out,retval] int* v);

This member function enables the client code to retrieve the lowest value of the OPL
integer range interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 53

IOPLintVar

IOPLintVar
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLintVar provides an interface to integer variables defined in an OPL


model.

IDL Synopsis

interface IOPLintVar : IOPLdata {


HRESULT getMax([out,retval] int* v);
HRESULT getMin([out,retval] int* v);
HRESULT getValue([out,retval] int* v);
};

Visual Basic Synopsis


Class IOPLintVar
Function getMax() As Long
Function getMin() As Long
Function getValue() As Long

C++ Synopsis

class IOPLintVar : public IOPLdata


{
public:
virtual STDMETHODIMP getMax(int *v) = 0;
virtual STDMETHODIMP getMin(int *v) = 0;
virtual STDMETHODIMP getValue(int *v) = 0;
};

Member Functions
HRESULT getMax([out,retval] int* v);

This member function enables the client code to retrieve the maximal value of the
domain associated with the OPL integer variable interfaced by the invoking object.
HRESULT getMin([out,retval] int* v);

This member function enables the client code to retrieve the minimal value of the domain
associated with the OPL integer variable interfaced by the invoking object.
HRESULT getValue([out,retval] int* v);

This member function enables the client code to retrieve the value assigned to the OPL
integer variable interfaced by the invoking object. It assumes that the OPL integer
variable is bound.

54 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLscriptSolver

IOPLscriptSolver
Category

COM/ActiveX interface

Inheritance Path

IDispatch

IDL Synopsis

interface IOPLscriptSolver : IDispatch {


HRESULT close();
HRESULT registerCplexLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);
HRESULT registerOplLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);
HRESULT registerSchedulerLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);
HRESULT registerSolverLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);
HRESULT run([in] BSTR filename,[out,retval] int* ret);
HRESULT setDefaultErrorReporterSilent([in] int set);
HRESULT setErrorReporter([in] IOPLerrorReporter* reporter);
HRESULT setIncludePathList([in] BSTR includePathList);
HRESULT setOplComponentLogFile([in] int set);
};

Visual Basic Synopsis


Class IOPLscriptSolver
Sub close()
Function registerCplexLicense(license As String,
signature As Long) As Long
Function registerOplLicense(license As String,
signature As Long) As Long
Function registerSchedulerLicense(license As String,
signature As Long) As Long
Function registerSolverLicense(license As String,
signature As Long) As Long
Function run(filename As String) As Long
Sub setDefaultErrorReporterSilent(set As Long)
Sub setErrorReporter(IOPLerrorReporter* reporter)
Sub setIncludePathList(includePathList As String)
Sub setOplComponentLogFile(set As Long)
};

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 55

IOPLscriptSolver
C++ Synopsis

class IOPLscriptSolver : public IDispatch


{
public:
virtual STDMETHODIMP close();
virtual STDMETHODIMP registerCplexLicense
(BSTR license, int signature, int* ret)=0;
virtual STDMETHODIMP registerOplLicense
(BSTR license, int signature, int* ret)=0;
virtual STDMETHODIMP registerSchedulerLicense
(BSTR license, int signature, int* ret)=0;
virtual STDMETHODIMP registerSolverLicense
(BSTR license, int signature, int* ret)=0;
virtual STDMETHODIMP run(BSTR filename, int* ret)=0;
virtual STDMETHODIMP setDefaultErrorReporterSilent([int set)=0;
virtual STDMETHODIMP setErrorReporter
(IOPLerrorReporter* reporter)=0;
virtual STDMETHODIMP setIncludePathList
(BSTR includePathList)=0;
virtual STDMETHODIMP setOplComponentLogFile(int set)=0;

Member Functions
HRESULT close();

Releases all the allocated memory. All you can do after calling close() is to release the
reference to the OPLscriptSolver instance itself.
HRESULT registerCplexLicense([in] BSTR license, [in] int signature,
[out,retval] int* ret);

This member function initializes a RUNTIME license for the CPLEX key.
HRESULT registerOplLicense([in] BSTR license, [in] int signature,
[out,retval] int* ret);

This member function initializes a RUNTIME license for the OPLinterpreter key.
HRESULT registerSchedulerLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);

This member function initializes a RUNTIME license for the Scheduler key.
HRESULT registerSolverLicense([in] BSTR license, [in] int signature,
[out,retval] int* ret);

This member function initializes a RUNTIME license for the Solver key.
HRESULT run([in] BSTR filename,[out,retval] int* ret);

This member function runs the file whose name is given as an argument. If the execution
is successful the value 1 is returned, otherwise 0 is returned.

56 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLscriptSolver

This member function sets globally the number of threads needed for Parallel CPLEX.
To set the other parallel oriented settings, use the setting keyword in the corresponding
OPL model.
HRESULT setDefaultErrorReporterSilent([in] int set);

This member function makes the default error reporter silent. This is useful when
building a server called from a scripting language, for which it is not possible to set your
own error reporter, because then no one can click on the OK button of the dialog box
popped up by the default error reporter. You should use this in conjunction with
setOplComponentLogFile.
HRESULT setErrorReporter([in] IOPLerrorReporter* reporter);

This member function sets reporter as the error reporter to invoke if the OPL engine
raises an error. The default error reporter pops up dialog boxes with the error details. You
can change this default behavior by setting your own error reporter.
HRESULT setIncludePathList([in] BSTR includePathList);

This member function initializes the include path list for the include macro and the
model file location declared in the OPLScript file.
HRESULT setOplComponentLogFile([in] int set);

This member function generates log information in an oplcomponent.log file.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 57

IOPLset

IOPLset
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLset provides an interface to the sets defined in an OPL model.

IDL Synopsis

interface IOPLset : IOPLdata {


HRESULT getClone([out,retval] IOPLset** ret);
HRESULT getIterator([out,retval] IOPLsetIterator** ret);
};

Visual Basic Synopsis


Class IOPLset
Function getClone() As IOPLset
Function getIterator() As IOPLsetIterator

C++ Synopsis

class IOPLset : public IOPLdata


{
public:
virtual STDMETHODIMP getClone(IOPLset * *ret) = 0;
virtual STDMETHODIMP getIterator(IOPLsetIterator * *ret) = 0;
};

Member Functions
HRESULT getClone([out,retval] IOPLset** ret);

This member function enables the client code to construct a new interface object of the
same class as the invoking object. The new object interfaces to the same OPL data item
as the invoking object.
HRESULT getIterator([out,retval] IOPLsetIterator** ret);

This member function constructs a new iterator object, instance of the class
IOPLsetIterator. Further, this iterator object will enable the client code to find out
the members of the OPL set interfaced by the invoking object.
See Also

IOPLsetIterator

58 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsetIterator

IOPLsetIterator
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLsetIterator provides a way to find out the data members of a set
defined in an OPL model. An instance of the class IOPLsetIterator (an iterator
object) can be constructed by calling the member function IOPLset::getIterator,
where the invoking object, of the class IOPLset, interfaces the OPL set to be iterated.

IDL Synopsis

interface IOPLsetIterator : IUnknown {


HRESULT getArray([out,retval] IOPLarray** ret);
HRESULT getChar([out,retval] IOPLchar** ret);
HRESULT getEnumValue([out,retval] IOPLenumValue** ret);
HRESULT getFloat([out,retval] IOPLfloat** ret);
HRESULT getInt([out,retval] IOPLint** ret);
HRESULT getSet([out,retval] IOPLset** ret);
HRESULT getString([out,retval] IOPLstring** ret);
HRESULT getStruct([out,retval] IOPLstruct** ret);
HRESULT next();
HRESULT ok([out,retval] int* doneFlag);
HRESULT reset();
};

Visual Basic Synopsis


Class IOPLsetIterator
Function getArray() As IOPLarray
Function getChar() As IOPLchar
Function getEnumValue() As IOPLenumValue
Function getFloat() As IOPLfloat
Function getInt() As IOPLint
Function getSet() As IOPLset
Function getString() As IOPLstring
Function getStruct() As IOPLstruct
Sub next()
Function ok() As Long
Sub reset()

C++ Synopsis

class IOPLsetIterator :
{
public:
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP
virtual STDMETHODIMP

public IUnknown

getArray(IOPLarray * *ret) = 0;
getChar(IOPLchar * *ret) = 0;
getEnumValue(IOPLenumValue * *ret) = 0;
getFloat(IOPLfloat * *ret) = 0;
getInt(IOPLint * *ret) = 0;
getSet(IOPLset * *ret) = 0;
getString(IOPLstring * *ret) = 0;

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 59

IOPLsetIterator

virtual
virtual
virtual
virtual

STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP

getStruct(IOPLstruct * *ret) = 0;
next(void) = 0;
ok(int *doneFlag) = 0;
reset(void) = 0;

};

Member Functions
HRESULT getArray([out,retval] IOPLarray** ret);

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of arrays. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. When successfully called from Visual Basic, this member function returns an
interface object of the class IOPLarray. When successfully called from C++, this
member function will fill the memory pointed to by the pointer argument ppEv with a
pointer to an interface object of the class IOPLarray.
HRESULT getChar([out,retval] IOPLchar** ret);

Returns the current element of the iterator and interprets it as a char (if possible,
otherwise it raises a runtime error).
HRESULT getEnumValue([out,retval] IOPLenumValue** ret);

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of enumerated values. Prior to invoking this member function, use the member
function ok in order to ensure that the invoking object does not point "past the end" of
the iterated OPL set. When successfully called from Visual Basic, this member function
returns an interface object of the class IOPLenumValue. When successfully called from
C++, this member function will fill the memory pointed to by the pointer argument ret
with a pointer to an interface object of the class IOPLenumValue.
HRESULT getFloat([out,retval] IOPLfloat** ret);

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of floats. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. When successfully called from Visual Basic, this member function returns an
interface object of the class IOPLfloat. When successfully called from C++, this
member function will fill the memory pointed to by the pointer argument ret with a
pointer to an interface object of the class IOPLfloat.
HRESULT getInt([out,retval] IOPLint** ret);

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of integers. Prior to invoking this member function, use the member function ok in
60 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsetIterator

order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. When successfully called from Visual Basic, this member function returns an
interface object of the class IOPLint. When successfully called from C++, this member
function will fill the memory pointed to by the pointer argument ret with a pointer to an
interface object of the class IOPLint.
HRESULT getSet([out,retval] IOPLset** ret);

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of sets. Prior to invoking this member function, use the member function ok in order
to ensure that the invoking object does not point "past the end" of the iterated OPL set.
When successfully called from Visual Basic, this member function returns an interface
object of the class IOPLset. When successfully called from C++, this member function
will fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLset.
HRESULT getString([out,retval] IOPLstring** ret);

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of strings. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. When successfully called from Visual Basic, this member function returns an
interface object of class IOPLstring. When successfully called from C++, this member
function will fill the memory pointed to by the pointer argument ret with a pointer to an
interface object of the class IOPLstring.
HRESULT getStruct([out,retval] IOPLstruct** ret);

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of arrays. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point past the end of the iterated OPL
set. When successfully called from Visual Basic, this member function returns an
interface object of the class IOPLstruct. When successfully called from C++, this
member function will fill the memory pointed to by the pointer argument ret with a
pointer to an interface object of the class IOPLstruct.
HRESULT next();

This member function enables the invoking object to point to the next member of the
iterated OPL set.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 61

IOPLsetIterator

HRESULT ok([out,retval] int* doneFlag);

This member function can be used in order to test whether or not the invoking object is
pointing past the end of the iterated OPL set. If the returned value is non-zero, the
member functions IOPLenumIterator::get* can be used in order to access the set
member currently pointed to by the invoking object.
HRESULT reset();

This member function re-initializes the invoking object such that it can be reused to
iterate from the beginning over the same OPL set.
See Also

IOPLset

62 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

IOPLsolver
Category

COM/ActiveX interface

Inheritance Path

IDispatch

Description

This interface enables the client code to interact with the OPL engine from a
Visual Basic, or C++ application. An IOPLsolver object is obtained by creating an
instance of the coclass COPLsolver.

IDL Synopsis

interface IOPLsolver : IDispatch {


HRESULT close();
HRESULT declareData();
HRESULT display([out,retval] BSTR* str);
HRESULT displayOnSolution([out,retval] BSTR* str);
HRESULT evalSolution();
HRESULT evalOnSolution();
HRESULT getActivity([in] BSTR name,
[out,retval] IOPLactivity** ret);
HRESULT getArray([in] BSTR name,[out,retval] IOPLarray** ret);
HRESULT getChar([in] BSTR name,[out,retval] IOPLchar** ret);
HRESULT getConstraint([in] BSTR name,
[out,retval] IOPLconstraint** ret);
HRESULT getEnum([in] BSTR name,[out,retval] IOPLenum** ret);
HRESULT getEnumValue([in] BSTR name,
[out,retval] IOPLenumValue** ret);
HRESULT getEnumVar([in] BSTR name,
[out,retval] IOPLenumVar** ret);
HRESULT getFloat([in] BSTR name,[out,retval] IOPLfloat** ret);
HRESULT getFloatRange([in] BSTR name,
[out,retval] IOPLfloatRange** ret);
HRESULT getFloatVar([in] BSTR name,
[out,retval] IOPLfloatVar** ret);
HRESULT getInt([in] BSTR name,[out,retval] IOPLint** ret);
HRESULT getIntRange([in] BSTR name,
[out,retval] IOPLintRange** ret);
HRESULT getIntVar([in] BSTR name,
[out,retval] IOPLintVar** ret);
HRESULT getLastIterationResult([out,retval] int* ret);
HRESULT getMathematicalSolutionStatus([out,retval] int* ret);
HRESULT getNumberOfChoicePoints([out,retval] int* ret);
HRESULT getNumberOfConstraints([out,retval] int* ret);
HRESULT getNumberOfFails([out,retval] int* ret);
HRESULT getNumberOfIterations([out,retval] int* ret);
HRESULT getNumberOfVariables([out,retval] int* ret);
HRESULT getObjectiveValueFloat([out,retval] double* ret);
HRESULT getObjectiveValueInt([out,retval] int* ret);
HRESULT getSet([in] BSTR name,[out,retval] IOPLset** ret);

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 63

IOPLsolver

HRESULT getStruct([in] BSTR name,


[out,retval] IOPLstruct** ret);
HRESULT getTime([out,retval] double* ret);
HRESULT isDualFeasible([out,retval] int* ret);
HRESULT isOptimal([out,retval] int* ret);
HRESULT isPrimalFeasible([out,retval] int* ret);
HRESULT loadCompiledModelBuff([in] BSTR mbuf,
[in] int editMode);
HRESULT loadCompiledModelBuffAndDataBuff([in] BSTR mbuf,
[in] BSTR dbuf,
[in] int editMode);
HRESULT loadCompiledModelBuffAndDataFile([in] BSTR mbuf,
[in] BSTR dname,
[in] int editMode);
HRESULT loadCompiledModelBuffAndDataFiles
([in] BSTR mbuf,
[in] SAFEARRAY(BSTR) *dname,
[in] int editMode);
HRESULT loadCompiledModelFile([in] BSTR mname,
[in] int editMode);
HRESULT loadCompiledModelFileAndDataBuff([in] BSTR mname,
[in] BSTR dbuf,
[in] int editMode);
HRESULT loadCompiledModelFileAndDataFile([in] BSTR mnamembuf,
[in] BSTR dname,
[in] int editMode);
HRESULT loadCompiledModelFileAndDataFiles
([in] BSTR mname,
[in] SAFEARRAY(BSTR) *dname,
[in] int editMode);
HRESULT loadInterpretedModelBuff([in] BSTR mbuf,
[in] int editMode);
HRESULT loadInterpretedModelBuffAndDataBuff
([in] BSTR mbuf,
[in] BSTR dbuf,
[in] int editMode);
HRESULT loadInterpretedModelBuffAndDataFile
([in] BSTR mbuf,
[in] BSTR dname,
[in] int editMode);
HRESULT loadInterpretedModelBuffAndDataFiles
([in] BSTR mbuf,
[in] SAFEARRAY(BSTR) *dname,
[in] int editMode);
HRESULT loadInterpretedModelFile([in] BSTR mname,
[in] int editMode);
HRESULT loadInterpretedModelFileAndDataBuff
([in] BSTR mname,
[in] BSTR dbuf,
[in] int editMode);

64 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

HRESULT loadInterpretedModelFileAndDataFile
([in] BSTR mname,
[in] BSTR dname,
[in] int editMode);
HRESULT loadInterpretedModelFileAndDataFiles
([in] BSTR mname,
[in] SAFEARRAY(BSTR) *dname,
[in] int editMode);
HRESULT nextSolution([out,retval] int* ret);
HRESULT registerCplexLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);
HRESULT registerOplLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);
HRESULT registerSchedulerLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);
HRESULT registerSolverLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);
HRESULT reset();
HRESULT restore();
HRESULT setDefaultErrorReporterSilent([in] int set);
HRESULT setErrorReporter([in] IOPLerrorReporter* reporter);
HRESULT setExportFile([in] BSTR name);
HRESULT setFailLimit([in] int f);
HRESULT setFloatParameter([in] BSTR s1,[in] double f);
HRESULT setIncludePathList([in] BSTR includePathList);
HRESULT setIntegerParameter([in] BSTR s1,[in] int i);
HRESULT setOplComponentLogFile([in] int set);
HRESULT setOptimizationStep([in] double d);
HRESULT setOrLimit([in] int i);
HRESULT setStringParameter([in] BSTR s1,[in] BSTR s2);
HRESULT setTimeLimit([in] int i);
HRESULT stateConstraint();
HRESULT solve([out,retval] int* ret);
HRESULT unsetLimit();
};

Visual Basic Synopsis


Class COPLsolver
Sub close()
Sub declareData()
Function display() As String
Function displayOnSolution() As String
Sub evalSolution()
Sub evalOnSolution()
Function getActivity(name As String) As IOPLactivity
Function getArray(name As String) As IOPLarray
Function getChar(name As String) As IOPLchar
Function getConstraint(name As String) As IOPLconstraint

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 65

IOPLsolver

Function getEnum(name As String) As IOPLenum


Function getEnumValue(name As String) As IOPLenumValue
Function getEnumVar(name As String) As IOPLenumVar
Function getFloat(name As String) As IOPLfloat
Function getFloatRange(name As String) As IOPLfloatRange
Function getFloatVar(name As String) As IOPLfloatVar
Function getInt(name As String) As IOPLint
Function getIntRange(name As String) As IOPLintRange
Function getIntVar(name As String) As IOPLintVar
Function getLastIterationResult() As Long
Function getMathematicalSolutionStatus() As Long
Function getNumberOfChoicePoints() As Long
Function getNumberOfConstraints() As Long
Function getNumberOfFails() As Long
Function getNumberOfIterations() As Long
Function getNumberOfVariables() As Long
Function getObjectiveValueFloat() As Double
Function getObjectiveValueInt() As Long
Function getSet(name As String) As IOPLset
Function getStruct(name As String) As IOPLstruct
Function getTime() As Double
Function isDualFeasible() As Long
Function isPrimalFeasible() As Long
Function isOptimal() As Long
Sub loadCompiledModelBuff(mbuf As String, editMode As Long)
Sub loadCompiledModelBuffAndDataBuff(mbuf As String,
dbuf As String, editMode As Long)
Sub loadCompiledModelBuffAndDataFile(mbuf As String,
dname As String, editMode As Long)
Sub loadCompiledModelBuffAndDataFiles(mbuf As String,
dname As String, editMode As Long)
Sub loadCompiledModelFile(mname As String, editMode As Long)
Sub loadCompiledModelFileAndDataBuff(mname As String,
dbuf As String, editMode As Long)
Sub loadCompiledModelFileAndDataFile(mnamembuf As String,
dname As String, editMode As Long)
Sub loadCompiledModelFileAndDataFiles(mname As String,
dname As String, editMode As Long)
Sub loadInterpretedModelBuff(mbuf As String, editMode As Long)
Sub loadInterpretedModelBuffAndDataBuff(mbuf As String,
dbuf As String, editMode As Long)
Sub loadInterpretedModelBuffAndDataFile(mbuf As String,
dname As String, editMode As Long)
Sub loadInterpretedModelBuffAndDataFiles(mbuf As String,
dname As String, editMode As Long)
Sub loadInterpretedModelFile(mname As String, editMode As Long)
Sub loadInterpretedModelFileAndDataBuff(mname As String,
dbuf As String, editMode As Long)
Sub loadInterpretedModelFileAndDataFile(mname As String,
dname As String, editMode As Long)

66 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

Sub loadInterpretedModelFileAndDataFiles(mname As String,


dname As String, editMode As Long)
Function nextSolution() As Long
Function registerCplexLicense(license As String,
signature As Long) As Long
Function registerOplLicense(license As String,
signature As Long) As Long
Function registerSchedulerLicense(license As String,
signature As Long) As Long
Function registerSolverLicense(license As String,
signature As Long) As Long
Sub reset()
Sub restore()
Sub setDefaultErrorReporterSilent(set As Long);
Sub setErrorReporter(reporter As IOPLerrorReporter)
Sub setExportFile(name As String)
Sub setFailLimit(f As Long)
Sub setFloatParameter(s1 As String, f As Double)
Sub setIncludePathList(includePathList As String)
Sub setIntegerParameter(s1 As String, i As Long)
Sub setOplComponentLogFile(set As Long);
Sub setOptimizationStep(d As Double)
Sub setOrLimit(i As Long)
Sub setStringParameter(s1 As String, s2 As String)
Sub setTimeLimit(i As Long)
Function solve() As Long
Sub stateConstraint()
Sub unsetLimit()

C++ Synopsis

class IOPLsolver : public IDispatch


{
public:
virtual STDMETHODIMP close(void) = 0;
virtual STDMETHODIMP declareData(void) = 0;
virtual STDMETHODIMP display(BSTR *str) = 0;
virtual STDMETHODIMP displayOnSolution(BSTR *str) = 0;
virtual STDMETHODIMP evalSolution(void) = 0;
virtual STDMETHODIMP evalOnSolution(void) = 0;
virtual STDMETHODIMP getActivity
(BSTR name, IOPLactivity * *ret) = 0;
virtual STDMETHODIMP getArray(BSTR name, IOPLarray * *ret) = 0;
virtual STDMETHODIMP getChar(BSTR name, IOPLchar * *ret) = 0;
virtual STDMETHODIMP getConstraint(BSTR name,
IOPLconstraint * *ret) = 0;
virtual STDMETHODIMP getEnum(BSTR name, IOPLenum * *ret) = 0;
virtual STDMETHODIMP getEnumValue
(BSTR name, IOPLenumValue * *ret) = 0;
virtual STDMETHODIMP getEnumVar(BSTR name,
IOPLenumVar * * ret) = 0;
virtual STDMETHODIMP getFloat(BSTR name, IOPLfloat * *ret) = 0;

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 67

IOPLsolver

virtual STDMETHODIMP getFloatRange


(BSTR name, IOPLfloatRange * *ret) = 0;
virtual STDMETHODIMP getFloatVar
(BSTR name, IOPLfloatVar * *ret) = 0;
virtual STDMETHODIMP getInt(BSTR name, IOPLint * *ret) = 0;
virtual STDMETHODIMP getIntRange
(BSTR name, IOPLintRange * *ret) = 0;
virtual STDMETHODIMP getIntVar(BSTR name,
IOPLintVar * *ret) = 0;
virtual STDMETHODIMP getLastIterationResult(int *ret) = 0;
virtual STDMETHODIMP getMathematicalSolutionStatus(int *ret) = 0;

virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual
virtual

virtual
virtual
virtual

virtual

virtual
virtual
virtual
virtual

STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP
STDMETHODIMP

getNumberOfChoicePoints(int *ret) = 0;
getNumberOfConstraints(int *ret) = 0;
getNumberOfFails(int *ret) = 0;
getNumberOfIterations(int *ret) = 0;
getNumberOfVariables(int *ret) = 0;
getObjectiveValueFloat(double *ret) = 0;
getObjectiveValueInt(int *ret) = 0;
getSet(BSTR name, IOPLset * *ret) = 0;
getStruct(BSTR name, IOPLstruct * *ret)=0;
getTime(double *ret) = 0;
isDualFeasible(int *ret) = 0;
isOptimal(int *ret) = 0;
isPrimalFeasible(int *ret) = 0;
loadCompiledModelBuff(BSTR mbuf,
int editMode) = 0;
STDMETHODIMP loadCompiledModelBuffAndDataBuff
(BSTR mbuf, BSTR dbuf, int editMode) = 0;
STDMETHODIMP loadCompiledModelBuffAndDataFile
(BSTR mbuf, BSTR dname, int editMode) = 0;
STDMETHODIMP loadCompiledModelBuffAndDataFiles
(BSTR mbuf, SAFEARRAY * * dname,
int editMode) = 0;
STDMETHODIMP loadCompiledModelFile(BSTR mname,
int editMode) = 0;
STDMETHODIMP loadCompiledModelFileAndDataBuff
(BSTR mname, BSTR dbuf, int editMode) = 0;
STDMETHODIMP loadCompiledModelFileAndDataFile
(BSTR mnamembuf, BSTR dname,
int editMode) = 0;
STDMETHODIMP loadCompiledModelFileAndDataFiles
(BSTR mname, SAFEARRAY * * dname,
int editMode) = 0;
STDMETHODIMP loadInterpretedModelBuff
(BSTR mbuf, int editMode) = 0;
STDMETHODIMP loadInterpretedModelBuffAndDataBuff
(BSTR mbuf, BSTR dbuf, int editMode) = 0;
STDMETHODIMP loadInterpretedModelBuffAndDataFile
(BSTR mbuf, BSTR dname, int editMode)= 0;
STDMETHODIMP loadInterpretedModelBuffAndDataFiles
(BSTR mbuf, SAFEARRAY * * dname,
int editMode) = 0;

68 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

virtual STDMETHODIMP loadInterpretedModelFile


(BSTR mname, int editMode) = 0;
virtual STDMETHODIMP loadInterpretedModelFileAndDataBuff
(BSTR mname, BSTR dbuf,int editMode) = 0;
virtual STDMETHODIMP loadInterpretedModelFileAndDataFile
(BSTR mname, BSTR dname, int editMode) = 0;
virtual STDMETHODIMP loadInterpretedModelFileAndDataFiles
(BSTR mname, SAFEARRAY * * dname,
int editMode) = 0;
virtual STDMETHODIMP nextSolution(int *ret) = 0;
virtual STDMETHODIMP registerCplexLicense(BSTR license,
int signature, int * * ret) = 0;
virtual STDMETHODIMP registerOplLicense(BSTR license,
int signature, int * * ret) = 0;
virtual STDMETHODIMP registerSchedulerLicense (BSTR license,
int signature, int * * ret) = 0;
virtual STDMETHODIMP registerSolverLicense(BSTR license,
int signature, int * * ret) = 0;
virtual STDMETHODIMP reset(void) = 0;
virtual STDMETHODIMP restore(void) = 0;
virtual STDMETHODIMP setDefaultErrorReporterSilent (int set)=0;
virtual STDMETHODIMP setErrorReporter
(IOPLerrorReporter *reporter) = 0;
virtual STDMETHODIMP setExportFile(BSTR name) = 0;
virtual STDMETHODIMP setFailLimit(int f) = 0;
virtual STDMETHODIMP setFloatParameter(BSTR s1, double f) = 0;
virtual STDMETHODIMP setIncludePathList
(BSTR includePathList)=0;
virtual STDMETHODIMP setIntegerParameter(BSTR s1, int i) = 0;
virtual STDMETHODIMP setOplComponentLogFile(int set) = 0;
virtual STDMETHODIMP setOptimizationStep(double d) = 0;
virtual STDMETHODIMP setOrLimit(int i) = 0;
virtual STDMETHODIMP setStringParameter(BSTR s1, BSTR s2) = 0;
virtual STDMETHODIMP setTimeLimit(int i) = 0;
virtual STDMETHODIMP solve(int *ret) = 0;
virtual STDMETHODIMP stateConstraint(void) = 0;
virtual STDMETHODIMP unsetLimit(void) = 0;
};

Member Functions
HRESULT close();

This member function indicates that the invoking object will no longer be used by the
client code. Hence the memory used by the invoking object is returned to the system.
Once this member function has been called, no other member functions may by called by
the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 69

IOPLsolver

HRESULT declareData();

This member function instructs the OPL engine to construct and initialize the data
structures of the model previously loaded in edit mode. No solving process is taking
place. After calling declareData, the client code can access/modify data items inside
the model.
HRESULT display([out,retval] BSTR* str);

This member function returns a string containing the result of the execution of the
possible display statements situated at the end of an OPL model previously loaded and
solved. However, if no display instructions exist, it returns, by default, the variable
values. This member function triggers all the output instructions located after the
solve{} block, such as display statements or writing to an output file, and also
instructions for writing to a database (DBupdate) or to a spreadsheet (SheetWrite).
HRESULT displayOnSolution([out,retval] BSTR* str);

This member function returns a string containing the result of the execution of the
possible display instructions contained in an onSolution block from the OPL model
previously loaded and solved through the nextSolution method.
HRESULT evalSolution();

This member function evaluates the instructions situated at the end of a model, outside
the solve{} block. It triggers instructions located after the solve{} block, except for
instructions such as display statements, or writing to an output file. Typically, it
triggers instructions for writing to a database (DBupdate) or to a spreadsheet
(SheetWrite).
HRESULT evalOnSolution();

This member function evaluates the instructions situated in the onSolution block.
HRESULT getActivity([in] BSTR name,[out,retval] IOPLactivity** ret);

This member function may be used in order to access an object of type Activity in the
OPL model associated with the invoking object. The string argument name indicates the
name of the activity as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLactivity. When successfully called from C++, this member function
will fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLactivity.
HRESULT getArray([in] BSTR name,[out,retval] IOPLarray** ret);

This member function may be used in order to access an array data structure in the OPL
model associated with the invoking object. The string argument name indicates the name
of the array as it appears in the OPL model. In order to call this member function, the
70 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLarray. When successfully called from C++, this member function will
fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLarray.
HRESULT getChar([in] BSTR name,[out,retval] IOPLchar** ret);

Returns the data object named name in the model currently loaded in the IOPLsolver
instance on which the method is invoked. If the object is not a char, OPL raises a
runtime error.
HRESULT getConstraint([in] BSTR name,
[out,retval] IOPLconstraint** ret);

This member function may be used in order to access a constraint in the OPL model
associated with the invoking object. The string argument name indicates the name of the
constraint as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: stateConstraint, solve, nextSolution. When successfully called from
Visual Basic, this member function returns an interface object of the class
IOPLconstraint. When successfully called from C++, this member function will fill
the memory pointed to by the pointer argument ret with a pointer to an interface object
of the class IOPLconstraint.
HRESULT getEnum([in] BSTR name,[out,retval] IOPLenum** ret);

This member function may be used in order to access an enumerated type defined in the
OPL model associated with the invoking object. The string argument name indicates the
name of the enumerated type as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLenum. When successfully called from C++, this member function will
fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLenum.
HRESULT getEnumValue([in] BSTR name,[out,retval] IOPLenumValue** ret);

This member function may be used in order to access a member of an enumerated type
(that is, an enumerated value) defined in the OPL model associated with the invoking
object. The string argument name indicates the name of the enumerated value as it
appears in the OPL model. In order to call this member function, the invoking object
should have previously called at least one of the following member functions:
declareData, stateConstraint, solve, nextSolution. When successfully called
from Visual Basic, this member function returns an interface object of the class

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 71

IOPLsolver

IOPLenumValue. When successfully called from C++, this member function will fill the
memory pointed by the pointer argument ret with a pointer to an interface object of the
class IOPLenumValue.
HRESULT getEnumVar([in] BSTR name,[out,retval] IOPLenumVar** ret);

This member function may be used in order to access an enumerated variable in the OPL
model associated with the invoking object. The string argument name indicates the name
of the enumerated variable as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLenumVar. When successfully called from C++, this member function
will fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLenumVar.
HRESULT getFloat([in] BSTR name,[out,retval] IOPLfloat** ret);

This member function may be used in order to access a float data item in the OPL model
associated with the invoking object. The string argument name indicates the name of the
float data as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLfloat. When successfully called from C++, this member function will
fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLfloat.
HRESULT getFloatRange([in] BSTR name,[out,retval] IOPLfloatRange** ret);

This member function may be used in order to access a float range defined in the OPL
model associated with the invoking object. The string argument name indicates the name
of the float range as it appears in the OPL model. In order to call this member function,
the invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLfloatRange. When successfully called from C++, this member
function will fill the memory pointed to by the pointer argument ret with a pointer to an
interface object of the class IOPLfloatRange.
HRESULT getFloatVar([in] BSTR name,[out,retval] IOPLfloatVar** ret);

This member function may be used in order to access a float variable in the OPL model
associated with the invoking object. The string argument name indicates the name of the
float variable as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
72 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

of the class IOPLfloatVar. When successfully called from C++, this member function
will fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLfloatVar.
HRESULT getInt([in] BSTR name,[out,retval] IOPLint** ret);

This member function may be used in order to access an integer data item in the OPL
model associated with the invoking object. The string argument name indicates the name
of the integer data item as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of type IOPLint. When successfully called from C++, this member function will fill the
memory pointed to by the pointer argument ret with a pointer to an interface object of
type IOPLint.
HRESULT getIntRange([in] BSTR name,[out,retval] IOPLintRange** ret);

This member function may be used in order to access an integer range defined in the
OPL model associated with the invoking object. The string argument name indicates the
name of the integer range as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution.When
successfully called from Visual Basic, this member function returns an interface object
of type IOPLintRange. When successfully called from C++, this member function will
fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of type IOPLintRange.
HRESULT getIntVar([in] BSTR name,[out,retval] IOPLintVar** ret);

This member function may be used in order to access an integer variable in the OPL
model associated with the invoking object. The string argument name indicates the name
of the integer variable as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of type IOPLintVar. When successfully called from C++, this member function will fill
the memory pointed to by the pointer argument ret with a pointer to an interface object
of type IOPLintVar.
HRESULT getLastIterationResult([out,retval] int* ret);

Returns the CPLEX solution type (the same as the CPLEX output parameter,
CPXsolninfo(), solntype). The values can be:
0 - the model has no solution
1 - the model has a simplex basis
2 - the model has a solution but no basis
I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 73

IOPLsolver

HRESULT getMathematicalSolutionStatus([out,retval] int* ret);

Returns the CPLEX solution status. This is the same as the CPLEX return code function
CPXgetstat(). The status codes can be found in the CPLEX Reference Manual,
Appendix B Solution Status Codes.
HRESULT getNumberOfChoicePoints([out,retval] int* ret);

This member function may be used to retrieve the number of choice points encountered
since the creation of the invoking object, or since the re-initialization of the invoking
object by a call to the member function reset.
HRESULT getNumberOfConstraints([out,retval] int* ret);

This member function may be used to retrieve the number of constraints that occur in the
OPL model loaded by the invoking object. Note that this is the number of constraints
computed by OPL. It may differ from the number of constraints posted on the underlying
libraries.
HRESULT getNumberOfFails([out,retval] int* ret);

This member function may be used to retrieve the number of failures encountered since
the creation of the invoking object, or since the re-initialization of the invoking object by
a call to the member function reset.
HRESULT getNumberOfIterations([out,retval] int* ret);

This member function may be used to retrieve the number of simplex iterations made so
far by the OPL engine associated with the invoking object.
HRESULT getNumberOfVariables([out,retval] int* ret);

This member function may be used to retrieve the number of constrained variables that
are used in the OPL model loaded by the invoking object.
HRESULT getObjectiveValueFloat([out,retval] double* ret);

This member function allows the client code to access the value of the objective function
in an optimization model. It assumes that the objective function takes float values. This
member function must be called after a successful call to the nextSolution or solve
methods for the invoking object.
HRESULT getObjectiveValueInt([out,retval] int* ret);

This member function allows the client code to access the value of the objective function
in an optimization model. It assumes that the objective function takes integer values. This
member function must be called after a successful call to the nextSolution or solve
methods for the invoking object.

74 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

HRESULT getSet([in] BSTR name,[out,retval] IOPLset** ret);

This member function may be used to access a data item declared as a set in the OPL
model associated with the invoking object. The string argument name indicates the name
of the set object as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLset. When successfully called from C++, this member function will fill
the memory pointed to by the pointer argument ret with a pointer to an interface object
of the class IOPLset.
HRESULT getStruct([in] BSTR name,[out,retval] IOPLstruct** ret);

This member function may be used to access a data item declared as a record in the OPL
model associated with the invoking object. The string argument name indicates the name
of the record object as it appears in the OPL model. In order to call this member function,
the invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLstruct. When successfully called from C++, this member function
will fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLstruct.
HRESULT getTime([out,retval] double* ret);

This member function may be used to retrieve the time elapsed, in seconds, since the
creation of the invoking object.
HRESULT isDualFeasible([out,retval] int* ret);

Returns 1 if the current solution is dual feasible (the same as the CPLEX output
parameter CPXsolninfo(), dfeasind). Note that a false return value does not
necessarily mean that the solution is not feasible. It simply means that the relevant
algorithm was not able to conclude it was feasible when it terminated.
HRESULT isOptimal([out,retval] int* ret);

Returns 1 if the solution is proved optimal (if CPXgetstat returns


CPX_STAT_OPTIMAL, or CPXMIP_OPTIMAL, or CPXMIP_OPTIMAL_TOL). The CPLEX
status codes can be found in the CPLEX Reference Manual, Appendix B Solution Status
Codes. Returns zero if no solution exists.
HRESULT isPrimalFeasible([out,retval] int* ret);

Returns 1 if the current solution is primal feasible (the same as the CPLEX output
parameter CPXsolninfo(), pfeasind). Note that a false return value does not
necessarily mean that the solution is not feasible. It simply means that the relevant
algorithm was not able to conclude it was feasible when it terminated.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 75

IOPLsolver

HRESULT loadCompiledModelBuff([in] BSTR mbuf, [in] int editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument editMode
indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved.
This member function can be called only once by the same invoking object. If you want
to work with several compiled models, you have to create several instances of
IOPLsolver.
HRESULT loadCompiledModelBuffAndDataBuff([in] BSTR mbuf,
[in] BSTR dbuf,
[in] int editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument dbuf is a
string containing the model data in OPL format. The argument editMode indicates
whether the model is loaded in edit mode or not. If editMode does not evaluate to zero,
the model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved.
This member function can be called only once by the same invoking object. If you want
to work with several compiled models, you have to create several instances of
IOPLsolver.
HRESULT loadCompiledModelBuffAndDataFile([in] BSTR mbuf,
[in] BSTR dname,
[in] int editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument dname is
the name of a .dat file containing the model data in OPL format. The argument
editMode indicates whether the model is loaded in edit mode or not. If editMode does
not evaluate to zero, the model is loaded in edit mode, allowing for the modification of
data items inside the model prior to being solved.
This member function can be called only once by the same invoking object. If you want
to work with several compiled models, you have to create several instances of
IOPLsolver.

76 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

HRESULT loadCompiledModelBuffAndDataFiles [in] BSTR mbuf,


[in] SAFEARRAY(BSTR) *dname,
[in] int editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument dname is
an array containing the names of all the data files to be loaded with the model. The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved.
This member function can be called only once by the same invoking object. If you want
to work with several compiled models, you have to create several instances of
IOPLsolver.
HRESULT loadCompiledModelFile([in] BSTR

mname, [in] int editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved.
This member function can be called only once by the same invoking object. If you want
to work with several compiled models, you have to create several instances of
IOPLsolver.
HRESULT loadCompiledModelFileAndDataBuff([in] BSTR mname,
[in] BSTR dbuf,
[in] int editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument dbuf is a string containing the model data in OPL format. The argument
editMode indicates whether the model is loaded in edit mode or not. If editMode does
not evaluate to zero, the model is loaded in edit mode, allowing for the modification of
data items inside the model prior to being solved.
This member function can be called only once by the same invoking object. If you want
to work with several compiled models, you have to create several instances of
IOPLsolver.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 77

IOPLsolver

HRESULT loadCompiledModelFileAndDataFile([in] BSTR mname,


[in] BSTR dname,
[in] int editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument dname is the name of a .dat file containing the model data in OPL format. The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved.
This member function can be called only once by the same invoking object. If you want
to work with several compiled models, you have to create several instances of
IOPLsolver.
HRESULT loadCompiledModelFileAndDataFiles([in] BSTR mname,
[in] SAFEARRAY(BSTR) *dname,
[in] int editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument dname is an array containing the names of all the data files to be loaded with
the model. The argument editMode indicates whether the model is loaded in edit mode
or not. If editMode does not evaluate to zero, the model is loaded in edit mode, allowing
for the modification of data items inside the model prior to being solved.
This member function can be called only once by the same invoking object. If you want
to work with several compiled models, you have to create several instances of
IOPLsolver.
HRESULT loadInterpretedModelBuff([in] BSTR mbuf, [in] int editMode);

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument editMode indicates whether the
model is loaded in edit mode or not. If editMode does not evaluate to zero, the model is
loaded in edit mode, allowing for the modification of data items inside the model prior to
being solved. This function requires the key OPLinterpreter.
This member function can be called only once by the same invoking object. If you want
to work with several models, you have to create several instances of IOPLsolver.
HRESULT loadInterpretedModelBuffAndDataBuff([in] BSTR mbuf,
[in] BSTR dbuf,
[in] int editMode);

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument dbuf is a string containing the
model data in OPL format. The argument editMode indicates whether the model is
78 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

loaded in edit mode or not. If editMode does not evaluate to zero, the model is loaded in
edit mode, allowing for the modification of data items inside the model prior to being
solved. This function requires the key OPLinterpreter.
This member function can be called only once by the same invoking object. If you want
to work with several models, you have to create several instances of IOPLsolver.
HRESULT loadInterpretedModelBuffAndDataFile([in] BSTR mbuf,
[in] BSTR dname,
[in] int editMode);

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument dname is the name of a .dat file
containing the model data in OPL format. The argument editMode indicates whether
the model is loaded in edit mode or not. If editMode does not evaluate to zero, the
model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved. This function requires the key OPLinterpreter.
This member function can be called only once by the same invoking object. If you want
to work with several models, you have to create several instances of IOPLsolver.
HRESULT loadInterpretedModelBuffAndDataFiles
([in] BSTR mbuf,
[in] SAFEARRAY(BSTR) *dname,
[in] int editMode);

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument dname is an array containing the
names of all the data files to be loaded with the model. The argument editMode
indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved. This function requires the key OPLinterpreter.
This member function can be called only once by the same invoking object. If you want
to work with several models, you have to create several instances of IOPLsolver.
HRESULT loadInterpretedModelFile([in] BSTR mname, [in] int editMode);

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument editMode
indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved. This function requires the key OPLinterpreter.
This member function can be called only once by the same invoking object. If you want
to work with several models, you have to create several instances of IOPLsolver.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 79

IOPLsolver

HRESULT loadInterpretedModelFileAndDataBuff([in] BSTR mname,


[in] BSTR dbuf,
[in] int editMode);

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument dbuf is a
string containing the model data in OPL format. The argument editMode indicates
whether the model is loaded in edit mode or not. If editMode does not evaluate to zero,
the model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved. This function requires the key OPLinterpreter.
This member function can be called only once by the same invoking object. If you want
to work with several models, you have to create several instances of IOPLsolver.
HRESULT loadInterpretedModelFileAndDataFile([in] BSTR mname,
[in] BSTR dname,
[in] int editMode);

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument dname is the
name of a .dat file containing the model data in OPL format. The argument editMode
indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved. This function requires the key OPLinterpreter.
This member function can be called only once by the same invoking object. If you want
to work with several models, you have to create several instances of IOPLsolver.
HRESULT loadInterpretedModelFileAndDataFiles
([in] BSTR mname,
[in] SAFEARRAY(BSTR) *dname,
[in] int editMode);

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument dname is an
array containing the names of all the data files to be loaded with the model. The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved. This function requires
the key OPLinterpreter.
This member function can be called only once by the same invoking object. If you want
to work with several models, you have to create several instances of IOPLsolver.
HRESULT nextSolution([out,retval] int* ret);

This member function computes successive solutions for the OPL model previously
loaded by the invoking object. For optimization problems, this member function can be
used to obtain a sequence of solutions, each of which improves the best value of the
objective function found so far. If the returned value (alternatively, the value pointed to
80 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

by the argument ret) is equal to zero, then the value of the objective function cannot be
further improved. In order to retrieve the optimal solution you can use the member
function restore. If the first call to nextSolution returns zero, the model has no
solution.
HRESULT registerCplexLicense([in] BSTR license, [in] int signature,
[out,retval] int* ret);

You can register your CPLEX RUNTIME key with this method when you deploy the
OPL Component Libraries.
HRESULT registerOplLicense([in] BSTR license, [in] int signature,
[out,retval] int* ret);

You can register your OPLinterpreter RUNTIME key with this method when you deploy
the OPL Component Libraries. This method must be called before a
loadInterpretedModelXXXXX method is called.
HRESULT registerSchedulerLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);

You can register your Scheduler RUNTIME key with this method when you deploy the
OPL Component Libraries.
HRESULT registerSolverLicense([in] BSTR license,
[in] int signature,
[out,retval] int* ret);

You can register your Solver RUNTIME key with this method when you deploy the OPL
Component Libraries.
HRESULT reset();

This member function determines the OPL engine to reset the loaded model to its initial
state. Thus, any model modifications made by the client code are lost and any references
in the client code to model items are no longer valid.
HRESULT restore();

This member function restores the last solution found by using the member function
nextSolution for the invoking object.
HRESULT setDefaultErrorReporterSilent([in] int set);

This is intended as a facility for web servers where you can't expect someone to click OK
on the error dialog box and where you can't define your own error reporter because of the
limitations of the language you use (for example, VBScript or JScript). Note that this
does not prevent ILOG License Manager (ILM) errors from opening a dialog box and
blocking your server, so be sure to put the right licences in the default ILM location
(c:\ilog\ilm\access.ilm) with NODE type keys (important for multithread safety),
or to register RUNTIME licenses with the registerXXXLicense methods.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 81

IOPLsolver

If, for any reason, the server does not work, you should call the
setOplComponentLogFile(1) method to get an oplcomponent.log file.
HRESULT setErrorReporter([in] IOPLerrorReporter* reporter);

This member function sets reporter as an error reporter instance for the invoking
object. Whenever the OPL engine raises an error concerning the syntax, the semantics or
the solving of the model loaded into the invoking object, the control is transferred to the
appropriate member function of the error reporter, reporter. See also the interface
class IOPLerrorReporter for the definition of an error reporter.
HRESULT setExportFile([in] BSTR name);

This member function may be used to write a previously loaded linear model to a file
in a chosen format. The model is written once solve or nextSolution is called. The
string name indicates the file to which the model is written. The file extension (the
characters following the last period in name) is used to infer the format of the file as
follows:
.sav binary SAV file
.mps MPS format
.lp LP format
.rmp MPS format, generic names
.rew MPS format, generic names
.rlp LP format, generic names.
HRESULT setFailLimit([in] int f);

This member function may be used in order to specify a limit on the number of failures
the OPL engine may encounter during the search for a solution. When the limit is
reached, the search stops and the current call to the member function solve or
nextSolution returns a zero value.
HRESULT setFloatParameter([in] BSTR s1,[in] double f);

This member function may be used in order to specify the value of a float parameter to
the OPL engine. The string argument s1 indicates the parameters name. The float
argument f contains the parameters value.
HRESULT setIncludePathList([in] BSTR includePathList);

This member function expects a list of paths separated by semi-colons. This list is used
to locate the files specified in a model. In a model, reference to files can be found after
the include keyword, or the symbol < indicating data initialization from a flat file.
HRESULT setIntegerParameter([in] BSTR s1,[in] int i);

This member function may be used in order to specify the value of an integer parameter
to the OPL engine. The string argument s1 indicates the parameters name. The integer
argument i contains the parameters value.

82 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver

HRESULT setOplComponentLogFile([in] int set);

Writes, in an oplcomponent.log file, information about problems encountered. With


the MIIS, this file should be located in the Windows/System32 directory.
HRESULT setOptimizationStep([in] double d);

This member function tells the OPL engine to produce solutions that are at least step d
better during the repeated solving of an optimization model. In other words, each call to
nextSolution will find a solution that improves the objective by at least step d.
HRESULT setOrLimit([in] int i);

This member function may be used in order to specify a limit on the number of choice
points the OPL engine may encounter during the search for a solution. When the limit is
reached, the search stops and the current call to the member function solve or
nextSolution returns a zero value.
HRESULT setStringParameter([in] BSTR s1,[in] BSTR s2);

This member function may be used in order to specify the value of a string parameter to
the OPL engine. The string argument s1 indicates the parameters name. The string
argument s2 contains the parameters value.
HRESULT setTimeLimit([in] int i);

This member function may be used to specify a limit, in seconds, on the CPU time the
OPL engine takes to search for a solution. When the limit is reached, the search stops and
the current call to the member function solve or nextSolution returns a zero value.
HRESULT solve([out,retval] int* ret);

This member function computes the optimal solution of the OPL model previously
loaded by the invoking object. If the returned value (alternatively, the value pointed to by
the argument ret) is equal to zero, the model has no solution. If the returned value
(alternatively, the value pointed to by the argument ret) is equal to one, OPL managed
to find a solution. When a model has an objective function, a returned value of one
means that OPL also proved optimality or a limit was reached with a feasible solution
(node limit, time limit etc.). Note that instructions for displaying or writing to an output
file are not triggered, but instructions for writing to a database (DBupdate) or to a
spreadsheet (SheetWrite) are triggered. See nextSolution, restore,
evalSolution and display for a different behavior.
HRESULT stateConstraint();

This member function instructs the OPL engine to take into account the constraints
declared in the model previously loaded in edit mode. No solving process is taking place.
This member function will also implicitly call declareData. After calling
stateConstraint, the client code can access/modify data items inside the model and
also it can inspect the named constraints of the model.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 83

IOPLsolver

HRESULT unsetLimit();

This member function unsets any limit a previous call to setFailLimit, setOrLimit,
or setTimeLimit could have set on the invoking object.

84 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLsolver
Examples

1. This example shows you how to obtain, from a Visual Basic application, successive

improved solutions for an optimization model.


Declare and Create an interface to the OPL engine
Dim solver As COPLsolver
Set solver = New COPLsolver
With solver
load a model with corresponding data
Call .loadFileAndData("bridge.mod", "bridge.dat", 0)
optimization loop
Do While .nextSolution
Debug.Print "Current Objective: ", .getObjectiveValueInt
Loop
retrieve the optimal solution
.restore
Debug.Print "Optimal Objective: ", .getObjectiveValueInt
discard the solver and release memory
.Close
End With

3. This example shows you how you can load an encrypted model (for example mulprod.opl), into a Visual Basic 6.0 application.
'Reading the encrypted model into a buffer, using FSO:
Set fs = CreateObject("Scripting.FileSystemObject")
Set txt = fs.OpenTextFile("mulprod.opl")
buff = txt.ReadAll
'Create a COPLsolver instance
Dim solver As COPLsolver
Set solver = New COPLsolver
'Loading the buffer
Call solver.loadCompiledModelBuff(buff, 1)

Alternatively, you can use the Open instruction and a file number, say 100, in order to
read the .opl file into a buffer:
Open "mulprod.opl" For Input As 100
buff = StrConv(InputB(LOF(100), 100), vbUnicode)
Close #100
'Create a COPLsolver instance
Dim solver As COPLsolver
Set solver = New COPLsolver
'Loading the buffer
Call solver.loadCompiledModelBuff(buff, 1)

See Also

COPLsolver

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 85

IOPLstring

IOPLstring
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLstring provides an interface to string data defined in an OPL model.

IDL Synopsis

interface IOPLstring : IOPLdata {


HRESULT getClone([out,retval] IOPLstring** ret);
HRESULT getValue([out,retval] BSTR* v);
HRESULT setValue([in] BSTR v);
};

Visual Basic Synopsis


Class IOPLstring
Function getClone() As IOPLstring
Function getValue() As String
Sub setValue(v As String)

C++ Synopsis

class IOPLstring : public IOPLdata


{
public:
virtual STDMETHODIMP getClone(IOPLstring * *ret) = 0;
virtual STDMETHODIMP getValue(BSTR *v) = 0;
virtual STDMETHODIMP setValue(BSTR v) = 0;
};

Member Functions
HRESULT getClone([out,retval] IOPLstring** ret);

This member function enables the client code to construct a new interface object of the
same class as the invoking object. The new object interfaces to the same OPL data item
as the invoking object.
HRESULT getValue([out,retval] BSTR* v);

This member function enables the client code to retrieve the value of the OPL string data
interfaced by the invoking object.
HRESULT setValue([in] BSTR v);

This member function enables the client code to set the value of the OPL string data
interfaced by the invoking object.

86 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLstruct

IOPLstruct
Category

COM/ActiveX interface

Inheritance Path

IOPLdata

Description

The class IOPLstruct provides an interface to data defined as records in an OPL


model.

IDL Synopsis

interface IOPLstruct : IOPLdata {


HRESULT getArray([in] BSTR name,[out,retval] IOPLarray** ret);
HRESULT getChar([in] BSTR name,[out,retval] IOPLchar** ret);
HRESULT getClone([out,retval] IOPLstruct** ret);
HRESULT getEnumValue([in] BSTR name,
[out,retval] IOPLenumValue** ret);
HRESULT getFloat([in] BSTR name,[out,retval] IOPLfloat** ret);
HRESULT getInt([in] BSTR name,[out,retval] IOPLint** ret);
HRESULT getSet([in] BSTR name,[out,retval] IOPLset** ret);
HRESULT getString([in] BSTR name,[out,retval] IOPLstring** ret);
HRESULT getStruct([in] BSTR name,[out,retval] IOPLstruct** ret);
};

Visual Basic Synopsis


Class IOPLstruct
Function getArray(name As String) As IOPLarray
Function getChar(name As String) As IOPLchar
Function getClone() As IOPLstruct
Function getEnumValue(name As String) As IOPLenumValue
Function getFloat(name As String) As IOPLfloat
Function getInt(name As String) As IOPLint
Function getSet(name As String) As IOPLset
Function getString(name As String) As IOPLstring
Function getStruct(name As String) As IOPLstruct

C++ Synopsis

class IOPLstruct : public IOPLdata


{
public:
virtual STDMETHODIMP getArray(BSTR name, IOPLarray * *ret)=0;
virtual STDMETHODIMP getChar(BSTR name, IOPLchar * *ret)=0;
virtual STDMETHODIMP getClone(IOPLstruct * *ret)=0;
virtual STDMETHODIMP getEnumValue
(BSTR name, IOPLenumValue * *ret)=0;
virtual STDMETHODIMP getFloat(BSTR name, IOPLfloat * *ret)=0;
virtual STDMETHODIMP getInt(BSTR name, IOPLint * *ret)=0;
virtual STDMETHODIMP getSet(BSTR name, IOPLset * *ret)=0;
virtual STDMETHODIMP getString(BSTR name, IOPLstring *
*ret)=0;
virtual STDMETHODIMP getStruct(BSTR name, IOPLstruct *
*ret)=0;
};

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 87

IOPLstruct
Member Functions
HRESULT getArray([in] BSTR name,[out,retval] IOPLarray** ret);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an OPL array. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLarray. When successfully called from C++, this member function will
fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLarray.
HRESULT getChar([in] BSTR name,[out,retval] IOPLchar** ret);

Returns the field named name as long as its type is char. Otherwise it raises a runtime
error.
HRESULT getClone([out,retval] IOPLstruct** ret);

This member function enables the client code to construct a new interface object of the
same class as the invoking object. The new object interfaces to the same OPL data item
as the invoking object.
HRESULT getEnumValue([in] BSTR name,
[out,retval] IOPLenumValue** ret);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an enumerated type.
When successfully called from Visual Basic, this member function returns an interface
object of the class IOPLenumValue. When successfully called from C++, this member
function will fill the memory pointed to by the pointer argument ret with a pointer to an
interface object of the class IOPLenumValue.
HRESULT getFloat([in] BSTR name,[out,retval] IOPLfloat** ret);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is of the type float.
When successfully called from Visual Basic, this member function returns an interface
object of the class IOPLfloat. When successfully called from C++, this member
function will fill the memory pointed to by the pointer argument ret with a pointer to an
interface object of the class IOPLfloat.
HRESULT getInt([in] BSTR name,[out,retval] IOPLint** ret);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is of the type integer.
When successfully called from Visual Basic, this member function returns an interface
object of the class IOPLint. When successfully called from C++, this member function
will fill the memory pointed to by the pointer argument ret with a pointer to an interface
object of the class IOPLint.

88 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

IOPLstruct

HRESULT getSet([in] BSTR name,[out,retval] IOPLset** ret);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an OPL set. When
successfully called from Visual Basic, this member function returns an interface object
of the class IOPLset. When successfully called from C++, this member function will fill
the memory pointed to by the pointer argument ret with a pointer to an interface object
of the class IOPLset.
HRESULT getString([in] BSTR name,[out,retval] IOPLstring** ret);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is of the type string.
When successfully called from Visual Basic, this member function returns an interface
object of the class IOPLstring. When successfully called from C++, this member
function will fill the memory pointed to by the pointer argument ret with a pointer to an
interface object of the class IOPLstring.
HRESULT getStruct([in] BSTR name,[out,retval] IOPLstruct** ret);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an OPL record.
When successfully called from Visual Basic, this member function returns an interface
object of the class IOPLstruct. When successfully called from C++, this member
function will fill the memory pointed to by the pointer argument ret with a pointer to an
interface object of the class IOPLstruct.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 89

IOPLstruct

90 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

Part II

The C++ API

This part of the manual documents the C++ wrapper classes that act as an interface between
a C++ application and the OPL solving engine.
Each C++ class contains:
a description of its function
its synopsis
a description of each of its member functions.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 93

OPLactivity

OPLactivity
Category

C++ class

Inheritance Path

OPLdata

Description

OPLactivity is an interface to objects of the type Activity in an OPL model.

Include File

<ilopl/component.h>

Synopsis

class OPLactivity : public OPLdata {


public:
IloInt getDuration();
IloInt getEnd();
IloInt getStart();
operator IlcIntervalActivity();
};

Member Functions
IloInt getDuration();

This member function enables the client code to access the duration field of an object
of the Activity class in an OPL model.
IloInt getEnd();

This member function enables the client code to access the end field of an object of the
Activity class in an OPL model.
IloInt getStart();

This member function enables the client code to access the start field of an object of
the Activity class in an OPL model.
Operator

operator IlcIntervalActivity();

This operator enables the client code to access the ILOG Scheduler object of the class
IlcIntervalActivity used by the OPL engine in order to implement the activity
interfaced by the invoking object.

94I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLalternativeResource

OPLalternativeResource
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLalternativeResource provides an interface to the alternative resources


defined in an OPL model.

Include File

<ilopl/component.h>

Synopsis

class OPLalternativeResource : public OPLdata {


public:
operator IlcAltResSet();
};

Operator

operator IlcAltResSet();

This operator enables the client code to access the ILOG Scheduler object of the class
IlcAltResSet, used by the OPL engine in order to implement the alternative resource
interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 95

OPLarray

OPLarray
Category

C++ class

Inheritance Path

OPLdata

Description

OPLarray provides an interface to array data structures defined in an OPL model.

Include File

<ilopl/component.h>

Synopsis

class OPLarray : public OPLdata {


public:
OPLactivity eltActivity(IloInt v);
OPLalternativeResource eltAlternativeResource(IloInt v);
OPLarray eltArray(IloInt v);
OPLchar eltChar(IloInt v);
OPLconstraint eltConstraint(IloInt v);
OPLdiscreteEnergy eltDiscreteEnergy(IloInt v);
OPLdiscreteResource eltDiscreteResource(IloInt v);
OPLenumValue eltEnumValue(IloInt v);
OPLenumVar eltEnumVar(IloInt v);
OPLfloat eltFloat(IloInt v);
OPLfloatVar eltFloatVar(IloInt v);
OPLint eltInt(IloInt v);
OPLintVar eltIntVar(IloInt v);
OPLreservoir eltReservoir(IloInt v);
OPLset eltSet(IloInt v);
OPLstateResource eltStateResource(IloInt v);
OPLstring eltString(IloInt v);
OPLstruct eltStruct(IloInt v);
OPLunaryResource eltUnaryResource(IloInt v);
OPLactivity getActivity(OPLdata& d);
OPLalternativeResource getAlternativeResource(OPLdata& d);
OPLarray getArray(OPLdata& d);
OPLchar getChar(OPLdata& d);
OPLarray getClone();
OPLconstraint getConstraint(OPLdata& d);
OPLdiscreteEnergy getDiscreteEnergy(OPLdata& d);
OPLdiscreteResource getDiscreteResource(OPLdata& d);
OPLenumValue getEnumValue(OPLdata& d);
OPLenumVar getEnumVar(OPLdata& d);
OPLfloat getFloat(OPLdata& d);
OPLfloatVar getFloatVar(OPLdata& d);
IloInt getHigh();
OPLint getInt(OPLdata& d);
OPLintVar getIntVar(OPLdata& d);
IloInt getLow();
OPLreservoir getReservoir(OPLdata& d);
OPLset getSet(OPLdata& d);

96 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLarray

IloInt getSize();
OPLstateResource getStateResource(OPLdata& d);
OPLstring getString(OPLdata& d);
OPLstruct getStruct(OPLdata& d);
OPLunaryResource getUnaryResource(OPLdata& d);
};

Member Functions
OPLactivity eltActivity(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of activities indexed by an integer range. The integer argument v is the index
of the element being accessed. This member function returns an object of the class
OPLactivity.
OPLalternativeResource eltAlternativeResource(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of alternative resources, indexed by an integer range. The integer argument v
is the index of the element being accessed. This member function returns an object of the
class OPLalternativeResource.
OPLarray eltArray(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of arrays indexed by an integer range. The integer argument v is the index of
the element being accessed. This member function returns an object of the class
OPLarray.
OPLchar eltChar(IloInt v);

Returns the vth element of the array and interprets it as a char (if possible, otherwise it
raises a runtime error).
OPLconstraint eltConstraint(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of constraints, indexed by an integer range. The integer argument v is the
index of the element being accessed. This member function returns an object of the class
OPLconstraint.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 97

OPLarray

OPLdiscreteEnergy eltDiscreteEnergy(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of discrete energy resources, indexed by an integer range. The integer
argument v is the index of the element being accessed. This member function returns an
object of the class OPLdiscreteEnergy.
OPLdiscreteResource eltDiscreteResource(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of discrete resources, indexed by an integer range. The integer argument v is
the index of the element being accessed. This member function returns an object of the
class OPLdiscreteResource.
OPLenumValue eltEnumValue(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated values, indexed by an integer range. The integer argument v is
the index of the element being accessed. This member function returns an object of the
class OPLenumValue.
OPLenumVar eltEnumVar(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated variables indexed by an integer range. The integer argument v
is the index of the element being accessed. This member function returns an object of the
class OPLenumVar.
OPLfloat eltFloat(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of floats, indexed by an integer range. The integer argument v is the index of
the element being accessed. This member function returns an object of the class
OPLfloat.
OPLfloatVar eltFloatVar(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of float variables indexed by an integer range. The integer argument v is the
index of the element being accessed. This member function returns an object of the class
OPLfloatVar.

98 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLarray

OPLint eltInt(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integers, indexed by an integer range. The integer argument v is the index
of the element being accessed. This member function returns an object of the class
OPLint.
OPLintVar eltIntVar(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integer variables indexed by an integer range. The integer argument v is the
index of the element being accessed. This member function returns an object of the class
OPLintVar.
OPLreservoir eltReservoir(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of reservoir resources, indexed by an integer range. The integer argument v
is the index of the element being accessed. This member function returns an object of the
class OPLreservoir.
OPLset eltSet(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of sets, indexed by an integer range. The integer argument v is the index of
the element being accessed. This member function returns an interface object of the class
OPLset.
OPLstateResource eltStateResource(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of state resources, indexed by an integer range. The integer argument v is the
index of the element being accessed. This member function returns an object of the class
OPLstateResource.
OPLstring eltString(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of strings, indexed by an integer range. The integer argument v is the index of
the element being accessed. This member function returns an object of the class
OPLstring.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 99

OPLarray

OPLstruct eltStruct(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of records, indexed by an integer range. The integer argument v is the index
of the element being accessed. This member function returns an object of the class
OPLstruct.
OPLunaryResource eltUnaryResource(IloInt v);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of unary resources, indexed by an integer range. The integer argument v is the
index of the element being accessed. This member function returns an object of the class
OPLunaryResource.
OPLactivity getActivity(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of activities. The input argument d is the index of the element being accessed.
The index must be an object of the class OPLdata. This member function returns an
object of the class OPLactivity.
OPLalternativeResource getAlternativeResource(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of alternative resources. The input argument d is the index of the element
being accessed. The index must be an object of the class OPLdata. This member
function returns an object of the class OPLalternativeResource.
OPLarray getArray(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of arrays. The input argument d is the index of the element being accessed.
The index must be an object of the class OPLdata. This member function returns an
interface object of the class OPLarray.
OPLchar getChar(OPLdata& d);

Returns the dth element of the array and interprets it as a char (if possible, otherwise it
raises a runtime error).
OPLarray getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces to the same OPL data item as the
invoking object.

100I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLarray

OPLconstraint getConstraint(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes the array in the OPL model being declared
as an array of constraints. The input argument d is the index of the element being
accessed. The index must be an object of class OPLdata. This member function returns
an interface object of the class OPLconstraint.
OPLdiscreteEnergy getDiscreteEnergy(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of discrete energy resources. The input argument d is the index of the element
being accessed. The index must be an object of the class OPLdata. This member
function returns an object of the class OPLdiscreteEnergy.
OPLdiscreteResource getDiscreteResource(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of discrete resources. The input argument d is the index of the element being
accessed. The index must be an object of the class OPLdata. This member function
returns an object of the class OPLdiscreteResource.
OPLenumValue getEnumValue(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated values. The input argument d is the index of the element being
accessed. The index must be an object of the class OPLdata. This member function
returns an object of the class OPLenumValue.
OPLenumVar getEnumVar(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated variables. The input argument d is the index of the element
being accessed. The index must be an object of the class OPLdata. This member
function returns an object of the class OPLenumVar.
OPLfloat getFloat(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of floats. The input argument d is the index of the element being accessed.
The index must be an object of the class OPLdata. This member function returns an
object of the class OPLfloat.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 101

OPLarray

OPLfloatVar getFloatVar(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of float variables. The input argument d is the index of the element being
accessed. The index must be an object of the class OPLdata. This member function
returns an object of the class OPLfloatVar.
IloInt getHigh();

This member function enables the client code to retrieve the highest value allowed to
index the OPL array interfaced by the invoking object. It assumes that the OPL array is
indexed by an integer range.
OPLint getInt(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integers. The input argument d is the index of the element being accessed.
The index must be an object of class OPLdata. This member function returns an object
of the class OPLint.
OPLintVar getIntVar(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integer variables. The input argument d is the index of the element being
accessed. The index must be an object of the class OPLdata.This member function
returns an object of the class OPLintVar.
IloInt getLow();

This member function enables the client code to retrieve the lowest value allowed to
index the OPL array interfaced by the invoking object. It assumes that the OPL array is
indexed by an integer range.
OPLreservoir getReservoir(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that he array in the OPL model is declared
as an array of reservoir resources. The input argument d is the index of the element being
accessed. The index must be an object of the class OPLdata. This member function
returns an object of the class OPLreservoir.
OPLset getSet(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of sets. The input argument d is the index of the element being accessed. The
index must be an object of the class OPLdata. This member function returns an object of
the class OPLset.
102I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLarray

IloInt getSize();

This member function enables the client code to retrieve the size, as a number of
elements, of the OPL array interfaced by the invoking object.
OPLstateResource getStateResource(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of state resources. The input argument d is the index of the element being
accessed. The index must be an object of the class OPLdata. This member function
returns an object of the class OPLstateResource.
OPLstring getString(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of strings. The input argument d is the index of the element being accessed.
The index must be an object of the class OPLdata.This member function returns an
object of the class OPLstring.
OPLstring getStruct(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of records. The input argument d is the index of the element being accessed.
The index must be an object of the class OPLdata. This member function returns an
object of the class OPLstruct.
OPLunaryResource getUnaryResource(OPLdata& d);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of unary resources. The input argument d is the index of the element being
accessed. The index must be an object of the class OPLdata. This member function
returns an object of the class OPLunaryResource.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 103

OPLbasisStatus

OPLbasisStatus
Category

C++ class

Description

This enumeration provides identifiers that describe the possible basis statuses for any
float variable or linear constraint occurring in a linear OPL model.
Use the member functions:
OPLfloatVar::getBasisStatus,
OPLconstraint::getBasisStatus

in order to obtain the basis status for a float variable or a linear constraint respectively.
The identifiers listed below, when associated with a variable, have the following
meanings:
OPLnoBasis: no basis information was defined for the variable
OPLatLower: the variable is at lower bound
OPLinBasis: the variable is basic
OPLatUpper: the variable is at upper bound
OPLfreeSuper: the variable is free and non-basic.

The identifiers listed below, when associated with a constraint, have the following
meanings:
OPLnoBasis: no basis information was defined for the constraint
OPLatLower: associated slack/surplus/artificial variable non-basic at value 0.0
OPLinBasis: associated slack/surplus/artificial variable basic.

Include File

<ilopl/component.h>

Synopsis

enum OPLbasisStatus
{OPLnoBasis = 0, OPLatLower, OPLinBasis, OPLatUpper,
OPLfreeSuper};

See Also

OPLfloatVar::getBasisStatus, OPLconstraint::getBasisStatus

104I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLchar

OPLchar
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLchar provides an interface to character types defined in an OPL model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLchar : public OPLdata {


public:
OPLchar(OPLcharI* impl);
~OPLchar(void);
char getValue();
void setValue(char ch);
OPLchar getClone();
};

Member Functions
char getValue();

Returns the character stored in the object.


void setValue(char ch);

Changes the character stored in the object to ch.


OPLchar getClone();

Creates a clone of the char object. Enables the client code to construct a new object of
the same class as the invoking object. The new object interfaces with the same OPL data
item as the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 105

OPLconstraint

OPLconstraint
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLconstraint provides an interface to the constraints defined in an OPL


model.

Include File

<ilopl/component.h>

Synopsis

class OPLconstraint : public OPLdata {


public:
OPLbasisStatus getBasisStatus();
double getDual();
OPLconstraint getLeft();
double getLhs();
double getRhs();
OPLconstraint getRight();
double getSlack();
};

Member Functions
OPLbasisStatus getBasisStatus();

This member function enables the client code to retrieve the basis status associated, in a
linear OPL model, with the linear constraint interfaced by the invoking object.
double getDual();

This member function enables the client code to get the dual value associated, in a linear
OPL model, with the linear constraint interfaced by the invoking object.
OPLconstraint getLeft();

This member function enables the client code to retrieve an individual constraint
component of the constraint interfaced by the invoking object. It assumes that the
invoking object interfaces a constraint of the form l <= m <= u, or a constraint built
with binary logical operators.
double getLhs();

This member function enables the client code to access the value of the left-hand side of
the linear constraint interfaced by the invoking object.
double getRhs();

This member function enables the client code to access the value of the right-hand side
of the linear constraint interfaced by the invoking object.
106I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLconstraint

OPLconstraint getRight();

This member function enables the client code to retrieve an individual constraint
component of the constraint interfaced by the invoking object. It assumes that the
invoking object interfaces a constraint of the form l <= m <= u, or a constraint built
with binary logical operators.
double getSlack();

This member function enables the client code to retrieve the value of the slack
associated, in a linear OPL model, with the linear constraint interfaced by the invoking
object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 107

OPLdata

OPLdata
Category

Abstract C++ class

Description

This class is the abstract base class for the other OPL* C++ classes which refer to the data
items of an OPL model.

Include File

<ilopl/component.h>

Synopsis

class OPLdata {
public:
virtual OPLdataI* getImpl() = 0;
};

Member Functions
virtual OPLdataI* getImpl() = 0;

This member function provides a pointer to the actual object internally used by the OPL
engine in order to implement the invoking object.

108I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLdiscreteEnergy

OPLdiscreteEnergy
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLdiscreteEnergy provides an interface to the discrete energy resources


defined in an OPL model.

Include File

<ilopl/component.h>

Synopsis

class OPLdiscreteEnergy : public OPLdata {


public:
operator IlcDiscreteEnergy();
};

Operator

operator IlcDiscreteEnergy();

This operator enables the client code to access the ILOG Scheduler object of the class
IlcDiscreteEnergy, used by the OPL engine in order to implement the discrete
energy resource interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 109

OPLdiscreteResource

OPLdiscreteResource
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLdiscreteResource provides an interface to the discrete resources


defined in an OPL model.

Include File

<ilopl/component.h>

Synopsis

class OPLdiscreteResource : public OPLdata {


public:
operator IlcDiscreteResource();
};

Operator

operator IlcDiscreteResource();

This operator enables the client code to access the ILOG Scheduler object of the class
IlcDiscreteResource, used by the OPL engine in order to implement the discrete
resource interfaced by the invoking object.

110I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLenum

OPLenum
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLenum provides an interface to enumeration types defined in an OPL model.

Include File

<ilopl/component.h>

Synopsis

class OPLenum : public OPLdata {


public:
IloInt getCard();
OPLenumValue getFirst();
OPLenumIterator getIterator();
OPLenumValue getLast();
OPLenumValue getNext(OPLenumValue ev);
OPLenumValue getNextc(OPLenumValue ev);
IloInt getOrd(OPLenumValue e);
OPLenumValue getPrev(OPLenumValue ev);
OPLenumValue getPrevc(OPLenumValue ev);
OPLenumValue getValue(const char* name);
};

Member Functions
IloInt getCard();

This member function enables the client code to obtain the cardinality (i.e. the number of
values) of the OPL enumeration interfaced by the invoking object.
OPLenumValue getFirst();

This member function enables the client code to access the first enumerated value of the
OPL enumeration interfaced by the invoking object. This member function returns an
object of the class OPLenumValue.
OPLenumIterator getIterator();

This member function constructs a new iterator object, instance of the class
OPLenumIterator. Furthermore, this iterator object will enable the client code to
obtain the enumerated values of the OPL enumeration interfaced by the invoking object.
OPLenumValue getLast();

This member function enables the client code to access the last enumerated value of the
OPL enumeration interfaced by the invoking object. This member function returns an
object of the class OPLenumValue.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 111

OPLenum

OPLenumValue getNext(OPLenumValue ev);

This member function enables the client code to access the enumerated value which
follows, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. This member function returns an object of the class
OPLenumValue.
OPLenumValue getNextc(OPLenumValue ev);

This member function enables the client code to access the enumerated value which
follows, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. The OPL enumeration is considered as circular, i.e. the last
value is followed by the first value and the first value is succeeded by the last value. This
member function returns an object of the class OPLenumValue.
IloInt getOrd(OPLenumValue e);

This member function enables the client code to retrieve the ordinal of the enumerated
value interfaced by the argument e, in the OPL enumeration interfaced by the invoking
object.
OPLenumValue getPrev(OPLenumValue ev);

This member function enables the client code to access the enumerated value which
precedes, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. This member function returns an object of the class
OPLenumValue.
OPLenumValue getPrevc(OPLenumValue ev);

This member function enables the client code to access the enumerated value which
precedes, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. The OPL enumeration is considered as circular, i.e. the last
value is followed by the first value and the first value is succeeded by the last value. This
member function returns an object of the class OPLenumValue.
OPLenumValue getValue(const char* name);

This member function enables the client code to access the enumerated value with the
name given in the OPL enumeration interfaced by the invoking object. This member
function returns an object of the class OPLenumValue.
See Also

OPLenumIterator

112I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLenumIterator

OPLenumIterator
Category

C++ class

Description

The class OPLenumIterator provides a way to find out the enumerated values of an
enumerated type defined in an OPL model. An instance of the class OPLenumIterator
(an iterator object) can be constructed by calling the member function
OPLenum::getIterator, where the invoking object, of the class OPLenum, interfaces
the OPL enumeration to be iterated. Upon successful construction, the iterator object
initially points to the first value of the iterated OPL enumeration.

Include File

<ilopl/component.h>

Synopsis

class OPLenumIterator {
OPLenumI* _s;
IloInt _nb;
IloInt _c;
IloInt _ok;
public:
OPLenumValue get();
void next();
IloInt ok();
void reset();
};

Member Functions
OPLenumValue get();

This member function can be used in order to access the enumerated value currently
pointed to by the invoking iterator. Prior to invoking this member function, use the
member function ok in order to ensure that the invoking object does not point "past the
end" of the iterated OPL enumeration. This member function returns an object of the
class OPLenumValue.
void next();

This member function enables the invoking object to point to the next enumerated value
of the iterated OPL enumeration.
IloInt ok();

This member function can be used in order to test whether the invoking object is pointing
"past the end" of the iterated OPL enumeration. If the returned value is non-zero, then the
member function OPLenumIterator::get can be used further in order to access the
enumerated value currently pointed to by the invoking object.
void reset();

This member function re-initializes the invoking object such that it can be reused to
iterate over the same OPL enumeration, starting from its first value.
See Also

OPLenum

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 113

OPLenumValue

OPLenumValue
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLenumValue provides an interface to values of enumerated types defined in


an OPL model.

Include File

<ilopl/component.h>

Synopsis

class OPLenumValue : public OPLdata {


public:
OPLenumValue getClone();
const char* getName();
IloInt getValue();
void setValue(OPLenumValue v);
IloInt
IloInt
IloInt
IloInt
IloInt
IloInt
friend

operator==(OPLenumValue v);
operator!=(OPLenumValue v);
operator>=(OPLenumValue v);
operator>(OPLenumValue v);
operator<=(OPLenumValue v);
operator<(OPLenumValue v);
ostream& operator<<(ostream& os,const OPLenumValue& v);

};

Member Functions
OPLenumValue getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces to the same OPL data item as the
invoking object.
const char* getName();

This member function enables the client code to retrieve the name of the OPL
enumerated value interfaced by the invoking object.
IloInt getValue();

This member function enables the client code to retrieve the integer value corresponding
to the OPL enumerated value interfaced by the invoking object.
void setValue(OPLenumValue v);

This member function enables the client code to modify the invoking object. Upon a
successful call, the invoking object interfaces the same OPL enumerated value as the
input argument v.
114I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLenumValue
Operators

IloInt operator==(OPLenumValue v);

This operator returns a non-zero value if the OPL enumerated value interfaced by the
invoking object is equal to the OPL enumerated value interfaced by the argument v.
IloInt operator>=(OPLenumValue v);

This operator returns a non-zero value if the OPL enumerated value interfaced by the
invoking object is greater or equal to the OPL enumerated value interfaced by the
argument v.
IloInt operator>(OPLenumValue v);

This operator returns a non-zero value if the OPL enumerated value interfaced by the
invoking object is greater than the OPL enumerated value interfaced by the argument v.
IloInt operator!=(OPLenumValue v);

This operator returns a non-zero value if the OPL enumerated value interfaced by the
invoking object is not equal to the OPL enumerated value interfaced by the argument v.
IloInt operator<=(OPLenumValue v);

This operator returns a non-zero value if the OPL enumerated value interfaced by the
invoking object is smaller or equal to the OPL enumerated value interfaced by the
argument v.
IloInt operator<(OPLenumValue v);

This operator returns a non-zero value if the OPL enumerated value interfaced by the
invoking object is smaller than the OPL enumerated value interfaced by the argument v.
friend ostream& operator<<(ostream& os,const OPLenumValue& v);

This operator enables the client code to put into an ostream the name of the OPL
enumerated value interfaced by the argument v.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 115

OPLenumVar

OPLenumVar
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLenumVar provides an interface to enumerated variables defined in an OPL


model.

Include File

<ilopl/component.h>

Synopsis

class OPLenumVar : public OPLdata {


public:
OPLenumValue getValue();
operator IlcIntVar();
};

Member Function
OPLenumValue getValue();

This member function enables the client code to retrieve the value assigned to the OPL
enumerated variable interfaced by the invoking object. It assumes that the OPL
enumerated variable is bound.
Operator

operator IlcIntVar();

This operator enables the client code to access the ILOG Solver variable of the class
IlcIntVar, used by the OPL engine to implement the enumerated variable interfaced
by the invoking object.

116I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLerrorReporter

OPLerrorReporter
Category

C++ class

Description

The class OPLerrorReporter enables the client code to handle errors that may be
raised during the interaction with the OPL engine. In order to ensure error handling, the
client code must:
1. Implement a new class derived from OPLerrorReporter and redefine the member
functions notify*.
4. Create an instance of this new class; such an object is called an error reporter.
5. Assign the error reporter to an instance of OPLsolver, using the member function
OPLsolver::setErrorReporter.

Whenever the OPL engine raises errors concerning the syntax, the semantics or the
solving of the model loaded into the OPLsolver instance, the execution flow is
transferred to the appropriate member function of the error reporter.
Include File

<ilopl/oplerror.h>

Synopsis

class OPLerrorReporter {
public:
virtual void notifyInternalError(const OPLinternalError& err);
virtual void notifyRuntimeError(const OPLruntimeError& err);
virtual void notifyRuntimeWarning(const OPLruntimeError& err)
virtual void notifySemanticError(const OPLsemanticError& err);
virtual void notifySyntaxError(const OPLsyntaxError& err);
};

Member Functions
virtual void notifyInternalError(const OPLinternalError& err);

The flow of control is transferred to this member function whenever the OPL engine
raises an internal error.
virtual void notifyRuntimeError(const OPLruntimeError& err);

The flow of control is transferred to this member function whenever the OPL engine
detects an error during model solving.
virtual void notifyRuntimeWarning(const OPLruntimeError& err)

This virtual member function handles warning messages that are received when solving
with CPLEX. The default error reporter prints the runtime warnings without exiting the
process.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 117

OPLerrorReporter

virtual void notifySemanticError(const OPLsemanticError& err);

The flow of control is transferred to this member function whenever the OPL engine
detects a semantic error.
virtual void notifySyntaxError(const OPLsyntaxError& err);

The flow of control is transferred to this member function whenever the OPL engine
detects a syntax error.
See Also

OPLsolver::setErrorReporter

118I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLfloat

OPLfloat
Category

C++ class

Inheritance Path

OPLdata

Description

OPLfloat provides an interface to float data defined in an OPL model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLfloat : public OPLdata {


public:
OPLfloat getClone();
double getValue();
void setValue(double v);
};

Member Functions
OPLfloat getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces to the same OPL data item as the
invoking object.
double getValue();

This member function enables the client code to retrieve the value of the OPL float data
interfaced by the invoking object.
void setValue(double v);

This member function enables the client code to set the value of the OPL float data
interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 119

OPLfloatRange

OPLfloatRange
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLfloatRange provides an interface to float ranges defined in an OPL


model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLfloatRange : public OPLdata {


public:
double getHigh();
double getLow();
};

Member Functions
double getHigh();

This member function enables the client code to retrieve the highest value of the OPL
float range interfaced by the invoking object.
double getLow();

This member function enables the client code to retrieve the lowest value of the OPL
float range interfaced by the invoking object.

120I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLfloatVar

OPLfloatVar
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLfloatVar provides an interface to the float variables defined in an OPL
model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLfloatVar : public OPLdata {


public:
OPLbasisStatus getBasisStatus();
double getMax();
double getMin();
double getReducedCost();
double getValue();
operator IlcFloatVar();
};

Member Functions
OPLbasisStatus getBasisStatus();

This member function enables the client code to retrieve the basis status associated, in a
linear OPL model, with the float variable interfaced by the invoking object.
double getMax();

This member function enables the client code to retrieve the maximal value of the
domain associated with the OPL float variable interfaced by the invoking object.
double getMin();

This member function enables the client code to retrieve the minimal value of the domain
associated with the OPL float variable interfaced by the invoking object.
double getReducedCost();

This member function enables the client code to retrieve the reduced cost associated, in a
linear OPL model, with the float variable interfaced by the invoking object.
double getValue();

This member function enables the client code to retrieve the value assigned to the OPL
float variable interfaced by the invoking object. It assumes that the OPL float variable is
bound.
Operator

operator IlcFloatVar();

This operator enables the client code to access the ILOG Solver variable of the class
IlcFloatVar, used by the OPL engine in order to implement the integer variable
interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 121

OPLint

OPLint
Category

C++ class

Inheritance Path

OPLdata

Description

OPLint provides an interface to integer data defined in an OPL model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLint : public OPLdata {


public:
OPLint getClone();
IloInt getValue();
void setValue(IloInt v);
};

Member Functions
OPLint getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces to the same OPL data item as the
invoking object.
IloInt getValue();

This member function enables the client code to retrieve the value of the OPL integer
data interfaced by the invoking object.
void setValue(IloInt v);

This member function enables the client code to set the value of the OPL integer data
interfaced by the invoking object.

122I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLinternalError

OPLinternalError
Category

C++ class

Description

If the OPL engine detects an internal error, it constructs an instance of the class
OPLinternalError.The error handling mechanism then passes this instance as an

input argument to the member function OPLerrorReporter::notifyInternalError.


Include File

<ilopl/oplerror.h>

Synopsis

class OPLinternalError {
public:
virtual const char* getMessage() const;
};

Member Function
const char* getMessage() const;

This member function enables the client code to obtain an explanatory message about the
raised error.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 123

OPLintRange

OPLintRange
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLintRange provides an interface to integer ranges defined in an OPL


model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLintRange : public OPLdata {


public:
IloInt getHigh();
IloInt getLow();
};

Member Functions
IloInt getHigh();

This member function enables the client code to retrieve the highest value of the OPL
integer range interfaced by the invoking object.
IloInt getLow();

This member function enables the client code to retrieve the lowest value of the OPL
integer range interfaced by the invoking object.

124I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLintVar

OPLintVar
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLintVar provides an interface to integer variables defined in an OPL


model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLintVar : public OPLdata {


public:
IloInt getMax();
IloInt getMin();
IloInt getValue();
operator IlcIntVar();
};

Member Functions
IloInt getMax();

This member function enables the client code to retrieve the maximal value of the
domain associated with the OPL integer variable interfaced by the invoking object.
IloInt getMin();

This member function enables the client code to retrieve the minimal value of the domain
associated with the OPL integer variable interfaced by the invoking object.
IloInt getValue();

This member function enables the client code to retrieve the value assigned to the OPL
integer variable interfaced by the invoking object. It assumes that the OPL integer
variable is bound.
Operator

operator IlcIntVar();

This operator enables the client code to access the ILOG Solver variable of the class
IlcIntVar, used by the OPL engine to implement the integer variable interfaced by the
invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 125

OPLreservoir

OPLreservoir
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLreservoir provides an interface to the reservoir resources defined in an


OPL model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLreservoir : public OPLdata {


public:
operator IlcReservoir();
};

Operator

operator IlcReservoir();

This operator enables the client code to access the ILOG Scheduler object of the class
IlcReservoir, used by the OPL engine in order to implement the reservoir resource
interfaced by the invoking object.

126I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLruntimeError

OPLruntimeError
Category

C++ class

Description

Whenever the OPL engine detects a runtime error, it constructs an instance of the class
OPLruntimeError.The error handling mechanism then passes this instance as an input

argument to the member function OPLerrorReporter::notifyRuntimeError.


Include File

<ilopl/oplerror.h>

Synopsis

class OPLruntimeError {
public:
IloInt getLine() const;
const char* getMessage() const;
};

Member Functions
IloInt getLine() const;

This member function enables the client code to retrieve the number of the line
containing the error in the source file from which the model was loaded.
const char* getMessage() const;

This member function enables the client code to obtain an explanatory message about the
error that was raised.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 127

OPLscriptSolver

OPLscriptSolver
Category

C++ class

Description

This class provides an interface for executing an OPLScript file from a C++ application.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLscriptSolver {
public:
OPLscriptSolver(IloInt comInit = 1);
void close();
IloInt registerCplexLicense(const char* license,
IloInt signature);
IloInt registerOplLicense(const char* license,
IloInt signature);
IloInt registerSchedulerLicense(const char* license,
IloInt signature);
IloInt registerSolverLicense(const char* license,
IloInt signature);
IloInt run(const char* filename);
void setDefaultErrorReporterSilent(IloInt set);
void setErrorReporter(OPLerrorReporter* reporter);
void setIncludePathList(const char* includePathList);
void setOplComponentLogFile(IloInt set);
};

Constructor

OPLscriptSolver(IloInt comInit = 1);

This constructor creates an instance of the class OPLscriptSolver. The client code can
use this instance to run an OPLscript file.
By default, the Microsoft global function CoInitialize is called unless you provide 0
as argument. By default the CoUninitialize global function will be called by the
destructor unless you have specified 0 as the constructor argument. You need to initialize
COM if you use the Excel Sheet connectivity in your model. Otherwise, give 0 to save
time.
Member Functions
void close();

Releases all the allocated memory. All you can do after calling close() is to delete the
OPLscriptSolver instance itself.
IloInt registerCplexLicense(const char* license, IloInt signature);

This member function initializes a RUNTIME license for the CPLEX key.

128I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLscriptSolver

IloInt registerOplLicense(const char* license,IloInt signature);

This member function initializes a RUNTIME license for the OPLinterpreter key.
IloInt registerSchedulerLicense(const char* license,IloInt signature);

This member function initializes a RUNTIME license for the Scheduler key.
IloInt registerSolverLicense(const char* license,IloInt signature);

This member function initializes a RUNTIME license for the Solver key.
IloInt run(const char* filename);

This member function runs the file whose name is given as an argument. If the execution
is successful the value 1 is returned, otherwise 0 is returned.
void setDefaultErrorReporterSilent(IloInt set);

This member function makes the default error reporter silent. This is useful when
building a server called from a scripting language, for which it is not possible to set your
own error reporter, because then no one can click on the OK button of the dialog box
popped up by the default error reporter. You should use this in conjunction with
setOplComponentLogFile.
void setErrorReporter(OPLerrorReporter* reporter);

This member function sets reporter as the error reporter to invoke if the OPL engine
raises an error. The default error reporter pops up dialog boxes with the error details. You
can change this default behavior by setting your own error reporter.
void setIncludePathList(const char* includePathList);

This member function initializes the include path list for the include macro and the
model file location declared in the OPLscript file.
void setOplComponentLogFile(IloInt set);

This member function generates log information in an oplcomponent.log file.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 129

OPLsemanticError

OPLsemanticError
Category

C++ class

Description

Whenever the OPL engine detects a semantic error, it constructs an instance of the class
OPLsemanticError.The error handling mechanism then passes this instance as an

input argument to the member function OPLerrorReporter::notifySemanticError.


Include File

<ilopl/oplerror.h>

Synopsis

class OPLsemanticError {
public:
IloInt getLine() const;
const char* getMessage() const;
};

Member Functions
IloInt getLine() const;

This member function enables the client code to retrieve the number of the line
containing the error in the source file from which the model was loaded.
const char* getMessage() const;

This member function enables the client code to obtain an explanatory message about the
error that was raised.

130I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLset

OPLset
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLset provides an interface to the sets defined in an OPL model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLset : public OPLdata {


public:
OPLset getClone();
OPLsetIterator getIterator();
};

Member Functions
OPLset getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces to the same OPL data item as the
invoking object.
OPLsetIterator getIterator();

This member function constructs a new iterator object, instance of the class
OPLsetIterator. Further, this iterator object will enable the client code to find out the
members of the OPL set interfaced by the invoking object.
See Also

OPLsetIterator

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 131

OPLsetIterator

OPLsetIterator
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLsetIterator provides a way to find out the data members of a set
defined in an OPL model. An instance of the class OPLsetIterator (an iterator object)
can be constructed by calling the member function OPLset::getIterator, where the
invoking object of the class OPLset interfaces the OPL set to be iterated.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLsetIterator {
public:
OPLarray getArray();
OPLchar getChar();
OPLenumValue getEnumValue();
OPLfloat getFloat();
OPLint getInt();
OPLset getSet();
OPLstring getString();
OPLstruct getStruct();
void next();
IloInt ok();
void reset();
};

Member Functions
OPLarray getArray();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of arrays. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLarray.
OPLchar getChar();

Returns the current element of the iterator and interprets it as a char (if possible,
otherwise it raises a runtime error).
OPLenumValue getEnumValue();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of enumerated values. Prior to invoking this member function, use the member

132I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsetIterator

function ok in order to ensure that the invoking object does not point "past the end" of
the iterated OPL set. This member function returns an object of the class
OPLenumValue.
OPLfloat getFloat();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of floats. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLfloat.
OPLint getInt();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of integers. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLint.
OPLset getSet();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of sets. Prior to invoking this member function, use the member function ok in order
to ensure that the invoking object does not point "past the end" of the iterated OPL set.
This member function returns an object of the class OPLset.
OPLstring getString();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of strings. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLstring.
OPLstruct getStruct();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of arrays. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLstruct.
void

next();

This member function enables the invoking object to point to the next member of the
iterated OPL set.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 133

OPLsetIterator

IloInt ok();

This member function can be used in order to test whether or not the invoking object is
pointing "past the end" of the iterated OPL set. If the returned value is non-zero, the
member functions OPLenumIterator::get* can be used in order to access the set
member currently pointed to by the invoking object.
void reset();

This member function re-initializes the invoking object such that it can be reused to
iterate from the beginning over the same OPL set.
See Also

OPLset

134I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

OPLsolver
Category

C++ class

Description

This class provides an interface to the OPL engine. The interface allows access to OPL
model entities from a C++ application.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLsolver {
public:
OPLsolver (IloInt initCOM = 1);
void close();
void declareData();
char* display();
char* displayOnSolution();
void evalSolution();
void evalOnSolution();
OPLactivity getActivity(const char* name);
OPLalternativeResource getAlternativeResource(const char* name);
OPLarray getArray(const char* name);
OPLchar getChar(const char* name);
OPLconstraint getConstraint(const char* name);
OPLdiscreteEnergy getDiscreteEnergy(const char* name);
OPLdiscreteResource getDiscreteResource(const char* name);
OPLenum getEnum(const char* name);
OPLenumValue getEnumValue(const char* name);
OPLenumVar getEnumVar(const char* name);
OPLfloat getFloat(const char* name);
OPLfloatRange getFloatRange(const char* name);
OPLfloatVar getFloatVar(const char* name);
IlcLinOpt getIlcLinOpt();
IlcSchedule getIlcSchedule();
OPLint getInt(const char* name);
OPLintRange getIntRange(const char* name);
OPLintVar getIntVar(const char* name);
IloInt getLastIterationResult();
IloInt getMathematicalSolutionStatus();
IloInt getNumberOfChoicePoints();
IloInt getNumberOfConstraints();
IloInt getNumberOfFails();
IloInt getNumberOfIterations();
IloInt getNumberOfVariables();
double getObjectiveValueFloat();
IloInt getObjectiveValueInt();
OPLreservoir getReservoir(const char* name);
OPLset getSet(const char* name);
OPLstateResource getStateResource(const char* name);
OPLstring getString(const char* name);
OPLstruct getStruct(const char* name);

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 135

OPLsolver

double getTime();
OPLunaryResource getUnaryResource(const char* name);
IloInt isDualFeasible();
IloInt isOptimal();
IloInt isPrimalFeasible();
void loadCompiledModelBuff(const char* buf,IloInt editMode);
void loadCompiledModelBuffAndDataBuff(const char* buf,
const char* bdata,
IloInt editMode);
void loadCompiledModelBuffAndDataFile(const char* buf,
const char* dname,
IloInt editMode)

void loadCompiledModelBuffAndDataFiles(const char* buf,


IloInt nbdf, const char** dname,
IloInt editMode);
void loadCompiledModelFile(const char* model,IloInt editMode);
void loadCompiledModelFileAndDataBuff(const char* model,
const char* bdata,
IloInt editMode);
void loadCompiledModelFileAndDataFile(const char* model,
const char* dname,
IloInt editMode);

void loadCompiledModelFileAndDataFiles(const char* model,


IloInt nbdf, const char** dname,
IloInt editMode);
void loadInterpretedModelBuff(const char* buf,
IloInt editMode);
void loadInterpretedModelBuffAndDataBuff(const char* bmodel,
const char* bdata,
IloInt editMode);
void loadInterpretedModelBuffAndDataFile(const char* bmodel,
const char* dname,
IloInt editMode);
void loadInterpretedModelBuffAndDataFiles(const char* bmodel,
IloInt nbdf, const char ** dname,
IloInt editMode);
void loadInterpretedModelFile(const char* name,
IloInt editMode);
void loadInterpretedModelFileAndDataBuff(const char* name,
const char* bdata,
IloInt editMode);
void loadInterpretedModelFileAndDataFile(const char* name,
const char* dname,
IloInt editMode);
void loadInterpretedModelFileAndDataFiles(const char* name,
IloInt nbdf, const char ** dname,
IloInt editMode);
IloInt nextSolution();
IloInt registerCplexLicense(const char* license,
IloInt signature);
IloInt registerOplLicense(const char* license,
IloInt signature);

136I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

IloInt registerSchedulerLicense(const char* license,


IloInt signature);
IloInt registerSolverLicense(const char* license,
IloInt signature);
void reset();
void restore();
void setErrorReporter(OPLerrorReporter* rep);
void setExportFile(const char* name);
void setFailLimit(IloInt f);
void setFloatParameter(const char* s1,double f);
void setIncludePathList(const char* includePathList);
void setIntegerParameter(const char* s1,IloInt i);
void setObjFloatValueMax(double v);
void setObjFloatValueMin(double v);
void setObjValueMax(IloInt v);
void setObjValueMin(IloInt v);
void setOplComponentLogFile(IloInt set);
void setOptimizationStep(double d);
void setOrLimit(IloInt i);
void setStringParameter(const char* s1, const char* s2);
void setTimeLimit(IloInt i);
IloInt solve();
void stateConstraint();
void unsetLimit();
operator IlcManager();
};

Constructor

OPLsolver (IloInt initCOM = 1);

This constructor creates an instance of the class OPLsolver. The client code can use this
instance to interact with the OPL engine.
The OPLsolver object, by default (initCOM = 1), initializes COM on Windows with
its constructor, so that you can access Excel connectivity. It uninitializes COM
automatically with its close() method. By passing 0 as argument to this constructor
you inform OPLsolver that you are going to manage the COM initialization/
unitialization yourself.
Member Functions
void close();

This member function signals that the invoking object will be no longer used by the
client code. Hence the memory used by the invoking object is returned to the system.
Once this member function has been called, no other member functions may by called by
the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 137

OPLsolver

void declareData();

This member function instructs the OPL engine to construct and initialize the data
structures of the model previously loaded in edit mode. No solving process is taking
place. After calling declareData, the client code can access/modify data items inside
the model.
const char* display();

This member function returns a string containing the result of the execution of the
possible display statements situated at the end of an OPL model previously loaded and
solved. It triggers all the output instructions located after the solve{} block, such as
display statements or writing to an output file, and also instructions for writing to a
database (DBupdate) or to a spreadsheet (SheetWrite).
const char* displayOnSolution();

This member function returns a string containing the result of the execution of the
possible displayOnSolution statements from the OPL model previously loaded and
solved.
void evalSolution();

This member function evaluates the instructions situated at the end of a model, outside
the solve{} block. It triggers instructions located after the solve{} block, except for
instructions such as display statements, or writing to an output file. Typically, it
triggers instructions for writing to a database (DBupdate) or to a spreadsheet
(SheetWrite).
void evalOnSolution();

This member function evaluates the instructions situated in the onSolution block.
OPLactivity getActivity(const char* name);

This member function may be used in order to access an object of type Activity in the
OPL model associated with the invoking object. The string argument name indicates the
name of the activity as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLactivity.
OPLalternativeResource getAlternativeResource(const char* name);

This member function may be used to access an alternative resource defined in the OPL
model associated with the invoking object. The string argument name indicates the name
of the alternative resource as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLalternativeResource.

138I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

OPLarray getArray(const char* name);

This member function may be used in order to access an array data structure in the OPL
model associated with the invoking object. The string argument name indicates the name
of the array as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLarray.
OPLchar getChar(const char* name);

Returns the data object named name in the model currently loaded in the OPLsolver
instance on which the method is invoked. If the object is not a char, OPL raises a
runtime error.
OPLconstraint getConstraint(const char* name);

This member function may be used in order to access a constraint in the OPL model
associated with the invoking object. The string argument name indicates the name of the
constraint as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: stateConstraint, solve, nextSolution. This member function returns
an object of the class OPLconstraint.
OPLdiscreteEnergy getDiscreteEnergy(const char* name);

This member function may be used to access a discrete energy resource defined in the
OPL model associated with the invoking object. The string argument name indicates the
name of the discrete energy resource as it appears in the OPL model. In order to call this
member function, the invoking object should have previously called at least one of the
following member functions: declareData, stateConstraint, solve,
nextSolution. This member function returns an object of the class
OPLdiscreteEnergy.
OPLdiscreteResource getDiscreteResource(const char* name);

This member function may be used to access a discrete resource defined in the OPL
model associated with the invoking object. The string argument name indicates the name
of the discrete resource as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLdiscreteResource.
OPLenum getEnum(const char* name);

This member function may be used in order to access an enumerated type defined in the
OPL model associated with the invoking object. The string argument name indicates the
name of the enumerated type as it appears in the OPL model. In order to call this member

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 139

OPLsolver

function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLenum.
OPLenumValue getEnumValue(const char* name);

This member function may be used in order to access a member of an enumerated type
(that is, an enumerated value) defined in the OPL model associated with the invoking
object. The string argument name indicates the name of the enumerated value as it
appears in the OPL model. In order to call this member function, the invoking object
should have previously called at least one of the following member functions:
declareData, stateConstraint, solve, nextSolution. This member function
returns an object of the class OPLenumValue.
OPLenumVar getEnumVar(const char* name);

This member function may be used in order to access an enumerated variable in the OPL
model associated with the invoking object. The string argument name indicates the name
of the enumerated variable as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLenumVar.
OPLfloat getFloat(const char* name);

This member function may be used in order to access a float data item in the OPL model
associated with the invoking object. The string argument name indicates the name of the
float data as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLfloat.
OPLfloatRange getFloatRange(const char* name);

This member function may be used in order to access a float range defined in the OPL
model associated with the invoking object. The string argument name indicates the name
of the float range as it appears in the OPL model. In order to call this member function,
the invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLfloatRange.
OPLfloatVar getFloatVar(const char* name);

This member function may be used in order to access a float variable in the OPL model
associated with the invoking object. The string argument name indicates the name of the
float variable as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an interface object of the class OPLfloatVar.
140I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

IlcLinOpt getIlcLinOpt();

This member function may be used to retrieve the ILOG Planner object of the class
IlcLinOpt used by the OPL engine in order to implement the LP or the MIP part of the
model currently associated with the invoking object.
IlcSchedule getIlcSchedule();

This member function may be used to retrieve the ILOG Scheduler object of the class
IlcSchedule used by the OPL engine in order to implement the scheduling part of the
model currently associated with the invoking object.
OPLint getInt(const char* name);

This member function may be used in order to access an integer data item in the OPL
model associated with the invoking object. The string argument name indicates the name
of the integer data item as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLint.
OPLintRange getIntRange(const char* name);

This member function may be used in order to access an integer range defined in the
OPL model associated with the invoking object. The string argument name indicates the
name of the integer range as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution.This
member function returns an object of the class OPLintRange.
OPLintVar getIntVar(const char* name);

This member function may be used in order to access an integer variable in the OPL
model associated with the invoking object. The string argument name indicates the name
of the integer variable as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLintVar.
IloInt getLastIterationResult();

Returns the CPLEX solution type (the same as the CPLEX output parameter,
CPXsolninfo(), solntype). The values can be:
0 - the model has no solution
1 - the model has a simplex basis
2 - the model has a solution but no basis

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 141

OPLsolver

IloInt getMathematicalSolutionStatus();

Returns the CPLEX solution status. This is the same as the CPLEX return code function
CPXgetstat(). The status codes can be found in the CPLEX Reference Manual,
Appendix B Solution Status Codes.
IloInt getNumberOfChoicePoints();

This member function may be used to retrieve the number of choice points encountered
since the creation of the invoking object, or since the re-initialization of the invoking
object by a call to the member function reset.
IloInt getNumberOfConstraints();

This member function may be used to retrieve the number of constraints that occur in the
OPL model loaded by the invoking object. Note that this is the number of constraints
computed by OPL. It may differ from the number of constraints posted on the underlying
libraries.
IloInt getNumberOfFails();

This member function may be used to retrieve the number of failures encountered since
the creation of the invoking object, or since the re-initialization of the invoking object by
a call to the member function reset.
IloInt getNumberOfIterations();

This member function may be used to retrieve the number of simplex iterations made so
far by the OPL engine associated with the invoking object.
IloInt getNumberOfVariables();

This member function may be used to retrieve the number of constrained variables that
are used in the OPL model loaded by the invoking object.
double getObjectiveValueFloat();

This member function allows the client code to access the value of the objective function
in an optimization model. It assumes that the objective function takes float values. This
member function must be called after a successful call to the nextSolution or solve
methods for the invoking object.
IloInt getObjectiveValueInt();

This member function allows the client code to access the value of the objective function
in an optimization model. It assumes that the objective function takes integer values. This
member function must be called after a successful call to the nextSolution or solve
methods for the invoking object.

142I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

OPLreservoir getReservoir(const char* name);

This member function may be used to access a reservoir resource defined in the OPL
model associated with the invoking object. The string argument name indicates the name
of the reservoir resource as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLreservoir.
OPLset getSet(const char* name);

This member function may be used to access a data item declared as a set in the OPL
model associated with the invoking object. The string argument name indicates the name
of the set object as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLset.
OPLstateResource getStateResource(const char* name);

This member function may be used to access a state resource defined in the OPL model
associated with the invoking object. The string argument name indicates the name of the
state resource as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLstateResource.
OPLstring getString(const char* name);

This member function may be used in order to access a string data item in the OPL
model associated with the invoking object. The string argument name indicates the name
of the string data item as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLstring.
OPLstruct getStruct(const char* name);

This member function may be used to access a data item declared as a record in the OPL
model associated with the invoking object. The string argument name indicates the name
of the record object as it appears in the OPL model. In order to call this member function,
the invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLstruct.
double getTime();

This member function may be used to retrieve the time elapsed, in seconds, since the
creation of the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 143

OPLsolver

OPLunaryResource getUnaryResource(const char* name);

This member function may be used to access a unary resource defined in the OPL model
associated with the invoking object. The string argument 'name' indicates the name of the
unary resource as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLunaryResource.
IloInt isDualFeasible();

Returns 1 if the current solution is dual feasible (the same as the CPLEX output
parameter CPXsolninfo(), dfeasind). Note that a false return value does not
necessarily mean that the solution is not feasible. It simply means that the relevant
algorithm was not able to conclude it was feasible when it terminated.
IloInt isOptimal();

Returns 1 if the solution is proved optimal (if CPXgetstat returns


CPX_STAT_OPTIMAL, or CPXMIP_OPTIMAL, or CPXMIP_OPTIMAL_TOL). The CPLEX
status codes can be found in the CPLEX Reference Manual, Appendix B Solution Status
Codes. Returns zero if no solution exists.
IloInt isPrimalFeasible();

Returns 1 if the current solution is primal feasible (the same as the CPLEX output
parameter CPXsolninfo(), pfeasind). Note that a false return value does not
necessarily mean that the solution is not feasible. It simply means that the relevant
algorithm was not able to conclude it was feasible when it terminated.
void loadCompiledModelBuff(const char* buf, IloInt editMode);

This member function loads a compiled OPL model into the invoking object. The
argument buf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument editMode
indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved.
void loadCompiledModelBuffAndDataBuff(const char* mbuf,
const char* dbuf,
IloInt editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument dbuf is a
string containing the model data in OPL format. The argument editMode indicates

144I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

whether the model is loaded in edit mode or not. If editMode does not evaluate to zero,
the model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved.
void loadCompiledModelBuffAndDataFile(const char* mbuf,
const char* dname,
IloInt editMode)

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument dname is
the name of a .dat file containing the model data in OPL format. The argument
editMode indicates whether the model is loaded in edit mode or not. If editMode does
not evaluate to zero, the model is loaded in edit mode, allowing for the modification of
data items inside the model prior to being solved.
void loadCompiledModelBuffAndDataFiles(const char* mbuf, IloInt nbdf,
const char** dname,
IloInt editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument dname is
an array of length nbdf containing the names of all the data files to be loaded with the
model. The argument editMode indicates whether the model is loaded in edit mode or
not. If editMode does not evaluate to zero, the model is loaded in edit mode, allowing
for the modification of data items inside the model prior to being solved.
void loadCompiledModelFile(const char* mname, IloInt editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved.
void loadCompiledModelFileAndDataBuff(const char* mname,
const char* dbuf,
IloInt editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument dbuf is a string containing the model data in OPL format. The argument

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 145

OPLsolver

editMode indicates whether the model is loaded in edit mode or not. If editMode does

not evaluate to zero, the model is loaded in edit mode, allowing for the modification of
data items inside the model prior to being solved.
void loadCompiledModelFileAndDataFile(const char* mname,
const char* dname,
IloInt editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument dname is the name of a .dat file containing the model data in OPL format. The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved.
void loadCompiledModelFileAndDataFiles(const char* mname, IloInt nbdf,
const char** dname,
IloInt editMode);

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument dname is an array of length nbdf containing the names of all the data files to
be loaded with the model. The argument editMode indicates whether the model is
loaded in edit mode or not. If editMode does not evaluate to zero, the model is loaded in
edit mode, allowing for the modification of data items inside the model prior to being
solved.
void loadInterpretedModelBuff(const char* buf, IloInt editMode);

This member function loads an OPL model into the invoking object. The argument buf
is a string containing the OPL model. The argument editMode indicates whether the
model is loaded in edit mode or not. If editMode does not evaluate to zero, the model is
loaded in edit mode, allowing for the modification of data items inside the model prior to
being solved. This function requires the key OPLinterpreter.
void loadInterpretedModelBuffAndDataBuff(const char* bmodel,
const char* bdata,
IloInt editMode);

This member function loads an OPL model into the invoking object. The argument
bmodel is a string containing the OPL model. The argument bdata is a string
containing the model data in OPL format. The argument editMode indicates whether
the model is loaded in edit mode or not. If editMode does not evaluate to zero, the
model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved. This function requires the key OPLinterpreter.

146I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

void loadInterpretedModelBuffAndDataFile(const char* mbuf,


const char* dname,
IloInt editMode);

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument dname is the name of a .dat file
containing the model data in OPL format. The argument editMode indicates whether
the model is loaded in edit mode or not. If editMode does not evaluate to zero, the
model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved. This function requires the key OPLinterpreter.
void loadInterpretedModelBuffAndDataFiles(const char* mbuf,
IloInt nbdf,
const char ** dname,
IloInt editMode);

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument dname is an array of length nbdf
containing the names of all the data files to be loaded with the model. The argument
editMode indicates whether the model is loaded in edit mode or not. If editMode does
not evaluate to zero, the model is loaded in edit mode, allowing for the modification of
data items inside the model prior to being solved. This function requires the key
OPLinterpreter.
void loadInterpretedModelFile(const char* name, IloInt editMode);

This member function loads an OPL model into the invoking object. The argument name
is the name of a .mod file containing the OPL model. The argument editMode indicates
whether the model is loaded in edit mode or not. If editMode does not evaluate to zero,
the model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved. This function requires the key OPLinterpreter.
void loadInterpretedModelFileAndDataBuff(const char* mname,
const char* bdata,
IloInt editMode);

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument bdata is a
string containing the model data in OPL format. The argument editMode indicates
whether the model is loaded in edit mode or not. If editMode does not evaluate to zero,
the model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved. This function requires the key OPLinterpreter.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 147

OPLsolver

void loadInterpretedModelFileAndDataFile(const char* mname,


const char* dname,
IloInt editMode);

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument dname is the
name of a .dat file containing the model data in OPL format. The argument editMode
indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved. This function requires the key OPLinterpreter.
void loadInterpretedModelFileAndDataFiles(const char* mname,
IloInt nbdf,
const char ** dname,
IloInt editMode);

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument dname is an
array of length nbdf containing the names of all the data files to be loaded with the
model. The argument editMode indicates whether the model is loaded in edit mode or
not. If editMode does not evaluate to zero, the model is loaded in edit mode, allowing
for the modification of data items inside the model prior to being solved. This function
requires the key OPLinterpreter.
IloInt nextSolution();

This member function computes successive solutions for the OPL model previously
loaded by the invoking object. For optimization problems, this member function can be
used to obtain a sequence of solutions, each of which improves the best value of the
objective function found so far. If the returned value is equal to zero, then the value of the
objective function cannot be further improved. In order to retrieve the optimal solution
you can use the member function restore. If the first call to nextSolution returns
zero, the model has no solution.
IloInt registerCplexLicense(const char* license, IloInt signature);

You can register your CPLEX RUNTIME key with this method when you deploy the
OPL Component Libraries.
IloInt registerOplLicense(const char* license, IloInt signature);

You can register your OPLinterpreter RUNTIME key with this method when you deploy
the OPL Component Libraries. This method must be called before a
loadInterpretedModelXXXXX method is called.
IloInt registerSchedulerLicense(const char* license,
IloInt signature);

You can register your Scheduler RUNTIME key with this method when you deploy the
OPL Component Libraries.
148I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

IloInt registerSolverLicense(const char* license, IloInt signature);

You can register your Solver RUNTIME key with this method when you deploy the OPL
Component Libraries.
void reset();

This member function determines the OPL engine to reset the loaded model to its initial
state. Thus, any model modifications made by the client code are lost and any references
in the client code to model items are no longer valid.
void restore();

This member function restores the last solution found by using the member function
nextSolution for the invoking object.
void setErrorReporter(OPLerrorReporter* rep);

This member function sets reporter as an error reporter instance for the invoking
object. Whenever the OPL engine raises an error concerning the syntax, the semantics or
the solving of the model loaded into the invoking object, the control is transferred to the
appropriate member function of the error reporter, reporter. See also the class
OPLerrorReporter for the definition of an error reporter.
void setExportFile(const char* name);

This member function may be used to write a previously loaded linear model to a file in
a chosen format. The model is written once solve or nextSolution is called. The
string name indicates the file to which the model is written. The file extension (the
characters following the last period in name) is used to infer the format of the file as
follows:
.sav binary SAV file
.mps MPS format
.lp LP format
.rmp MPS format, generic names
.rew MPS format, generic names
.rlp LP format, generic names
void setFailLimit(IloInt f);

This member function may be used in order to specify a limit on the number of failures
the OPL engine may encounter during the search for a solution. When the limit is
reached, the search stops and the current call to the member function solve or
nextSolution returns a zero value.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 149

OPLsolver

void setFloatParameter(const char* s1, double f);

This member function may be used in order to specify the value of a float parameter to
the OPL engine. The string argument s1 indicates the parameters name. The float
argument f contains the parameters value.
void setIncludePathList(const char* includePathList);

This member function expects a list of paths separated by semi-colons. This list is used
to locate the files specified in a model. In a model, reference to files can be found after
the include keyword, or the symbol < indicating data initialization from a flat file.
void setIntegerParameter(const char* s1, IloInt i);

This member function may be used in order to specify the value of an integer parameter
to the OPL engine. The string argument s1 indicates the parameters name. The integer
argument i contains the parameters value.
void setObjFloatValueMax(double v);

This member function constrains the OPL engine to search only for solutions with an
objective value less than or equal to the float value v. It assumes that the invoking object
is referring to an optimization model with a float objective function.
void setObjFloatValueMin(double v);

This member function constrains the OPL engine to search only for solutions with an
objective value greater than or equal to the float value v. It assumes that the invoking
object is referring to an optimization model with a float objective function.
void setObjValueMax(IloInt v);

This member function constrains the OPL engine to search only for solutions with an
objective value less than or equal to the integer value v. It assumes that the invoking
object is referring to an optimization model with an integer objective function.
void setObjValueMin(IloInt v);

This member function constrains the OPL engine to search only for solutions with the
objective value greater than or equal to the integer value v. It assumes that the invoking
object is referring to an optimization model with an integer objective function.
void setOplComponentLogFile(IloInt set);

Writes, in an oplcomponent.log file, information about problems encountered. With


the MIIS, this file should be located in the Windows/System32 directory.
void setOptimizationStep(double d);

This member function tells the OPL engine to produce solutions that are at least step d
better during the repeated solving of an optimization model. In other words, each call to
nextSolution will find a solution that improves the objective by at least step d.

150I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

void setOrLimit(IloInt i);

This member function may be used in order to specify a limit on the number of choice
points the OPL engine may encounter during the search for a solution. When the limit is
reached, the search stops and the current call to the member function solve or
nextSolution returns a zero value.
void setStringParameter(const char* s1, const char* s2);

This member function may be used in order to specify the value of a string parameter to
the OPL engine. The string argument s1 indicates the parameters name. The string
argument s2 contains the parameters value.
void setTimeLimit(IloInt i);

This member function may be used to specify a limit, in seconds, on the CPU time the
OPL engine takes to search for a solution. When the limit is reached, the search stops and
the current call to the member function solve or nextSolution returns a zero value.
IloInt solve();

This member function computes the optimal solution of the OPL model previously
loaded by the invoking object. If the returned value is equal to zero, the model has no
solution. If the returned value is equal to one, OPL managed to find a solution. When a
model has an objective function, a returned value of one means that OPL also proved
optimality or a limit was reached with a feasible solution (node limit, time limit etc.).
Note that instructions for displaying or writing to an output file are not triggered, but
instructions for writing to a database (DBupdate) or to a spreadsheet (SheetWrite) are
triggered. See nextSolution, restore, evalSolution and display for a different
behavior.
void stateConstraint();

This member function instructs the OPL engine to take into account the constraints
declared in the model previously loaded in edit mode. No solving process is taking place.
This member function will also implicitly call declareData. After calling
stateConstraint, the client code can access/modify data items inside the model and
also it can inspect the named constraints of the model.
void unsetLimit();

This member function unsets any limit a previous call to setFailLimit, setOrLimit,
or setTimeLimit could have set on the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 151

OPLsolver
Operator

operator IlcManager();

This operator enables the client code to access the ILOG Solver object of the class
IlcManager, used by the OPL engine in order to implement the invoking object. This
manager contains all the Solver counterpart of the variables, the constraints and the
search goals used by the OPL engine to solve the model currently associated with the
invoking object.

152I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLstateResource

OPLstateResource
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLstateResource provides an interface to the state resources defined in an


OPL model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLstateResource : public OPLdata {


public:
operator IlcStateResource();
};

Operator

operator IlcStateResource();

This operator enables the client code to access the ILOG Scheduler object of the class
IlcStateResource, used by the OPL engine in order to implement the state resource
interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 153

OPLstring

OPLstring
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLstring provides an interface to string data defined in an OPL model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLstring : public OPLdata {


public:
OPLstring getClone();
char* getValue();
void setValue(char* ch);
};

Member Functions
OPLstring getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces with the same OPL data item as the
invoking object.
char* getValue();

This member function enables the client code to retrieve the value of the OPL string data
interfaced by the invoking object.
void setValue(char* ch);

This member function enables the client code to set the value of the OPL string data
interfaced by the invoking object.

154I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLstruct

OPLstruct
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLstruct provides an interface to data defined as records in an OPL model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLstruct : public OPLdata {


public:
OPLarray getArray(const char* name);
OPLchar getChar(const char* name);
OPLstruct getClone();
OPLenumValue getEnumValue(const char* name);
OPLfloat getFloat(const char* name);
OPLint getInt(const char* name);
OPLset getSet(const char* name);
OPLstring getString(const char* name);
OPLstruct getStruct(const char* name);
};

Member Functions
OPLarray getArray(const char* name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an OPL array. This
member function returns an object of the class OPLarray.
OPLchar getChar(const char* name);

Returns the field named name as long as its type is char. Otherwise it raises a runtime
error.
OPLstruct getClone();

This member function enables the client code to construct a new interface object of the
same class as the invoking object. The new object interfaces with the same OPL data
item as the invoking object.
OPLenumValue getEnumValue(const char* name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an enumerated type.
This member function returns an object of the class OPLenumValue.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 155

OPLstruct

OPLfloat getFloat(const char* name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is of the type float. This
member function returns an interface object of the class OPLfloat.
OPLint getInt(const char* name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is of the type integer.
This member function returns an object of the class OPLint.
OPLset getSet(const char* name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an OPL set. This
member function returns an object of the class OPLset.
OPLstring getString(const char* name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is of the type string.
This member function returns an object of the class OPLstring.
OPLstruct getStruct(const char* name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an OPL record. This
member function returns an object of the class OPLstruct.

156I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsyntaxError

OPLsyntaxError
Category

C++ class

Description

Whenever the OPL engine detects a syntax error, it constructs an instance of the class
OPLsyntaxError.The error handling mechanism then passes this instance as an input

argument to the member function OPLerrorReporter::notifySyntaxError.


Include File

<ilopl/oplerror.h>

Synopsis

class OPLsyntaxError {
public:
IloInt getLine() const;
const char* getMessage() const;
};

Member Functions
IloInt getLine() const;

This member function enables the client code to retrieve the number of the line
containing the error in the source file from which the model was loaded.
const char* getMessage() const;

This member function enables the client code to obtain an explanatory message about the
raised error.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 157

OPLunaryResource

OPLunaryResource
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLunaryResource provides an interface to the unary resources defined in an


OPL model.

Include File

<ilopl/oplcomponent.h>

Synopsis

class OPLunaryResource : public OPLdata {


public:
operator IlcUnaryResource();
};

Operator

operator IlcUnaryResource();

This operator enables the client code to access the ILOG Scheduler object of the class
IlcUnaryResource, used by the OPL engine in order to implement the unary resource
interfaced by the invoking object.

158I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

Part III

The Java API

This part of the manual documents the Java classes that act as wrappers around the OPL
solving engine and OPL declared entities.
Each Java class contains:
a description of its function
its synopsis
a description of each of its member functions.

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

OPLactivity

OPLactivity
Category

Java class

Inheritance Path

OPLdata

Description

OPLactivity is an interface to objects of the type Activity in an OPL model.

Package

ilog.opl.engine;

Synopsis

public class OPLactivity extends OPLdata


{
public final int getDuration();
public final int getEnd();
public final int getStart();
}

Member Functions
public final int getDuration();

This member function enables the client code to access the duration field of an object
of the Activity class in an OPL model.
public final int getEnd();

This member function enables the client code to access the end field of an object of the
Activity class in an OPL model.
public final int getStart();

This member function enables the client code to access the start field of an object of
the Activity class in an OPL model.

162I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLactivity

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 163

OPLadaptable

OPLadaptable
Category

Java interface

Description

OPLadaptable is an interface to be implemented by classes providing a translation as


an OPL data string.

Package

ilog.opl.engine;

Synopsis

public interface OPLadaptable


{
public void formatToOPL(StringBuffer buffer);
}

Member Functions
public void formatToOPL();

This member function appends the value of an instance to the buffer in OPL data syntax.
An object instance can be translated into an enumerated value, a string using double
quotes, an int, a float, or a struct. The syntax of struct is either
< field1, ..., fieldN > or
#< fieldName1:field1, ..., fieldNameN:fieldN >#

You are recommended to add a space after the < and before the > for embedded
structs.

164I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLadaptable

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 165

OPLadaptor

OPLadaptor
Category
Description

Java class
OPLadaptor groups the formatting methods to translate Java data structures into OPL

data.
Package

ilog.opl.engine;

Synopsis

public class OPLadaptor


{
public static final void format(StringBuffer buffer,
String name,
Object object,
boolean doubleQuotes);
public static final void formatAsArray(StringBuffer buffer,
String name,
Collection values,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);
public static final void formatAsArray(StringBuffer buffer,
String name,
Object[] values,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);
public static final void formatAsArray
(StringBuffer buffer,
String name,
Map values,
Method[] valueFieldAccessors,
boolean valuesWithNamedFields,
boolean doubleQuotesForValue,
Method keyAccessor,
boolean doubleQuotesForKey);
public static final void formatAsArray(StringBuffer buffer,
String name,
String[] values,
boolean useDoubleQuotes);
public static final void formatAsArray(StringBuffer buffer,
String name,
int[] values);
public static final void formatAsArray(StringBuffer buffer,
String name,
double[] values);
public static final void formatAsEnum(StringBuffer buffer,
String name,
String[] values);

166I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLadaptor

public static final void formatAsEnum(StringBuffer buffer,


String name,
Object[] objects,
Method accessor);
public static final void formatAsEnum(StringBuffer buffer,
String name,
Collection collection,
Method accessor);
public static final void formatAsEnumValue(StringBuffer buffer,
String name,
String value);
public static final void formatAsFloat(StringBuffer buffer,
String name,
double value);
public static final void formatAsInt(StringBuffer buffer,
String name,
int value);
public static final void formatAsInt(StringBuffer buffer,
String name,
boolean value);
public static final void formatAsSet(StringBuffer buffer,
String name,
Object[] values,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);
public static final void formatAsSet(StringBuffer buffer,
String name,
Collection values,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);
public static final void formatAsSet(StringBuffer buffer,
String name,
String[] values,
boolean useDoubleQuotes);
public static final void formatAsSet(StringBuffer buffer,
String name,
int[] values);
public static final void formatAsSet(StringBuffer buffer,
String name,
double[] values);
public static final void formatAsString(StringBuffer buffer,
String name,
String value);
public static final void formatAsStruct(StringBuffer buffer,
String name,
Object obj,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 167

OPLadaptor

public static final void formatAsStruct(StringBuffer buffer,


String name,
Object arrayOfFields[],
boolean doubleQuotes);
}

Member Functions
public static final void format(StringBuffer buffer,
String name,
Object object,
boolean doubleQuotes);

This member function formats the java.lang.Object as an OPL data set.


Java native arrays and Maps are translated into OPL arrays.
Java multidimensional arrays are translated into OPL multidimensional arrays.
Java Collections are translated into OPL sets.
The value of a java.lang.String can be placed between double quotes following the
OPL string syntax, or it can follow the syntax of OPL enumerated values.
A java.lang.Object viewed as an OPL struct must implement the OPLadaptable
interface.
The result is appended to the buffer.
public static final void formatAsArray(StringBuffer buffer,
String name,
Collection values,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);

This member function formats a collection of objects passed as argument as an OPL data
array of structs and appends it to the buffer.
The array does not use named initialization. The order of values is the order from the
Collection:
[ < value1 > , ..., < valueN > ]

The values of the struct fields are retrieved by invoking the corresponding accessor on
the java Object. Although there is no requirement on the Java side to implement the
OPLadaptable interface, the drawback is that this method uses reflection. Use
format() and implement the OPLadaptable interface as an alternative.

168I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLadaptor

public static final void formatAsArray(StringBuffer buffer,


String name,
Object[] values,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);

This member function formats the array of objects passed as argument as an OPL data
array of structs and appends it to the buffer.
The array does not use named initialization. The order of values is the order from the
array:
[ < value1 > , ..., < valueN > ]

The values of the struct fields are retrieved by invoking the corresponding accessor on
the java Object. Although there is no requirement on the Java side to implement the
OPLadaptable interface, the drawback is that this method uses reflection. Use
format() and implement the OPLadaptable interface as an alternative.
public static final void formatAsArray(StringBuffer buffer,
String name,
Map values,
Method[] valueFieldAccessors,
boolean valuesWithNamedFields,
boolean doubleQuotesForValue,
Method keyAccessor,
boolean doubleQuotesForKey);

This member function formats the Map passed as argument as an OPL data array and
appends it to the buffer.
The array uses named initialization based on (key, value) pairs of the map:
#[ key1:value1, ..., keyN:valueN ]#

The values of the struct fields are retrieved by invoking the corresponding accessor on
the java Object. Although there is no requirement on the Java side to implement the
OPLadaptable interface, the drawback is that this method uses reflection. Use
format() and implement the OPLadaptable interface as an alternative.
public static final void formatAsArray(StringBuffer buffer,
String name,
String[] values,
boolean useDoubleQuotes);

This member function formats the String passed as argument as an OPL data array of
enumerated values or an array of strings and appends it to the buffer, depending on the
value of useDoubleQuotes.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 169

OPLadaptor

public static final void formatAsArray(StringBuffer buffer,


String name,
int[] values);

This member function formats the int[] passed as argument as an OPL data array of
int and appends it to the buffer.
public static final void formatAsArray(StringBuffer buffer,
String name,
double[] values);

This member function formats the double[] passed as argument as an OPL data array
of float and appends it to the buffer.
public static final void formatAsEnum(StringBuffer buffer,
String name,
String[] values);

This member function formats the String passed as argument as an OPL enum and
appends it to the buffer.
public static final void formatAsEnum(StringBuffer buffer,
String name,
Object[] objects,
Method accessor);

This member function formats the Object[] passed as argument as an OPL enum and
appends it to the buffer.
public static final void formatAsEnum(StringBuffer buffer,
String name,
Collection collection,
Method accessor);

This member function formats the Collection passed as argument as an OPL enum
and appends it to the buffer.
public static final void formatAsEnumValue(StringBuffer buffer,
String name,
String value);

This member function formats the Java String value as an OPL enumerated value and
appends it to the buffer.
public static final void formatAsInt(StringBuffer buffer,
String name,
int value);

This member function formats the Java int value as an OPL int value and appends it
to the buffer.

170I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLadaptor

public static final void formatAsInt(StringBuffer buffer,


String name,
boolean value);

This member function formats the Java boolean value as an OPL int 0/1 value and
appends it to the buffer.
public static final void formatAsFloat(StringBuffer buffer,
String name,
double value);

This member function formats the Java double value as an OPL float value and
appends it to the buffer.
public static final void formatAsSet(StringBuffer buffer,
String name,
Object[] values,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);

This member function formats the Java Object passed as argument as an OPL data set
of structs and appends it to the buffer.
The order of values in the OPL ordered set is the order from the Java array:
{ value1 , ..., valueN }.
If only one value field accessor is given, the objects are not considered to be structs. If
more than one value field accessor is given, the objects are translated into structs.
The values of the struct fields are retrieved by invoking the corresponding accessor on
the java Object. Although there is no requirement on the Java side to implement the
OPLadaptable interface, the drawback is that this method uses reflection. Use
format() and implement the OPLadaptable interface as an alternative.
public static final void formatAsSet(StringBuffer buffer,
String name,
Collection values,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);

This member function formats the Collection of Objects passed as argument as an


OPL data set of structs and appends it to the buffer. The set does not use named
initializations. The order of values is the order from the Collection:
{ < value1 >, ..., < valueN > }

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 171

OPLadaptor

The values of the struct fields are retrieved by invoking the corresponding accessor on
the java Object. Although there is no requirement on the Java side to implement the
OPLadaptable interface, the drawback is that this method uses reflection. Use
format() and implement the OPLadaptable interface as an alternative.
public static final void formatAsSet(StringBuffer buffer,
String name,
String[] values,
boolean useDoubleQuotes);

This member function formats the String passed as argument as an OPL


setof(enum) or setof(string), depending on the value of the useDoubleQuotes
argument, and appends it to the buffer.
public static final void formatAsSet(StringBuffer buffer,
String name,
int[] values);

This member function formats the int[] passed as argument as an OPL data
setof(int) and appends it to the buffer.
public static final void formatAsSet(StringBuffer buffer,
String name,
double[] values);

This member function formats the double[] passed as argument as an OPL data
setof(float) and appends it to the buffer.
public static final void formatAsString(StringBuffer buffer,
String name,
String value);

This member function formats the Java String value as an OPL string value and
appends it to the buffer. Essentially, this method adds double quotes to the string.
public static final void formatAsStruct(StringBuffer buffer,
String name,
Object obj,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);

This member function formats the Object passed as argument as an OPL struct and
appends it to the buffer. If the number of field accessors is less than 2, the < and > are
omitted.

172I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLadaptor

public static final void formatAsStruct(StringBuffer buffer,


String name,
Object arrayOfFields[],
boolean doubleQuotes);

This member function formats the Java array of fields passed as argument as an OPL
struct and appends it to the buffer. If the number of field accessors is less than 2, the <
and > are omitted.
See Also

ilog.opl.engine.OPLadaptable

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 173

OPLarray

OPLarray
Category

Java class

Inheritance Path

OPLdata

Description

OPLarray provides an interface to array data structures defined in an OPL model.

Package

ilog.opl.engine;

Synopsis

public class OPLarray extends OPLdata


{
public final OPLactivity eltActivity(int i);
public final OPLarray eltArray(int i);
public final OPLchar eltChar(int i);
public final OPLconstraint eltConstraint(int i);
public final OPLenumValue eltEnumValue(int i);
public final OPLenumVar eltEnumVar(int i);
public final OPLfloat eltFloat(int i);
public final OPLfloatVar eltFloatVar(int i);
public final OPLint eltInt(int i);
public final OPLintVar eltIntVar(int i);
public final OPLset eltSet(int i);
public final OPLstring eltString(int i);
public final OPLstruct eltStruct(int i);
public final OPLactivity getActivity(OPLdata i);
public final OPLarray getArray(OPLdata i);
public final OPLchar getChar(OPLdata i);
public final OPLarray getClone();
public final OPLconstraint getConstraint(OPLdata i);
public final OPLenumValue getEnumValue(OPLdata i);
public final OPLenumVar getEnumVar(OPLdata i);
public final OPLfloat getFloat(OPLdata i);
public final OPLfloatVar getFloatVar(OPLdata i);
public final int getHigh();
public final OPLint getInt(OPLdata i);
public final OPLintVar getIntVar(OPLdata i);
public final int getLow();
public final OPLset getSet(OPLdata i);
public final int getSize();
public final OPLstring getString(OPLdata i);
public final OPLstruct getStruct(OPLdata i);
}

174I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLarray
Member Functions
public final OPLactivity eltActivity(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of activities indexed by an integer range. The integer argument i is the index
of the element being accessed. This member function returns an object of the class
OPLactivity.
public final OPLarray eltArray(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of arrays indexed by an integer range. The integer argument i is the index of
the element being accessed. This member function returns an object of the class
OPLarray.
public final OPLchar eltChar(int i);

Returns the ith element of the array and interprets it as a char (if possible, otherwise it
raises a runtime error).
public final OPLconstraint eltConstraint(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of constraints, indexed by an integer range. The integer argument i is the
index of the element being accessed. This member function returns an object of the class
OPLconstraint.
public final OPLenumValue eltEnumValue(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated values, indexed by an integer range. The integer argument i is
the index of the element being accessed. This member function returns an object of the
class OPLenumValue.
public final OPLenumVar eltEnumVar(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated variables indexed by an integer range. The integer argument i
is the index of the element being accessed. This member function returns an object of the
class OPLenumVar.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 175

OPLarray

public final OPLfloat eltFloat(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of floats, indexed by an integer range. The integer argument i is the index of
the element being accessed. This member function returns an object of the class
OPLfloat.
public final OPLfloatVar eltFloatVar(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of float variables indexed by an integer range. The integer argument i is the
index of the element being accessed. This member function returns an object of the class
OPLfloatVar.
public final OPLint eltInt(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integers, indexed by an integer range. The integer argument i is the index
of the element being accessed. This member function returns an object of the class
OPLint.
public final OPLintVar eltIntVar(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integer variables indexed by an integer range. The integer argument i is the
index of the element being accessed. This member function returns an object of the class
OPLintVar.
public final OPLset eltSet(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of sets, indexed by an integer range. The integer argument i is the index of
the element being accessed. This member function returns an interface object of the class
OPLset.
public final OPLstring eltString(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of strings, indexed by an integer range. The integer argument i is the index of
the element being accessed. This member function returns an object of the class
OPLstring.

176I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLarray

public final OPLstruct eltStruct(int i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of records, indexed by an integer range. The integer argument i is the index
of the element being accessed. This member function returns an object of the class
OPLstruct.
public final OPLactivity getActivity(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of activities. The input argument i is the index of the element being accessed.
The index must be an object of the class OPLdata. This member function returns an
object of the class OPLactivity.
public final OPLarray getArray(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of arrays. The input argument i is the index of the element being accessed.
The index must be an object of the class OPLdata. This member function returns an
interface object of the class OPLarray.
public final OPLchar getChar(OPLdata i);

Returns the ith element of the array and interprets it as a char (if possible, otherwise it
raises a runtime error).
public final OPLarray getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces to the same OPL data item as the
invoking object.
public final OPLconstraint getConstraint(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes the array in the OPL model being declared
as an array of constraints. The input argument i is the index of the element being
accessed. The index must be an object of class OPLdata. This member function returns
an interface object of the class OPLconstraint.
public final OPLenumValue getEnumValue(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated values. The input argument i is the index of the element being
accessed. The index must be an object of the class OPLdata. This member function
returns an object of the class OPLenumValue.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 177

OPLarray

public final OPLenumVar getEnumVar(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of enumerated variables. The input argument i is the index of the element
being accessed. The index must be an object of the class OPLdata. This member
function returns an object of the class OPLenumVar.
public final OPLfloat getFloat(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of floats. The input argument i is the index of the element being accessed.
The index must be an object of the class OPLdata. This member function returns an
object of the class OPLfloat.
public final OPLfloatVar getFloatVar(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of float variables. The input argument i is the index of the element being
accessed. The index must be an object of the class OPLdata. This member function
returns an object of the class OPLfloatVar.
public final int getHigh();

This member function enables the client code to retrieve the highest value allowed to
index the OPL array interfaced by the invoking object. It assumes that the OPL array is
indexed by an integer range.
public final OPLint getInt(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integers. The input argument i is the index of the element being accessed.
The index must be an object of class OPLdata. This member function returns an object
of the class OPLint.
public final OPLintVar getIntVar(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of integer variables. The input argument i is the index of the element being
accessed. The index must be an object of the class OPLdata.This member function
returns an object of the class OPLintVar.
public final int getLow();

This member function enables the client code to retrieve the lowest value allowed to
index the OPL array interfaced by the invoking object. It assumes that the OPL array is
indexed by an integer range.
178I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLarray

public final OPLset getSet(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of sets. The input argument i is the index of the element being accessed. The
index must be an object of the class OPLdata. This member function returns an object of
the class OPLset.
public final int getSize();

This member function enables the client code to retrieve the size, as a number of
elements, of the OPL array interfaced by the invoking object.
public final OPLstring getString(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of strings. The input argument i is the index of the element being accessed.
The index must be an object of the class OPLdata.This member function returns an
object of the class OPLstring.
public final OPLstruct getStruct(OPLdata i);

This member function enables the client code to access an element in the OPL array
interfaced by the invoking object. It assumes that the array in the OPL model is declared
as an array of records. The input argument i is the index of the element being accessed.
The index must be an object of the class OPLdata. This member function returns an
object of the class OPLstruct.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 179

OPLbasisStatus

OPLbasisStatus
Category

Java class

Description

This enumeration provides identifiers that describe the possible basis statuses for any
float variable or linear constraint occurring in a linear OPL model.
Use the member functions:
OPLfloatVar.getBasisStatus,
OPLconstraint.getBasisStatus

in order to obtain the basis status for a float variable or a linear constraint respectively.
The identifiers listed below, when associated with a variable, have the following
meanings:
OPLnoBasis no basis information was defined for the variable
OPLatLower the variable is at lower bound
OPLinBasis the variable is basic
OPLatUpper the variable is at upper bound
OPLfreeSuper the variable is free and non-basic.

The identifiers listed below, when associated with a constraint, have the following
meanings:
OPLnoBasis: no basis information was defined for the constraint
OPLatLower: associated slack/surplus/artificial variable non-basic at value 0.0
OPLinBasis: associated slack/surplus/artificial variable basic.

Package

ilog.opl.engine;

Synopsis

public interface OPLbasisStatus


{
public static final int OPLnoBasis =
public static final int OPLatLower =
public static final int OPLinBasis =
public static final int OPLatUpper =
public static final int OPLfreeSuper
}

See Also

0;
1;
2;
3;
= 4;

OPLfloatVar.getBasisStatus, OPLconstraint.getBasisStatus

180I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLchar

OPLchar
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLchar provides an interface to character types defined in an OPL model.

Package

ilog.opl.engine;

Synopsis

public class OPLchar extends OPLdata


{
public final short getValue();
public final void setValue(short v);
public final OPLchar getClone();
}

Member Functions
public final short getValue();

Returns the character stored in the object.


public final void setValue(short v);

Changes the character stored in the object to v.


public final OPLchar getClone();

Creates a clone of the char object. Enables the client code to construct a new object of
the same class as the invoking object. The new object interfaces with the same OPL data
item as the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 181

OPLconstraint

OPLconstraint
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLconstraint provides an interface to the constraints defined in an OPL


model.

Package

ilog.opl.engine;

Synopsis

public class OPLconstraint extends OPLdata


{
public final int getBasisStatus();
public final double getDual();
public final OPLconstraint getLeft();
public final double getLhs();
public final double getRhs();
public final OPLconstraint getRight();
public final double getSlack();
}

Member Functions
public final int getBasisStatus();

This member function enables the client code to retrieve the basis status associated, in a
linear OPL model, with the linear constraint interfaced by the invoking object.
public final double getDual();

This member function enables the client code to get the dual value associated, in a linear
OPL model, with the linear constraint interfaced by the invoking object.
public final OPLconstraint getLeft();

This member function enables the client code to retrieve an individual constraint
component of the constraint interfaced by the invoking object. It assumes that the
invoking object interfaces a constraint of the form l <= m <= u, or a constraint built
with binary logical operators.
public final double getLhs();

This member function enables the client code to access the value of the left-hand side of
the linear constraint interfaced by the invoking object.
public final double getRhs();

This member function enables the client code to access the value of the right-hand side
of the linear constraint interfaced by the invoking object.
182I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLconstraint

public final OPLconstraint getRight();

This member function enables the client code to retrieve an individual constraint
component of the constraint interfaced by the invoking object. It assumes that the
invoking object interfaces a constraint of the form l <= m <= u, or a constraint built
with binary logical operators.
public final double getSlack();

This member function enables the client code to retrieve the value of the slack
associated, in a linear OPL model, with the linear constraint interfaced by the invoking
object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 183

OPLdata

OPLdata
Category

Java base class

Description

This class is the base class for the other OPL* Java classes which refer to the data items
of an OPL model.

Package

ilog.opl.engine;

184I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLenum

OPLenum
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLenum provides an interface to enumeration types defined in an OPL model.

Package

ilog.opl.engine;

Synopsis

public class OPLenum extends OPLdata


{
public final int getCard();
public final OPLenumValue getFirst();
public final OPLenumIterator getIterator();
public final OPLenumValue getLast();
public final OPLenumValue getNext(OPLenumValue ev);
public final OPLenumValue getNextc(OPLenumValue ev);
public final int getOrd(OPLenumValue pEv);
public final OPLenumValue getPrev(OPLenumValue ev);
public final OPLenumValue getPrevc(OPLenumValue ev);
public final OPLenumValue getValue(String valName);
}

Member Functions
public final int getCard();

This member function enables the client code to obtain the cardinality (i.e. the number of
values) of the OPL enumeration interfaced by the invoking object.
public final OPLenumValue getFirst();

This member function enables the client code to access the first enumerated value of the
OPL enumeration interfaced by the invoking object. This member function returns an
object of the class OPLenumValue.
public final OPLenumIterator getIterator();

This member function constructs a new iterator object, instance of the class
OPLenumIterator. Furthermore, this iterator object will enable the client code to
obtain the enumerated values of the OPL enumeration interfaced by the invoking object.
public final OPLenumValue getLast();

This member function enables the client code to access the last enumerated value of the
OPL enumeration interfaced by the invoking object. This member function returns an
object of the class OPLenumValue.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 185

OPLenum

public final OPLenumValue getNext(OPLenumValue ev);

This member function enables the client code to access the enumerated value which
follows, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. This member function returns an object of the class
OPLenumValue.
public final OPLenumValue getNextc(OPLenumValue ev);

This member function enables the client code to access the enumerated value which
follows, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. The OPL enumeration is considered as circular, i.e. the last
value is followed by the first value and the first value is succeeded by the last value. This
member function returns an object of the class OPLenumValue.
public final int getOrd(OPLenumValue ev);

This member function enables the client code to retrieve the ordinal of the enumerated
value interfaced by the argument ev, in the OPL enumeration interfaced by the invoking
object.
public final OPLenumValue getPrev(OPLenumValue ev);

This member function enables the client code to access the enumerated value which
precedes, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. This member function returns an object of the class
OPLenumValue.
public final OPLenumValue getPrevc(OPLenumValue ev);

This member function enables the client code to access the enumerated value which
precedes, in the OPL enumeration interfaced by the invoking object, the value interfaced
by the input argument ev. The OPL enumeration is considered as circular, i.e. the last
value is followed by the first value and the first value is succeeded by the last value. This
member function returns an object of the class OPLenumValue.
public final OPLenumValue getValue(String valName);

This member function enables the client code to access the enumerated value with the
name given in the OPL enumeration interfaced by the invoking object. This member
function returns an object of the class OPLenumValue.
See Also

OPLenumIterator

186I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLenumIterator

OPLenumIterator
Category

Java class

Description

The class OPLenumIterator provides a way to find out the enumerated values of an
enumerated type defined in an OPL model. An instance of the class OPLenumIterator
(an iterator object) can be constructed by calling the member function
OPLenum.getIterator, where the invoking object, of the class OPLenum, interfaces the
OPL enumeration to be iterated. Upon successful construction, the iterator object
initially points to the first value of the iterated OPL enumeration.

Package

ilog.opl.engine;

Synopsis

public class OPLenumIterator


{
int impl;
public
public
public
public
public

int getImpl();
final OPLenumValue get();
final void next();
final int ok();
final void reset();

Member Function
public final OPLenumValue get() {return new
OPLenumValue(get(getImpl()));}

This member function can be used in order to access the enumerated value currently
pointed to by the invoking iterator. Prior to invoking this member function, use the
member function ok in order to ensure that the invoking object does not point "past the
end" of the iterated OPL enumeration. This member function returns an object of the
class OPLenumValue.
public final void next() {next(getImpl());}

This member function enables the invoking object to point to the next enumerated value
of the iterated OPL enumeration.
public final int ok() {return ok(getImpl());}

This member function can be used in order to test whether the invoking object is pointing
"past the end" of the iterated OPL enumeration. If the returned value is non-zero, then the
member function OPLenumIterator.get can be used further in order to access the
enumerated value currently pointed to by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 187

OPLenumIterator

public final void reset() {reset(getImpl());}

This member function re-initializes the invoking object such that it can be reused to
iterate over the same OPL enumeration, starting from its first value.
See Also

OPLenum

188I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLenumValue

OPLenumValue
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLenumValue provides an interface to values of enumerated types defined in


an OPL model.

Package

ilog.opl.engine;

Synopsis

public final class OPLenumValue extends OPLdata


{
public final OPLenumValue getClone();
public final String getName();
public final int getValue();
public final void setValue(OPLenumValue v);
public final int isEqualTo(OPLenumValue e);
public final int isGreaterOrEqualTo(OPLenumValue e);
public final int isGreaterThan(OPLenumValue e);
public final int isNotEqualTo(OPLenumValue e);
public final int isSmallerOrEqualTo(OPLenumValue e);
public final int isSmallerThan(OPLenumValue e);
}

Member Functions
public final OPLenumValue getClone();

Enables the client code to construct a new object of the same class as the invoking object.
The new object interfaces to the same OPL data item as the invoking object.
public final String getName();

Enables the client code to retrieve the name of the OPL enumerated value interfaced by
the invoking object.
public final int getValue();

Enables the client code to retrieve the integer value corresponding to the OPL
enumerated value interfaced by the invoking object.
public final int isEqualTo(OPLenumValue e);

Returns a non-zero value if the OPL enumerated value interfaced by the invoking object
is equal to the OPL enumerated value interfaced by the argument e.
public final int isGreaterOrEqualTo(OPLenumValue e);

Returns a non-zero value if the OPL enumerated value interfaced by the invoking object
is greater or equal to the OPL enumerated value interfaced by the argument e.
I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 189

OPLenumValue

public final int isGreaterThan(OPLenumValue e);

Returns a non-zero value if the OPL enumerated value interfaced by the invoking object
is greater than the OPL enumerated value interfaced by the argument e.
public final int isNotEqualTo(OPLenumValue e);

Returns a non-zero value if the OPL enumerated value interfaced by the invoking object
is not equal to the OPL enumerated value interfaced by the argument e.
public final int isSmallerOrEqualTo(OPLenumValue e);

Returns a non-zero value if the OPL enumerated value interfaced by the invoking object
is smaller or equal to the OPL enumerated value interfaced by the argument e.
public final int isSmallerThan(OPLenumValue e);

Returns a non-zero value if the OPL enumerated value interfaced by the invoking object
is smaller than the OPL enumerated value interfaced by the argument e.
public final void setValue(OPLenumValue v);

Enables the client code to modify the invoking object. Upon a successful call, the
invoking object interfaces the same OPL enumerated value as the input argument v.

190I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLenumVar

OPLenumVar
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLenumVar provides an interface to enumerated variables defined in an OPL


model.

Package

ilog.opl.engine;

Synopsis

public class OPLenumVar extends OPLdata


{
public final OPLenumValue getValue();
}

Member Function
public final OPLenumValue getValue();

This member function enables the client code to retrieve the value assigned to the OPL
enumerated variable interfaced by the invoking object. It assumes that the OPL
enumerated variable is bound.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 191

OPLerrorReporter

OPLerrorReporter
Category

Java class

Description

The class OPLerrorReporter enables the client code to handle errors that may be
raised during the interaction with the OPL engine. In order to ensure error handling, the
client code must:
1. Implement a new class derived from OPLerrorReporter and redefine the member
functions notify*.
6. Create an instance of this new class; such an object is called an error reporter.
7. Assign the error reporter to an instance of OPLsolver, using the member function
OPLsolver.setErrorReporter.

Whenever the OPL engine raises errors concerning the syntax, the semantics or the
solving of the model loaded into the OPLsolver instance, the execution flow is
transferred to the appropriate member function of the error reporter.
Package

ilog.opl.engine;

Synopsis

public abstract class OPLerrorReporter


{
public final void end();
public abstract void notifyInternalError(String msg)
throws OPLexception;
public abstract void notifyRuntimeError(String msg,
String file, int line) throws OPLexception;
public abstract void notifyRuntimeWarning(String msg,
String file, int line) throws OPLexception;
public abstract void notifySemanticError(String msg,
String file, int line) throws OPLexception;
public abstract void notifySyntaxError(String msg,
String file, int line) throws OPLexception;
}

192I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLerrorReporter
Member Functions
public final void end();

Deletes the underlying C++ object.


public abstract void notifyInternalError(String msg)
throws OPLexception;

The flow of control is transferred to this member function whenever the OPL engine
raises an internal error.
public abstract void notifyRuntimeError(String msg,
String file, int line) throws OPLexception;

The flow of control is transferred to this member function whenever the OPL engine
detects an error during model solving.
public abstract void notifyRuntimeWarning(String msg,
String file, int line) throws OPLexception;

This virtual member function handles warning messages that are received when solving
with CPLEX. The default error reporter prints the runtime warnings without exiting the
process.
public abstract void notifySemanticError(String msg,
String file, int line) throws OPLexception;

The flow of control is transferred to this member function whenever the OPL engine
detects a semantic error.
public abstract void notifySyntaxError(String msg,
String file, int line) throws OPLexception;

The flow of control is transferred to this member function whenever the OPL engine
detects a syntax error.
See Also

OPLsolver.setErrorReporter

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 193

OPLexception

OPLexception
Category

Java class

Inheritance Path

Exception

Description

This is the basic class for OPL exceptions thrown by OPLsolver methods.

Package

ilog.opl.engine;

Synopsis

import java.lang.*;
public class OPLexception extends Exception {
public OPLexception();
public OPLexception(java.lang.String desc);
}

See Also

OPLerrorReporter, OPLsolver

194I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLfloat

OPLfloat
Category

Java class

Inheritance Path

OPLdata

Description

OPLfloat provides an interface to float data defined in an OPL model.

Package

ilog.opl.engine;

Synopsis

public class OPLfloat extends OPLdata


{
public final OPLfloat getClone();
public final double getValue();
public final void setValue(double v);
}

Member Functions
public final OPLfloat getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces to the same OPL data item as the
invoking object.
public final double getValue();

This member function enables the client code to retrieve the value of the OPL float data
interfaced by the invoking object.
public final void setValue(double v);

This member function enables the client code to set the value of the OPL float data
interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 195

OPLfloatRange

OPLfloatRange
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLfloatRange provides an interface to float ranges defined in an OPL


model.

Package

ilog.opl.engine;

Synopsis

public class OPLfloatRange extends OPLdata


{
public final double getHigh();
public final double getLow();
}

Member Functions
public final double getHigh();

This member function enables the client code to retrieve the highest value of the OPL
float range interfaced by the invoking object.
public final double getLow();

This member function enables the client code to retrieve the lowest value of the OPL
float range interfaced by the invoking object.

196I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLfloatVar

OPLfloatVar
Category

C++ class

Inheritance Path

OPLdata

Description

The class OPLfloatVar provides an interface to the float variables defined in an OPL
model.

Package

ilog.opl.engine;

Synopsis

public class OPLfloatVar extends OPLdata


{
public final int getBasisStatus();
public final double getMax();
public final double getMin();
public final double getReducedCost();
public final double getValue();
}

Member Functions
public final int getBasisStatus();

This member function enables the client code to retrieve the basis status associated, in a
linear OPL model, with the float variable interfaced by the invoking object.
public final double getMax();

This member function enables the client code to retrieve the maximal value of the
domain associated with the OPL float variable interfaced by the invoking object.
public final double getMin();

This member function enables the client code to retrieve the minimal value of the domain
associated with the OPL float variable interfaced by the invoking object.
public final double getReducedCost();

This member function enables the client code to retrieve the reduced cost associated, in a
linear OPL model, with the float variable interfaced by the invoking object.
public final double getValue();

This member function enables the client code to retrieve the value assigned to the OPL
float variable interfaced by the invoking object. It assumes that the OPL float variable is
bound.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 197

OPLint

OPLint
Category

Java class

Inheritance Path

OPLdata

Description

OPLint provides an interface to integer data defined in an OPL model.

Package

ilog.opl.engine;

Synopsis

public class OPLint extends OPLdata


{
public final OPLint getClone();
public final int getValue();
public final void setValue(int v);
}

Member Functions
public final OPLint getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces to the same OPL data item as the
invoking object.
public final int getValue();

This member function enables the client code to retrieve the value of the OPL integer
data interfaced by the invoking object.
public final void setValue(int v);

This member function enables the client code to set the value of the OPL integer data
interfaced by the invoking object.

198I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLintRange

OPLintRange
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLintRange provides an interface to integer ranges defined in an OPL


model.

Package

ilog.opl.engine;

Synopsis

public class OPLintRange extends OPLdata


{
public final int getHigh();
public final int getLow();
}

Member Functions
public final int getHigh();

This member function enables the client code to retrieve the highest value of the OPL
integer range interfaced by the invoking object.
public final int getLow();

This member function enables the client code to retrieve the lowest value of the OPL
integer range interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 199

OPLintVar

OPLintVar
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLintVar provides an interface to integer variables defined in an OPL


model.

Package

ilog.opl.engine;

Synopsis

public class OPLintVar extends OPLdata


{
public final int getMax();
public final int getMin();
public final int getValue();
}

Member Functions
public final int getMax();

This member function enables the client code to retrieve the maximal value of the
domain associated with the OPL integer variable interfaced by the invoking object.
public final int getMin();

This member function enables the client code to retrieve the minimal value of the domain
associated with the OPL integer variable interfaced by the invoking object.
public final int getValue();

This member function enables the client code to retrieve the value assigned to the OPL
integer variable interfaced by the invoking object. It assumes that the OPL integer
variable is bound.

200I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLintVar

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 201

OPLrequirement

OPLrequirement
Category

Java class

Inheritance Path

OPLadaptable

Description

The class OPLrequirement translates a requirement typically coming from business


rules into an OPL struct. OPL requirements are used to specify additional constraints
in an OPL model. An OPLrequirement has the same value semantic as an OPL
struct. Two requirements are considered equal if their fields are equal.

Package

ilog.opl.engine;

Synopsis

public class OPLrequirement implements OPLadaptable


{
public OPLrequirement(Object[] objects);
public OPLrequirement(Object object1, Object object2);
public OPLrequirement(Object object1, Object object2,
Object object3);
public OPLrequirement(Object object1, Object object2,
Object object3, Object object4);
public OPLrequirement(Object object1, Object object2,
Object object3, Object object4,
Object object5);
public OPLrequirement(Object object1, Object object2,
Object object3, Object object4,
Object object5, Object object6);
public void formatToOPL(StringBuffer buffer);
public boolean equals(Object o);
public int hashCode();
public String toString();
}

202I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLrequirement
Constructors

public OPLrequirement(Object[] objects);


public OPLrequirement(Object object1, Object
public OPLrequirement(Object object1, Object
Object object3);
public OPLrequirement(Object object1, Object
Object object3, Object
public OPLrequirement(Object object1, Object
Object object3, Object
Object object5);
public OPLrequirement(Object object1, Object
Object object3, Object
Object object5, Object

object2);
object2,
object2,
object4);
object2,
object4,
object2,
object4,
object6);

These constructors create a new OPLrequirement. The objects passed as parameters


are the fields of the requirement. The order of the fields is respected in the translation to
an OPL data struct.
Member Functions
public void formatToOPL(StringBuffer buffer);

This member function formats a requirement as an OPL struct and appends it to the
StringBuffer.
public boolean equals(Object o);

This member function has been redefined to provide value semantics. Two requirements
are considered equal if their fields are equal and respect the same order.
public int hashCode();

This member function has been redefined to provide value semantics.


public String toString();

This member function returns a String representation of the requirement.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 203

OPLrulesAdaptor

OPLrulesAdaptor
Category

Java class

Inheritance Path

OPLadaptor

Description

OPLrulesAdaptor adapts ILOG JRules data structures to ILOG OPL data format.

Package

ilog.opl.engine;

Synopsis

public class OPLrulesAdaptor extends OPLadaptor


{
public static final void formatAsArray
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
boolean doubleQuotes);
public static final void formatAsArray
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);
public static final void formatAsEnum
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector);
public static final void formatAsEnum
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
Method accessor);
public static final void formatAsSet
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
boolean doubleQuotes);
public static final void formatAsSet
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);
}

204I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLrulesAdaptor
Member Functions
public static final void formatAsArray
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
boolean doubleQuotes);

This member function formats the ilog.rules.engine.IlrDefaultCollector of


Objects passed as argument as an OPL data array and appends it to the buffer. The
order of values in the ordered set is the order from the IlrDefaultCollector:
[ value1, ..., valueN ]

Objects contained in the collector must implement the OPLadaptable interface.


public static final void formatAsArray
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);

This member function formats the ilog.rules.engine.IlrDefaultCollector of


Objects passed as argument as an OPL data array and appends it to the buffer. The set
does not use named initialization. The order of values in the ordered set is the order from
the IlrDefaultCollector:
[ value1, ..., valueN ]

Note that this method relies on reflection. A more efficient alternative is to use the other
formatAsArray, which expects an IlrDefaultCollector but no Method objects.
public static final void formatAsEnum
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector);

This member function formats the ilog.rules.engine.IlrDefaultCollector


passed as argument as an OPL enum and appends it to the buffer. Objects contained in
the collector must implement the OPLadaptable interface.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 205

OPLrulesAdaptor

public static final void formatAsEnum


(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
Method accessor);

This member function formats the ilog.rules.engine.IlrDefaultCollector


passed as argument as an OPL enum and appends it to the buffer. Note that this method
relies on reflection. A more efficient alternative is to use the other formatAsEnum,
which expects an IlrDefaultCollector but no Method objects.
public static final void formatAsSet
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
boolean doubleQuotes);

This member function formats the ilog.rules.engine.IlrDefaultCollector of


Objects passed as argument as an OPL data set and appends it to the buffer. The order
of values in the ordered set is the order from the IlrDefaultCollector:
{ value1, ..., valueN }

Objects contained in the collector must implement the OPLadaptable interface.


public static final void formatAsSet
(Stringbuffer buffer,
String name,
ilog.rules.engine.IlrDefaultCollector collector,
Method[] fieldAccessors,
boolean namedFields,
boolean doubleQuotes);

This member function formats the ilog.rules.engine.IlrDefaultCollector of


Objects passed as argument as an OPL data set of structs and appends it to the
buffer. The set does not use named initialization. The order of values in the ordered set is
the order from the IlrDefaultCollector:
{ value1, ..., valueN }

Note that this method relies on reflection. A more efficient alternative is to use the other
formatAsSet, which expects an IlrDefaultCollector but no Method objects.
See Also

ilog.opl.engine.OPLadaptor, ilog.opl.engine.OPLadaptable

206I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLscriptSolver

OPLscriptSolver
Category

Java class

Description

This class provides an interface for executing an OPLScript file from a Java application.

Package

ilog.opl.engine;

Synopsis

public class OPLscriptSolver


{
static {System.loadLibrary("opljni");}
public OPLscriptSolver();
public final void close();
public final int registerCplexLicense(String license,
int signature);
public final int registerOplLicense(String license,
int signature);
public final int registerSchedulerLicense(String license,
int signature);
public final int registerSolverLicense(String license,
int signature);
public final int run(String filename) throws OPLexception;
public final void setDefaultErrorReporterSilent(int set);
public final void setErrorReporter(OPLerrorReporter reporter);
public final void setIncludePathList(String includePathList);
public final void setOplComponentLogFile(int set);
}

Constructor

OPLscriptSolver(int comInit);

This constructor creates an instance of the Java class OPLscriptSolver. The client
code can use this instance to run an OPLscript file.
The Microsoft global function CoInitialize is called unless you provide 0 as an
argument. The CoUninitialize global function will be called by the destructor unless
you have specified 0 as the constructor argument. You need to initialize COM/ActiveX if
you use the Excel Sheet connectivity in your model. Otherwise, specify 0 to save time.
Member Functions
public final void close();

Releases all the allocated memory and implicitly deletes the underlying C++ class. After
calling close() you can no longer use the OPLscriptSolver instance.
public final int registerCplexLicense (String license, int signature);

This member function initializes a RUNTIME license for the CPLEX key.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 207

OPLscriptSolver

public final int registerOplLicense (String license, int signature);

This member function initializes a RUNTIME license for the OPLinterpreter key.
public final int registerSchedulerLicense(String license,
int signature);

This member function initializes a RUNTIME license for the Scheduler key.
public final int registerSolverLicense(String license, int signature);

This member function initializes a RUNTIME license for the Solver key.
public final int run(String filename) throws OPLexception;

This member function runs the file whose name is given as an argument. If the execution
is successful the value 1 is returned, otherwise 0 is returned.
public final void setDefaultErrorReporterSilent(int set);

This member function makes the default error reporter silent. This is useful when
building a server called from a scripting language, because then no one can click on the
OK button of the dialog box popped up by the default error reporter. You should use this
in conjunction with setOplComponentLogFile. However, it is preferable to subclass
OPLerrorReporter in order to define your own error recovery mechanism.
public final void setErrorReporter(OPLerrorReporter reporter);

This member function sets reporter as the error reporter to invoke if the OPL engine
raises an error. The default error reporter pops up dialog boxes with the error details. You
can change this default behavior by setting your own error reporter.
public final void setIncludePathList(String includePathList);

This member function initializes the include path list for the include macro and the
model file location declared in the OPLscript file.
public final void setOplComponentLogFile(int set);

This member function generates log information in an oplcomponent.log file.

208I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLset

OPLset
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLset provides an interface to the sets defined in an OPL model.

Package

ilog.opl.engine;

Synopsis

public class OPLset extends OPLdata


{
public final OPLset getClone();
public final OPLsetIterator getIterator();
}

Member Functions
public final OPLset getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces with the same OPL data item as the
invoking object.
public final OPLsetIterator getIterator();

This member function constructs a new iterator object, instance of the class
OPLsetIterator. Furthermore, this iterator object will enable the client code to access
the members of the OPL set interfaced by the invoking object.
See Also

OPLsetIterator

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 209

OPLsetIterator

OPLsetIterator
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLsetIterator provides a way to access the data members of a set defined
in an OPL model. An instance of the class OPLsetIterator (an iterator object) can be
constructed by calling the member function OPLset.getIterator, where the invoking
object of the class OPLset interfaces with the OPL set to be iterated.

Package

ilog.opl.engine;

Synopsis

public class OPLsetIterator


{
public final int getImpl();
public final OPLarray getArray();
public final OPLchar getChar();
public final OPLenumValue getEnumValue();
public final OPLfloat getFloat();
public final OPLint getInt();
public final OPLset getSet();
public final OPLstring getString();
public final OPLstruct getStruct();
public final void next();
public final int ok();
public final void reset();
}

Member Functions
public final OPLarray getArray();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of arrays. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLarray.
public final OPLchar getChar();

Returns the current element of the iterator and interprets it as a char (if possible,
otherwise it raises a runtime error).
public final OPLenumValue getEnumValue();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of enumerated values. Prior to invoking this member function, use the member
210I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsetIterator

function ok in order to ensure that the invoking object does not point "past the end" of
the iterated OPL set. This member function returns an object of the class
OPLenumValue.
public final OPLfloat getFloat();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of floats. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLfloat.
public final OPLint getInt();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of integers. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLint.
public final OPLset getSet();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of sets. Prior to invoking this member function, use the member function ok in order
to ensure that the invoking object does not point "past the end" of the iterated OPL set.
This member function returns an object of the class OPLset.
public final OPLstring getString();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of strings. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLstring.
public final OPLstruct getStruct();

This member function can be used in order to access the set member currently pointed to
by the invoking iterator. It assumes that the iterated set in the OPL model is declared as a
set of arrays. Prior to invoking this member function, use the member function ok in
order to ensure that the invoking object does not point "past the end" of the iterated OPL
set. This member function returns an object of the class OPLstruct.
public final void next();

This member function enables the invoking object to point to the next member of the
iterated OPL set.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 211

OPLsetIterator

public final int ok();

This member function can be used in order to test whether or not the invoking object is
pointing "past the end" of the iterated OPL set. If the returned value is non-zero, the
member functions OPLenumIterator.get* can be used in order to access the set
member currently pointed to by the invoking object.
public final void reset();

This member function re-initializes the invoking object such that it can be reused to
iterate from the beginning over the same OPL set.
See Also

OPLset

212I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

OPLsolver
Category

Java class

Description

This class provides an interface to the OPL engine. The interface allows access to OPL
model entities from a Java application wrapped around an OPL program.

Package

ilog.opl.engine;

Synopsis

public class OPLsolver


{
static {System.loadLibrary("opljni");}
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public

OPLsolver();
OPLsolver(int initCOM);
final void close();
final void declareData()throws OPLexception;
final String display()throws OPLexception;
final String displayOnSolution()throws OPLexception;
final void evalSolution()throws OPLexception;
final void evalOnSolution()throws OPLexception;
final OPLactivity getActivity(String name)
throws OPLexception;
final OPLarray getArray(String name)throws OPLexception;
final OPLchar getChar(String name)throws OPLexception;
final OPLconstraint getConstraint(String name)
throws OPLexception;
final OPLenum getEnum(String name)throws OPLexception;
final OPLenumValue getEnumValue(String name)
throws OPLexception;
final OPLenumVar getEnumVar(String name)
throws OPLexception;
final OPLfloat getFloat(String name)throws OPLexception;
final OPLfloatRange getFloatRange(String name)
throws OPLexception;
final OPLfloatVar getFloatVar(String name)
throws OPLexception ;
final OPLint getInt(String name)throws OPLexception;
final OPLintRange getIntRange(String name)
throws OPLexception;
final OPLintVar getIntVar(String name)
throws OPLexception;
final int getLastIterationResult() throws OPLexception;
final int getMathematicalSolutionStatus()
throws OPLexception;
final int getNumberOfChoicePoints()throws OPLexception;
final int getNumberOfConstraints()throws OPLexception;
final int getNumberOfFails()throws OPLexception;
final int getNumberOfIterations()throws OPLexception;
final int getNumberOfVariables()throws OPLexception;

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 213

OPLsolver

public final double getObjectiveValueFloat()


throws OPLexception;
public final int getObjectiveValueInt()throws OPLexception;
public final OPLset getSet(String name)throws OPLexception;
public final OPLstring getString(String name)
throws OPLexception;
public final OPLstruct getStruct(String name)
throws OPLexception;
public final double getTime()throws OPLexception;
public final int isDualFeasible() throws OPLexception;
public final int isOptimal() throws OPLexception;
public final int isPrimalFeasible() throws OPLexception;
public final void loadCompiledModelBuff
(String mbuf,int editMode)throws OPLexception;
public final void loadCompiledModelBuffAndDataBuff
(String mbuf,String dbuf,int editMode)
throws OPLexception;
public final void loadCompiledModelBuffAndDataFile
(String mbuf,String dname,int editMode)
throws OPLexception;
public final void loadCompiledModelBuffAndDataFiles
(String mbuf,String[] dname,int editMode)
throws OPLexception;
public final void loadCompiledModelFile
(String mname,int editMode)throws OPLexception;
public final void loadCompiledModelFileAndDataBuff
(String mname,String dbuf,int editMode)
throws OPLexception;
public final void loadCompiledModelFileAndDataFile
(String mname,String dname,int editMode)
throws OPLexception;
public final void loadCompiledModelFileAndDataFiles
(String mname,String[] dname,int editMode)
throws OPLexception;
public final void loadInterpretedModelBuff
(String mbuf,int editMode)throws OPLexception;
public final void loadInterpretedModelBuffAndDataBuff
(String mbuf,String dbuf,int editMode)
throws OPLexception;
public final void loadInterpretedModelBuffAndDataFile
(String mbuf,String dname,int editMode)
throws OPLexception;
public final void loadInterpretedModelBuffAndDataFiles
(String mbuf,String[] dname,int editMode)
throws OPLexception;
public final void loadInterpretedModelFile
(String mname,int editMode)throws OPLexception;
public final void loadInterpretedModelFileAndDataBuff
(String mname,String dbuf,int editMode)
throws OPLexception;
public final void loadInterpretedModelFileAndDataFile
(String mname,String dname,int editMode)
throws OPLexception;

214I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

public final void loadInterpretedModelFileAndDataFiles


(String mname,String[] dname,int editMode)
throws OPLexception;
public final int nextSolution()throws OPLexception;
public final int registerCplexLicense(String license,
int signature);
public final int registerOplLicense(String license,
int signature);
public final int registerSchedulerLicense(String license,
int signature);
public final int registerSolverLicense(String license,
int signature);
public final void reset()throws OPLexception;
public final void restore()throws OPLexception;
public final void setErrorReporter(OPLerrorReporter reporter);
public final void setExportFile(String name)
throws OPLexception;
public final void setFailLimit(int f)throws OPLexception;
public final void setFloatParameter(String s1, double f);
public final void setIncludePathList(String includePathList);
public final void setIntegerParameter(String s1, int i)
throws OPLexception;
public final void setOplComponentLogFile(int set);
public final void setOptimizationStep(double d)
throws OPLexception;
public final void setOrLimit(int i)throws OPLexception;
public final void setStringParameter(String s1,String s2)
throws OPLexception;
public final void setTimeLimit(int i)throws OPLexception;
public final int solve()throws OPLexception;
public final void stateConstraint()throws OPLexception;
public final void unsetLimit()throws OPLexception;
}

Constructor

public OPLsolver();

This constructor creates an instance of the class OPLsolver. The client code can use this
instance to interact with the OPL engine.
public OPLsolver(int initCOM);

The OPLsolver object, by default (initCOM = 1), initializes COM on Windows with
its constructor, so that you can access Excel connectivity. It uninitializes COM
automatically with its close() method. By passing 0 as argument to this constructor
you inform OPLsolver that you are going to manage the COM initialization/
unitialization yourself.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 215

OPLsolver
Member Functions
public final void close();

This member function signals that the invoking object will be no longer used by the
client code. Hence the memory used by the invoking object is returned to the system.
Once this member function has been called, no other member functions may by called by
the invoking object.
public final void declareData()throws OPLexception;

This member function instructs the OPL engine to construct and initialize the data
structures of the model previously loaded in edit mode. No solving process is taking
place. After calling declareData, the client code can access/modify data items inside
the model.
public final String display()throws OPLexception;

This member function returns a string containing the result of the execution of the
possible display statements situated at the end of an OPL model previously loaded and
solved. It triggers all the output instructions located after the solve{} block, such as
display statements or writing to an output file, and also instructions for writing to a
database (DBupdate) or to a spreadsheet (SheetWrite).
public final String displayOnSolution()throws OPLexception;

This member function returns a string containing the result of the execution of the
possible displayOnSolution statements from the OPL model previously loaded and
solved.
public final void evalSolution()throws OPLexception;

This member function evaluates the instructions situated at the end of a model, outside
the solve{} block. It triggers instructions located after the solve{} block, except for
instructions such as display statements, or writing to an output file. Typically, it
triggers instructions for writing to a database (DBupdate) or to a spreadsheet
(SheetWrite).
public final void evalOnSolution()throws OPLexception;

This member function evaluates the instructions situated in the onSolution block.
public final OPLactivity getActivity(String name)throws OPLexception;

This member function may be used in order to access an object of type Activity in the
OPL model associated with the invoking object. The string argument name indicates the
name of the activity as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLactivity.

216I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

public final OPLarray getArray(String name)throws OPLexception;

This member function may be used in order to access an array data structure in the OPL
model associated with the invoking object. The string argument name indicates the name
of the array as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLarray.
public final OPLchar getChar(String name)throws OPLexception;

Returns the data object named name in the model currently loaded in the OPLsolver
instance on which the method is invoked. If the object is not a char, OPL raises a
runtime error.
public final OPLconstraint getConstraint(String name)
throws OPLexception;

This member function may be used in order to access a constraint in the OPL model
associated with the invoking object. The string argument name indicates the name of the
constraint as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: stateConstraint, solve, nextSolution. This member function returns
an object of the class OPLconstraint.
public final OPLenum getEnum(String name)throws OPLexception;

This member function may be used in order to access an enumerated type defined in the
OPL model associated with the invoking object. The string argument name indicates the
name of the enumerated type as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLenum.
public final OPLenumValue getEnumValue(String name)
throws OPLexception;

This member function may be used in order to access a member of an enumerated type
(that is, an enumerated value) defined in the OPL model associated with the invoking
object. The string argument name indicates the name of the enumerated value as it
appears in the OPL model. In order to call this member function, the invoking object
should have previously called at least one of the following member functions:
declareData, stateConstraint, solve, nextSolution. This member function
returns an object of the class OPLenumValue.
public final OPLenumVar getEnumVar(String name)throws OPLexception;

This member function may be used in order to access an enumerated variable in the OPL
model associated with the invoking object. The string argument name indicates the name
of the enumerated variable as it appears in the OPL model. In order to call this member
I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 217

OPLsolver

function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLenumVar.
public final OPLfloat getFloat(String name)throws OPLexception;

This member function may be used in order to access a float data item in the OPL model
associated with the invoking object. The string argument name indicates the name of the
float data as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLfloat.
public final OPLfloatRange getFloatRange(String name)
throws OPLexception;

This member function may be used in order to access a float range defined in the OPL
model associated with the invoking object. The string argument name indicates the name
of the float range as it appears in the OPL model. In order to call this member function,
the invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLfloatRange.
public final OPLfloatVar getFloatVar(String name)throws OPLexception;

This member function may be used in order to access a float variable in the OPL model
associated with the invoking object. The string argument name indicates the name of the
float variable as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an interface object of the class OPLfloatVar.
public final OPLint getInt(String name)throws OPLexception;

This member function may be used in order to access an integer data item in the OPL
model associated with the invoking object. The string argument name indicates the name
of the integer data item as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLint.
public final OPLintRange getIntRange(String name)throws OPLexception;

This member function may be used in order to access an integer range defined in the
OPL model associated with the invoking object. The string argument name indicates the
name of the integer range as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution.This
member function returns an object of the class OPLintRange.
218I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

public final OPLintVar getIntVar(String name)throws OPLexception;

This member function may be used in order to access an integer variable in the OPL
model associated with the invoking object. The string argument name indicates the name
of the integer variable as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLintVar.
public final int getLastIterationResult() throws OPLexception;

Returns the CPLEX solution type (the same as the CPLEX output parameter,
CPXsolninfo(), solntype). The values can be:
0 - the model has no solution
1 - the model has a simplex basis
2 - the model has a solution but no basis
public final int getMathematicalSolutionStatus()
throws OPLexception;

Returns the CPLEX solution status. This is the same as the CPLEX return code function
CPXgetstat(). The status codes can be found in the CPLEX Reference Manual,
Appendix B Solution Status Codes.
public final int getNumberOfChoicePoints()throws OPLexception;

This member function may be used to retrieve the number of choice points encountered
since the creation of the invoking object, or since the re-initialization of the invoking
object by a call to the member function reset.
public final int getNumberOfConstraints()throws OPLexception;

This member function may be used to retrieve the number of constraints that occur in the
OPL model loaded by the invoking object. Note that this is the number of constraints
computed by OPL. It may differ from the number of constraints posted on the underlying
libraries.
public final int getNumberOfFails()throws OPLexception;

This member function may be used to retrieve the number of failures encountered since
the creation of the invoking object, or since the re-initialization of the invoking object by
a call to the member function reset.
public final int getNumberOfIterations()throws OPLexception;

This member function may be used to retrieve the number of simplex iterations made so
far by the OPL engine associated with the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 219

OPLsolver

public final int getNumberOfVariables()throws OPLexception;

This member function may be used to retrieve the number of constrained variables that
are used in the OPL model loaded by the invoking object.
public final double getObjectiveValueFloat()throws OPLexception;

This member function allows the client code to access the value of the objective function
in an optimization model. It assumes that the objective function takes float values. This
member function must be called after a successful call to the nextSolution or solve
methods for the invoking object.
public final int getObjectiveValueInt()throws OPLexception;

This member function allows the client code to access the value of the objective function
in an optimization model. It assumes that the objective function takes integer values. This
member function must be called after a successful call to the nextSolution or solve
methods for the invoking object.
public final OPLset getSet(String name)throws OPLexception;

This member function may be used to access a data item declared as a set in the OPL
model associated with the invoking object. The string argument name indicates the name
of the set object as it appears in the OPL model. In order to call this member function, the
invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLset.
public final OPLstring getString(String name)throws OPLexception;

This member function may be used in order to access a string data item in the OPL
model associated with the invoking object. The string argument name indicates the name
of the string data item as it appears in the OPL model. In order to call this member
function, the invoking object should have previously called at least one of the following
member functions: declareData, stateConstraint, solve, nextSolution. This
member function returns an object of the class OPLstring.
public final OPLstruct getStruct(String name)throws OPLexception;

This member function may be used to access a data item declared as a record in the OPL
model associated with the invoking object. The string argument name indicates the name
of the record object as it appears in the OPL model. In order to call this member function,
the invoking object should have previously called at least one of the following member
functions: declareData, stateConstraint, solve, nextSolution. This member
function returns an object of the class OPLstruct.
public final double getTime()throws OPLexception;

This member function may be used to retrieve the time elapsed, in seconds, since the
creation of the invoking object.

220I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

public final int isDualFeasible() throws OPLexception;

Returns 1 if the current solution is dual feasible (the same as the CPLEX output
parameter CPXsolninfo(), dfeasind). Note that a false return value does not
necessarily mean that the solution is not feasible. It simply means that the relevant
algorithm was not able to conclude it was feasible when it terminated.
public final int isOptimal() throws OPLexception;

Returns 1 if the solution is proved optimal (if CPXgetstat returns


CPX_STAT_OPTIMAL, or CPXMIP_OPTIMAL, or CPXMIP_OPTIMAL_TOL). The CPLEX
status codes can be found in the CPLEX Reference Manual, Appendix B Solution Status
Codes. Returns zero if no solution exists.
public final int isPrimalFeasible() throws OPLexception;

Returns 1 if the current solution is primal feasible (the same as the CPLEX output
parameter CPXsolninfo(), pfeasind). Note that a false return value does not
necessarily mean that the solution is not feasible. It simply means that the relevant
algorithm was not able to conclude it was feasible when it terminated.
public final void loadCompiledModelBuff(String mbuf,int editMode)
throws OPLexception;

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument editMode
indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved.
public final void loadCompiledModelBuffAndDataBuff
(String mbuf,String dbuf,int editMode)
throws OPLexception;

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument dbuf is a
string containing the model data in OPL format. The argument editMode indicates
whether the model is loaded in edit mode or not. If editMode does not evaluate to zero,
the model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 221

OPLsolver

public final void loadCompiledModelBuffAndDataFile


(String mbuf,String dname,int editMode)
throws OPLexception;

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument dname is
the name of a .dat file containing the model data in OPL format. The argument
editMode indicates whether the model is loaded in edit mode or not. If editMode does
not evaluate to zero, the model is loaded in edit mode, allowing for the modification of
data items inside the model prior to being solved.
public final void loadCompiledModelBuffAndDataFiles
(String mbuf,String[] dname,int editMode)
throws OPLexception;

This member function loads a compiled OPL model into the invoking object. The
argument mbuf is a string containing the compiled OPL model. This string represents the
content of a .opl file generated from OPL Studio. (See the ILOG OPL Studio Users
Manual for more information on generating compiled models.) The argument dname is
an array containing the names of all the data files to be loaded with the model. The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved.
public final void loadCompiledModelFile(String mname,int editMode)
throws OPLexception;

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved.
public final void loadCompiledModelFileAndDataBuff
(String mname,String dbuf,int editMode)
throws OPLexception;

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument dbuf is a string containing the model data in OPL format. The argument
editMode indicates whether the model is loaded in edit mode or not. If editMode does
not evaluate to zero, the model is loaded in edit mode, allowing for the modification of
data items inside the model prior to being solved.

222I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

public final void loadCompiledModelFileAndDataFile


(String mname,String dname,int editMode)
throws OPLexception;

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument dname is the name of a .dat file containing the model data in OPL format. The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved.
public final void loadCompiledModelFileAndDataFiles
(String mname,String[] dname,int editMode)
throws OPLexception;

This member function loads a compiled OPL model into the invoking object. The
argument mname is the name of a .opl file generated from OPL Studio. (See the ILOG
OPL Studio Users Manual for more information on generating compiled models.) The
argument dname is an array containing the names of all the data files to be loaded with
the model. The argument editMode indicates whether the model is loaded in edit mode
or not. If editMode does not evaluate to zero, the model is loaded in edit mode, allowing
for the modification of data items inside the model prior to being solved.
public final void loadInterpretedModelBuff(String mbuf,int editMode)
throws OPLexception;

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument editMode indicates whether the
model is loaded in edit mode or not. If editMode does not evaluate to zero, the model is
loaded in edit mode, allowing for the modification of data items inside the model prior to
being solved. This function requires the key OPLinterpreter.
public final void loadInterpretedModelBuffAndDataBuff
(String mbuf,String dbuf,int editMode)
throws OPLexception;

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument dbuf is a string containing the
model data in OPL format. The argument editMode indicates whether the model is
loaded in edit mode or not. If editMode does not evaluate to zero, the model is loaded in
edit mode, allowing for the modification of data items inside the model prior to being
solved. This function requires the key OPLinterpreter.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 223

OPLsolver

public final void loadInterpretedModelBuffAndDataFile


(String mbuf,String dname,int editMode)
throws OPLexception;

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument dname is the name of a .dat file
containing the model data in OPL format. The argument editMode indicates whether
the model is loaded in edit mode or not. If editMode does not evaluate to zero, the
model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved. This function requires the key OPLinterpreter.
public final void loadInterpretedModelBuffAndDataFiles
(String mbuf,String[] dname,int editMode)
throws OPLexception;

This member function loads an OPL model into the invoking object. The argument mbuf
is a string containing the OPL model. The argument dname is an array containing the
names of all the data files to be loaded with the model. The argument editMode
indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved. This function requires the key OPLinterpreter.
public final void loadInterpretedModelFile
(String mname,int editMode)throws OPLexception;

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument editMode
indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved. This function requires the key OPLinterpreter.
public final void loadInterpretedModelFileAndDataBuff
(String mname,String dbuf,int editMode)
throws OPLexception;

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument dbuf is a
string containing the model data in OPL format. The argument editMode indicates
whether the model is loaded in edit mode or not. If editMode does not evaluate to zero,
the model is loaded in edit mode, allowing for the modification of data items inside the
model prior to being solved. This function requires the key OPLinterpreter.
public final void loadInterpretedModelFileAndDataFile
(String mname,String dname,int editMode)
throws OPLexception;

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument dname is the
name of a .dat file containing the model data in OPL format. The argument editMode

224I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

indicates whether the model is loaded in edit mode or not. If editMode does not evaluate
to zero, the model is loaded in edit mode, allowing for the modification of data items
inside the model prior to being solved. This function requires the key OPLinterpreter.
public final void loadInterpretedModelFileAndDataFiles
(String mname,String[] dname,int editMode)
throws OPLexception;

This member function loads an OPL model into the invoking object. The argument
mname is the name of a .mod file containing the OPL model. The argument dname is an
array containing the names of all the data files to be loaded with the model. The
argument editMode indicates whether the model is loaded in edit mode or not. If
editMode does not evaluate to zero, the model is loaded in edit mode, allowing for the
modification of data items inside the model prior to being solved. This function requires
the key OPLinterpreter.
public final int nextSolution()throws OPLexception;

This member function computes successive solutions for the OPL model previously
loaded by the invoking object. For optimization problems, this member function can be
used to obtain a sequence of solutions, each of which improves the best value of the
objective function found so far. If the returned value is equal to zero, then the value of the
objective function cannot be further improved. In order to retrieve the optimal solution
you can use the member function restore. If the first call to nextSolution returns
zero, the model has no solution.
public final int registerCplexLicense(String license, int signature);

You can register your CPLEX RUNTIME key with this method when you deploy the
OPL Component Libraries.
public final int registerOplLicense(String license, int signature);

You can register your OPLinterpreter RUNTIME key with this method when you deploy
the OPL Component Libraries. This method must be called before a
loadInterpretedModelXXXXX method is called.
public final int registerSchedulerLicense(String license,
int signature);

You can register your Scheduler RUNTIME key with this method when you deploy the
OPL Component Libraries.
public final int registerSolverLicense(String license, int signature);

You can register your Solver RUNTIME key with this method when you deploy the OPL
Component Libraries.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 225

OPLsolver

public final void reset()throws OPLexception;

This member function determines the OPL engine to reset the loaded model to its initial
state. Thus, any model modifications made by the client code are lost and any references
in the client code to model items are no longer valid.
public final void restore()throws OPLexception;

This member function restores the last solution found by using the member function
nextSolution for the invoking object.
public final void setErrorReporter(OPLerrorReporter reporter);

This member function sets reporter as an error reporter instance for the invoking
object. Whenever the OPL engine raises an error concerning the syntax, the semantics or
the solving of the model loaded into the invoking object, the control is transferred to the
appropriate member function of the error reporter, reporter. See also the class
OPLerrorReporter for the definition of an error reporter.
public final void setExportFile(String name)throws OPLexception;

This member function may be used to write a previously loaded linear model to a file in
a chosen format. The model is written once solve or nextSolution is called. The
string name indicates the file to which the model is written. The file extension (the
characters following the last period in name) is used to infer the format of the file as
follows:
.sav binary SAV file
.mps MPS format
.lp LP format
.rmp MPS format, generic names
.rew MPS format, generic names
.rlp LP format, generic names
public final void setFailLimit(int f)throws OPLexception;

This member function may be used in order to specify a limit on the number of failures
the OPL engine may encounter during the search for a solution. When the limit is
reached, the search stops and the current call to the member function solve or
nextSolution returns a zero value.
public final void setFloatParameter(String s1, double f);

This member function may be used in order to specify the value of a float parameter to
the OPL engine. The string argument s1 indicates the parameters name. The float
argument f contains the parameters value.

226I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLsolver

public final void setIncludePathList(String includePathList);

This member function initializes the list of paths used to locate the files specified in a
model. In a model, reference to files can be found after the include keyword, or the
symbol < indicating data initialization from a flat file.
public final void setIntegerParameter(String s1, int i)
throws OPLexception;

This member function may be used in order to specify the value of an integer parameter
to the OPL engine. The string argument s1 indicates the parameters name. The integer
argument i contains the parameters value.
public final void setOplComponentLogFile(int set);

Writes, in an oplcomponent.log file, information about problems encountered. With


the MIIS, this file should be located in the Windows/System32 directory.
public final void setOptimizationStep(double d)throws OPLexception;

This member function tells the OPL engine to produce solutions that are at least step d
better during the repeated solving of an optimization model. In other words, each call to
nextSolution will find a solution that improves the objective by at least step d.
public final void setOrLimit(int i)throws OPLexception;

This member function may be used in order to specify a limit on the number of choice
points the OPL engine may encounter during the search for a solution. When the limit is
reached, the search stops and the current call to the member function solve or
nextSolution returns a zero value.
public final void setStringParameter(String s1,String s2)
throws OPLexception;

This member function may be used in order to specify the value of a string parameter to
the OPL engine. The string argument s1 indicates the parameters name. The string
argument s2 contains the parameters value.
public final void setTimeLimit(int i)throws OPLexception;

This member function may be used to specify a limit, in seconds, on the CPU time the
OPL engine takes to search for a solution. When the limit is reached, the search stops and
the current call to the member function solve or nextSolution returns a zero value.
public final int solve()throws OPLexception;

This member function computes the optimal solution of the OPL model previously
loaded by the invoking object. If the returned value is equal to zero, the model has no
solution. If the returned value is equal to one, OPL managed to find a solution. When a
model has an objective function, a returned value of one means that OPL also proved
optimality or a limit was reached with a feasible solution (node limit, time limit etc.).
Note that instructions for displaying or writing to an output file are not triggered, but
I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 227

OPLsolver

instructions for writing to a database (DBupdate) or to a spreadsheet (SheetWrite) are


triggered. See nextSolution, restore, evalSolution and display for a different
behavior.
public final void stateConstraint()throws OPLexception;

This member function instructs the OPL engine to take into account the constraints
declared in the model previously loaded in edit mode. No solving process is taking place.
This member function will also implicitly call declareData. After calling
stateConstraint, the client code can access/modify data items inside the model and
also it can inspect the named constraints of the model.
public final void unsetLimit()throws OPLexception;

This member function unsets any limit a previous call to setFailLimit, setOrLimit,
or setTimeLimit could have set on the invoking object.

228I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLstring

OPLstring
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLstring provides an interface to string data defined in an OPL model.

Package

ilog.opl.engine;

Synopsis

public class OPLstring extends OPLdata


{
public final OPLstring getClone();
public final String getValue();
public final void setValue(String v);
}

Member Functions
public final OPLstring getClone();

This member function enables the client code to construct a new object of the same class
as the invoking object. The new object interfaces with the same OPL data item as the
invoking object.
public final String getValue();

This member function enables the client code to retrieve the value of the OPL string data
interfaced by the invoking object.
public final void setValue(String v);

This member function enables the client code to set the value of the OPL string data
interfaced by the invoking object.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 229

OPLstruct

OPLstruct
Category

Java class

Inheritance Path

OPLdata

Description

The class OPLstruct provides an interface to data defined as records in an OPL model.

Package

ilog.opl.engine;

Synopsis

public class OPLstruct extends OPLdata


{
public final OPLarray getArray(String name);
public final OPLchar getChar(String name);
public final OPLstruct getClone();
public final OPLenumValue getEnumValue(String name);
public final OPLfloat getFloat(String name);
public final OPLint getInt(String name);
public final OPLset getSet(String name);
public final OPLstring getString(String name);
public final OPLstruct getStruct(String name);
}

Member Functions
public final OPLarray getArray(String name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an OPL array. This
member function returns an object of the class OPLarray.
public final OPLchar getChar(String name);

Returns the field named name as long as its type is char. Otherwise it raises a runtime
error.
public final OPLstruct getClone();

This member function enables the client code to construct a new interface object of the
same class as the invoking object. The new object interfaces with the same OPL data
item as the invoking object.
public final OPLenumValue getEnumValue(String name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an enumerated type.
This member function returns an object of the class OPLenumValue.

230I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

OPLstruct

public final OPLfloat getFloat(String name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is of the type float. This
member function returns an interface object of the class OPLfloat.
public final OPLint getInt(String name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is of the type integer.
This member function returns an object of the class OPLint.
public final OPLset getSet(String name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an OPL set. This
member function returns an object of the class OPLset.
public final OPLstring getString(String name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is of the type string.
This member function returns an object of the class OPLstring.
public final OPLstruct getStruct(String name);

This member function enables the client code to access the field named name in the OPL
record interfaced by the invoking object. It assumes that the field is an OPL record. This
member function returns an object of the class OPLstruct.

I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 231

OPLsymmetricRequirement

OPLsymmetricRequirement
Category

Java class

Inheritance Path

OPLrequirement

Description

The class OPLsymmetricRequirement groups a pair of objects as a symmetric


requirement. A symmetric requirement comes from business rules and is to be translated
into an OPL struct. Symmetric requirements are used to post constraints in an OPL
model, typically for specifying compatibility tables. Two symmetric requirements are
considered equal if their fields are equal, irrespective of the order.

Package

ilog.opl.engine;

Synopsis

public class OPLsymmetricRequirement extends OPLrequirement


{
public OPLsymmetricRequirement(Object object1, Object object2);
public boolean equals(Object o)
}

Constructor

public OPLsymmetricrequirement(Object object1, Object object2);

This constructor creates a new OPLsymmetricRequirement, with


(object1,object2) equal to (object1,object2).
Member Functions
public boolean equals(Object o);

Two symmetric requirements are considered equal if their fields are equal, irrespective of
the order.

232I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

Index

C
C++ class
OPLactivity 94
OPLalternativeResource 95
OPLarray 96
OPLbasisStatus 104
OPLchar 105
OPLconstraint 106
OPLdata 108
OPLdiscreteEnergy 109
OPLdiscreteResource 110
OPLenum 111
OPLenumIterator 113
OPLenumValue 114
OPLenumVar 116
OPLerrorReporter 117
OPLfloat 119
OPLfloatRange 120
OPLfloatVar 121
OPLint 122
OPLinternalError 123
OPLintRange 124
OPLintVar 125
OPLreservoir 126
OPLruntimeError 127
OPLscriptSolver 128
OPLsemanticError 130
OPLset 131
OPLsetIterator 132

OPLsolver 135
OPLstateResource 153
OPLstring 154
OPLstruct 155
OPLsyntaxError 157
OPLunaryResource 158
choice point 74, 83, 142, 151, 219, 227
close member function
IOPLscriptSolver COM interface 56
IOPLsolver COM interface 69
OPLscriptSolverC++ class 128
OPLscriptSolverJava class 207
OPLsolver C++ class 137
OPLsolver Java class 216
COM class
COPLscriptSolver 17
COPLsolver 19
COM initialized on Windows 137, 215
COM interface
COPLscriptSolver 17
COPLsolver 19
IOPLactivity 21
IOPLarray 22
IOPLchar 32
IOPLconstraint 33
IOPLdata 35
IOPLenum 36
IOPLenumIterator 40
IOPLenumValue 42
IOPLenumVar 45

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

IOPLerrorReporter 46
IOPLfloat 48
IOPLfloatRange 49
IOPLfloatVar 50
IOPLint 52
IOPLintRange 53
IOPLintVar 54
IOPLset 58
IOPLsetIterator 59
IOPLsolver 63
IOPLstring 86
IOPLstruct 87
COM/ActiveX interface
IOPLscriptSolver 55
constructor
OPLscriptSolver C++ class 128
OPLscriptSolverJava class 207
OPLsolver C++ class 137
OPLsolver Java class 215
conventions in this document
naming conventions 8
typographic conventions 8
COPLscriptSolver COM class 17
COPLsolver COM class 19

D
declareData member function
IOPLsolver COM interface 70
OPLsolver C++ class 138
OPLsolver Java class 216
display member function
IOPLsolver COM interface 70
OPLsolver C++ class 138
OPLsolver Java class 216
displayOnSolution member function
IOPLsolver COM interface 70
OPLsolver C++ class 138
OPLsolver Java class 216

E
eltActivity member function
IOPLarray COM interface 24
OPLarray C++ class 97
OPLarray Java class 175

eltAlternativeResource member function


OPLarray C++ class 97
eltArray member function
IOPLarray COM interface 24
OPLarray C++ class 97
OPLarray Java class 175
eltChar member function
IOPLarray COM interface 25
OPLarray C++ class 97
OPLarray Java class 175
eltConstraint member function
IOPLarray COM interface 25
OPLarray C++ class 97
OPLarray Java class 175
eltDiscreteEnergy member function
OPLarray C++ class 98
eltDiscreteResource member function
OPLarray C++ class 98
eltEnumValue member function
IOPLarray COM interface 25
OPLarray C++ class 98
OPLarray Java class 175
eltEnumVar member function
IOPLarray COM interface 25
OPLarray C++ class 98
OPLarray Java class 175
eltFloat member function
IOPLarray COM interface 25
OPLarray C++ class 98
OPLarray Java class 176
eltFloatVar member function
IOPLarray COM interface 26
OPLarray C++ class 98
OPLarray Java class 176
eltInt member function
IOPLarray COM interface 26
OPLarray C++ class 99
OPLarray Java class 176
eltIntVar member function
IOPLarray COM interface 26
OPLarray C++ class 99
OPLarray Java class 176
eltReservoir member function
OPLarray C++ class 99

234I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

INDEX

eltSet member function


IOPLarray COM interface 26
OPLarray C++ class 99
OPLarray Java class 176
eltStateResource member function
OPLarray C++ class 99
eltString member function
IOPLarray COM interface 26
OPLarray C++ class 99
OPLarray Java class 176
eltStruct member function
IOPLarray COM interface 27
OPLarray C++ class 100
OPLarray Java class 177
eltUnaryResource member function
OPLarray C++ class 100
equals member function
OPLrequirement Java class 203
OPLsymmetricRequirement Java class 232
evalOnSolution member function
OPLsolver C++ class 70, 138
OPLsolver Java class 216
evalSolution member function
IOPLsolver COM interface 70
OPLsolver C++ class 138
OPLsolver Java class 216

F
format member function
OPLadaptor Java class 168
formatAsArray member function
OPLadaptor Java class 168, 169, 170
OPLrulesAdaptor Java class 205
formatAsEnum member function
OPLadaptor Java class 170
OPLrulesAdaptor Java class 205, 206
formatAsEnumValue member function
OPLadaptor Java class 170
formatAsInt member function
OPLadaptor Java class 170, 171
formatAsSet member function
OPLadaptor Java class 171, 172
OPLrulesAdaptor Java class 206

formatAsString member function


OPLadaptor Java class 172
formatAsStruct member function
OPLadaptor Java class 172, 173
formatToOPL member function
OPLadaptable Java interface 164
OPLrequirement Java class 203

G
get member function
IOPLenumIterator COM interface 41
OPLenumIterator C++ class 113
OPLenumIterator Java class 187
getActivity member function
IOPLarray COM interface 27
IOPLsolver COM interface 70
OPLarray C++ class 100
OPLarray Java class 177
OPLsolver C++ class 138
OPLsolver Java class 216
getAlternativeResource member function
OPLarray C++ class 100
OPLsolver C++ class 138
getArray member function
IOPLarray COM interface 27
IOPLsetIterator COM interface 60
IOPLsolver COM interface 70
IOPLstruct COM interface 88
OPLarray C++ class 100
OPLarray Java class 177
OPLsetIterator C++ class 132
OPLsetIterator Java class 210
OPLsolver C++ class 139
OPLsolver Java class 217
OPLstruct C++ class 155
OPLstruct Java class 230
getBasisStatus member function
IOPLconstraint COM interface 34
IOPLfloatVar COM interface 50
OPLconstraint C++ class 106
OPLconstraint Java class 182
OPLfloatVar C++ class 121
getCard member function
IOPLenum COM interface 37

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

OPLenum C++ class 111


OPLenum Java class 185
getChar member function
IOPLarray COM interface 27
IOPLstruct COM interface 88
OPLarray C++ class 100
OPLarray Java class 177
OPLsetIterator C++ class 132
OPLsetIterator Java class 210
OPLsolver C++ class 139
OPLsolver Java class 217
OPLstruct C++ class 155
OPLstruct Java class 230
getClone member function
IOPLarray COM interface 27
IOPLchar COM interface 32
IOPLenumValue COM interface 43
IOPLfloat COM interface 48
IOPLint COM interface 52
IOPLset COM interface 58
IOPLstring COM interface 86
IOPLstruct COM interface 88
OPLarray C++ class 100
OPLarray Java class 177
OPLchar C++ class 105
OPLchar Java class 181
OPLenumValue C++ class 114
OPLenumValue Java class 189
OPLfloat C++ class 119
OPLfloat Java class 195
OPLint C++ class 122
OPLint Java class 198
OPLset C++ class 131
OPLset Java class 209
OPLstring C++ class 154
OPLstring Java class 229
OPLstruct C++ class 155
OPLstruct Java class 230
getConstraint member function
IOPLarray COM interface 28
IOPLsolver COM interface 71
OPLarray C++ class 101
OPLarray Java class 177
OPLsolver C++ class 139
OPLsolver Java class 217

getDiscreteEnergy member function


OPLarray C++ class 101
OPLsolver C++ class 139
getDiscreteResource member function
OPLarray C++ class 101
OPLsolver C++ class 139
getDual member function
IOPLconstraint COM interface 34
OPLconstraint C++ class 106
OPLconstraint Java class 182
getDuration member function
IOPLactivity COM interface 21
OPLactivity C++ class 94
OPLactivity Java class 162
getEnd member function
IOPLactivity COM interface 21
OPLactivity C++ class 94
OPLactivity Java class 162
getEnum member function
IOPLsolver COM interface 71
OPLsolver C++ class 139
OPLsolver Java class 217
getEnumValue member function
IOPLarray COM interface 28
IOPLsetIterator COM interface 60
IOPLsolver COM interface 71
OPLarray C++ class 101
OPLarray Java class 177
OPLsetIterator C++ class 132
OPLsetIterator Java class 210
OPLsolver C++ class 140
OPLsolver Java class 217
OPLstruct C++ class 155
OPLstruct Java class 230
getEnumVar member function
IOPLarray COM interface 28
IOPLsolver COM interface 72
OPLarray C++ class 101
OPLarray Java class 178
OPLsolver C++ class 140
OPLsolver Java class 217
getFirst member function
IOPLenum COM interface 37
OPLenum C++ class 111
OPLenum Java class 185

236I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

INDEX

getFloat member function


IOPLarray COM interface 28
IOPLsetIterator COM interface 60
IOPLsolver COM interface 72
IOPLstruct COM interface 88
OPLarray C++ class 101
OPLarray Java class 178
OPLsetIterator C++ class 133
OPLsetIterator Java class 211
OPLsolver C++ class 140
OPLsolver Java class 218
OPLstruct C++ class 156
OPLstruct Java class 231
getFloatRange member function
IOPLsolver COM interface 72
OPLsolver C++ class 140
OPLsolver Java class 218
getFloatVar member function
IOPLarray COM interface 29
IOPLsolver COM interface 72
OPLarray C++ class 102
OPLarray Java class 178
OPLsolver C++ class 140
OPLsolver Java class 218
getHigh member function
IOPLarray COM interface 29
IOPLfloatRange COM interface 49
IOPLintRange COM interface 53
OPLarray C++ class 102
OPLarray Java class 178
OPLfloatRange C++ class 120
OPLfloatRange Java class 196
OPLintRange C++ class 124
OPLintRange Java class 199
getIlcLinOpt member function
OPLsolver C++ class 141
getIlcSchedule member function
OPLsolver C++ class 141
getImpl member function
IOPLdata abstract COM interface 35
OPLdata C++ class 108
getInt member function
IOPLarray COM interface 29
IOPLsetIterator COM interface 60
IOPLsolver COM interface 73

IOPLstruct COM interface 88


OPLarray C++ class 102
OPLarray Java class 178
OPLsetIterator C++ class 133
OPLsetIterator Java class 211
OPLsolver C++ class 141
OPLsolver Java class 218
OPLstruct C++ class 156
OPLstruct Java class 231
getIntRange member function
IOPLsolver COM interface 73
OPLsolver C++ class 141
OPLsolver Java class 218
getIntVar member function
IOPLarray COM interface 29
IOPLsolver COM interface 73
OPLarray C++ class 102
OPLarray Java class 178
OPLsolver C++ class 141
OPLsolver Java class 219
getIterator member function
IOPLenum COM interface 37
IOPLset COM interface 58
OPLenum C++ class 111
OPLenum Java class 185
OPLset C++ class 131
OPLset Java class 209
getLast member function
IOPLenum COM interface 37
OPLenum C++ class 111
OPLenum Java class 185
getLastIterationResult member function
IOPLsolver COM interface 73
OPLsolver C++ class 141
OPLsolver Java class 219
getLeft member function
IOPLconstraint COM interface 34
OPLconstraint C++ class 106
OPLconstraint Java class 182
getLhs member function
IOPLconstraint COM interface 34
OPLconstraint C++ class 106
OPLconstraint Java class 182
getLine member function
OPLruntimeError C++ class 127

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

OPLsemanticError C++ class 130


OPLsyntaxError C++ class 157
getLow member function
IOPLarray COM interface 29
IOPLfloatRange COM interface 49
IOPLintRange COM interface 53
OPLarray C++ class 102
OPLarray Java class 178
OPLfloatRange C++ class 120
OPLfloatRange Java class 196
OPLintRange C++ class 124
OPLintRange Java class 199
getMathematicalSolutionStatus member function
IOPLsolver COM interface 74
OPLsolver C++ class 142
OPLsolver Java class 219
getMax member function
IOPLfloatVar COM interface 50
IOPLintVar COM interface 54
OPLfloatVar C++ class 121
OPLfloatVar Java class 197
OPLintVar C++ class 125
OPLintVar Java class 200
getMessage member function
OPLinternalError C++ class 123
OPLruntimeError C++ class 127
OPLsemanticError C++ class 130
OPLsyntaxError C++ class 157
getMin member function
IOPLfloatVar COM interface 50
IOPLintVar COM interface 54
OPLfloatVar C++ class 121
OPLfloatVar Java class 197
OPLintVar C++ class 125
OPLintVar Java class 200
getName member function
IOPLenumValue COM interface 43
OPLenumValue C++ class 114
OPLenumValue Java class 189
getNext member function
IOPLenum COM interface 38
OPLenum C++ class 112
OPLenum Java class 186
getNextc member function
IOPLenum COM interface 38

OPLenum C++ class 112


OPLenum Java class 186
getNumberOfChoicePoints member function
IOPLsolver COM interface 74
OPLsolver C++ class 142
OPLsolver Java class 219
getNumberOfConstraints member function
IOPLsolver COM interface 74
OPLsolver C++ class 142
OPLsolver Java class 219
getNumberOfFails member function
IOPLsolver COM interface 74
OPLsolver C++ class 142
OPLsolver Java class 219
getNumberOfIterations member function
IOPLsolver COM interface 74
OPLsolver C++ class 142
OPLsolver Java class 219
getNumberOfVariables member function
IOPLsolver COM interface 74
OPLsolver C++ class 142
OPLsolver Java class 220
getObjectiveValueFloat member function
IOPLsolver COM interface 74
OPLsolver C++ class 142
OPLsolver Java class 220
getObjectiveValueInt member function
IOPLsolver COM interface 74
OPLsolver C++ class 142
OPLsolver Java class 220
getOrd member function
IOPLenum COM interface 38
OPLenum C++ class 112
OPLenum Java class 186
getPrev member function
IOPLenum COM interface 38
OPLenum C++ class 112
OPLenum Java class 186
getPrevc member function
IOPLenum COM interface 38
OPLenum C++ class 112
OPLenum Java class 186
getReducedCost member function
IOPLfloatVar COM interface 51
OPLfloatVar C++ class 121

238I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

INDEX

OPLfloatVar Java class 197


getReservoir member function
OPLarray C++ class 102
OPLsolver C++ class 143
getRhs member function
IOPLconstraint COM interface 34
OPLconstraint C++ class 106
OPLconstraint Java class 182
getRight member function
IOPLconstraint COM interface 34
OPLconstraint C++ class 107
OPLconstraint Java class 183
getSet member function
IOPLarray COM interface 29
IOPLsetIterator COM interface 61
IOPLsolver COM interface 75
IOPLstruct COM interface 89
OPLarray C++ class 102
OPLarray Java class 179
OPLsetIterator C++ class 133
OPLsetIterator Java class 211
OPLsolver C++ class 143
OPLsolver Java class 220
OPLstruct C++ class 156
OPLstruct Java class 231
getSize member function
IOPLarray COM interface 30
OPLarray C++ class 103
OPLarray Java class 179
getSlack member function
IOPLconstraint COM interface 34
OPLconstraint C++ class 107
OPLconstraint Java class 183
getStart member function
IOPLactivity COM interface 21
OPLactivity C++ class 94
OPLactivity Java class 162
getStateResource member function
OPLarray C++ class 103
OPLsolver C++ class 143
getString member function
IOPLarray COM interface 30
IOPLsetIterator COM interface 61
IOPLstruct COM interface 89
OPLarray C++ class 103

OPLarray Java class 179


OPLsetIterator C++ class 133
OPLsetIterator Java class 211
OPLsolver C++ class 143
OPLsolver Java class 220
OPLstruct C++ class 156
OPLstruct Java class 231
getStruct member function
IOPLarray COM interface 30
IOPLsetIterator COM interface 61
IOPLsolver COM interface 75
IOPLstruct COM interface 89
OPLarray C++ class 103
OPLarray Java class 179
OPLsetIterator C++ class 133
OPLsetIterator Java class 211
OPLsolver C++ class 143
OPLsolver Java class 220
OPLstruct C++ class 156
OPLstruct Java class 231
getTime member function
IOPLsolver COM interface 75
OPLsolver C++ class 143
OPLsolver Java class 220
getUnaryResource member function
OPLarray C++ class 103
OPLsolver C++ class 144
getValue member function
IOPLchar COM interface 32
IOPLenum COM interface 39
IOPLenumValue COM interface 43
IOPLenumVar COM interface 45
IOPLfloat COM interface 48
IOPLfloatVar COM interface 51
IOPLint COM interface 52
IOPLintVar COM interface 54
IOPLstring COM interface 86
OPLchar C++ class 105
OPLchar Java class 181
OPLenum C++ class 112
OPLenum Java class 186
OPLenumValue C++ class 114
OPLenumValue Java class 189
OPLenumVar C++ class 116
OPLenumVar Java class 191

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

OPLfloat C++ class 119


OPLfloat Java class 195
OPLfloatVar C++ class 121
OPLfloatVar Java class 197
OPLint C++ class 122, 198
OPLintVar C++ class 125
OPLintVar Java class 200
OPLstring C++ class 154
OPLstring Java class 229

H
hashCode member function
OPLrequirement Java class 203

I
IlcAltResSet operator
OPLalternativeResource C++ class 95
IlcDiscreteEnergy operator
OPLdiscreteEnergy C++ class 109
IlcDiscreteResource operator
OPLdiscreteResource C++ class 110
IlcFloatVar operator
OPLfloatVar C++ class 121
IlcIntervalActivity operator
OPLactivity C++ class 94
IlcIntVar operator
OPLenumVar C++ class 116
OPLintVar C++ class 125
IlcManager operator
OPLsolver C++ class 152
IlcReservoir operator
OPLreservoir C++ class 126
IlcStateResource operator
OPLstateResource C++ class 153
IlcUnaryResource operator
OPLunaryResource C++ class 158
initializing COM on Windows 137, 215
IOPLactivity COM interface
getDuration member function 21
getEnd member function 21
getStart member function 21
IOPLactivity COM/ActiveX interface 21

IOPLarray COM interface 22


eltActivity member function 24
eltArray member function 24
eltChar member function 25
eltConstraint member function 25
eltEnumValue member function 25
eltEnumVar member function 25
eltFloat member function 25
eltFloatVar member function 26
eltInt member function 26
eltIntVar member function 26
eltSet member function 26
eltString member function 26
eltStruct member function 27
getActivity member function 27
getArray member function 27
getChar member function 27
getClone member function 27
getConstraint member function 28
getEnumValue member function 28
getEnumVar member function 28
getFloat member function 28
getFloatVar member function 29
getHigh member function 29
getInt member function 29
getIntVar member function 29
getLow member function 29
getSet member function 29
getSize member function 30
getString member function 30
getStruct member function 30
IOPLatLower basis status
IOPLbasisStatus COM interface 31
IOPLatUpper basis status
IOPLbasisStatus COM interface 31
IOPLbasisStatus COM interface
IOPLatLower basis status 31
IOPLatUpper basis status 31
IOPLfreeSuper basis status 31
IOPLinBasisr basis status 31
IOPLnoBasis basis status 31
IOPLchar COM interface 32
getClone member function 32
getValue member function 32
setValue member function 32

240I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

INDEX

IOPLconstraint COM interface 33


getBasisStatus member function 34
getDual member function 34
getLeft member function 34
getLhs member function 34
getRhs member function 34
getRight member function 34
getSlack member function 34
IOPLdata abstract COM interface 35
getImpl member function 35
IOPLenum COM interface 36
getCard member function 37
getFirst member function 37
getIterator member function 37
getLast member function 37
getNext member function 38
getNextc member function 38
getOrd member function 38
getPrev member function 38
getPrevc member function 38
getValue member function 39
IOPLenumIterator COM interface 40
get member function 41
next member function 41
ok member function 41
reset member function 41
IOPLenumValue COM interface 42
getClone member function 43
getName member function 43
getValue member function 43
isEqualTo member function 43
isGreaterOrEqualTo member function 43
isGreaterThan member function 44
isNotEqualTo member function 44
isSmallerOrEqualTo member function 44
isSmallerThan member function 44
setValue member function 44
IOPLenumVar COM interface 45
getValue member function 45
IOPLerrorReporter COM interface 46
notifyInternalError member function 47
notifyRuntimeError member function 47
notifyRuntimeWarning member function 47
notifySemanticError member function 47
notifySyntaxError member function 47

IOPLfloat COM interface 48


getClone member function 48
getValue member function 48
setValue member function 48
IOPLfloatRange COM interface 49
getHigh member function 49
getLow member function 49
IOPLfloatVar COM interface 50
getBasisStatus member function 50
getMax member function 50
getMin member function 50
getReducedCost member function 51
getValue member function 51
IOPLfreeSuper basis status
IOPLbasisStatus COM interface 31
IOPLinBasis basis status
IOPLbasisStatus COM interface 31
IOPLint COM interface 52
getClone member function 52
getValue member function 52
setValue member function 52
IOPLintRange COM interface 53
getHigh member function 53
getLow member function 53
IOPLintVar COM interface 54
getMax member function 54
getMin member function 54
getValue member function 54
IOPLnoBasis basis status
IOPLbasisStatus COM interface 31
IOPLscriptSolver COM interface 55
close member function 56
registerCplexLicense member function 56
registerOplLicense member function 56
registerSchedulerLicense m. f. 56
registerSolverLicense member function 56
run member function 56
setDefaultErrorReporterSilent m. f. 57
setErrorReporter member function 57
setIncludePathList member function 57
setOplComponentLogFile member function 57
IOPLset COM interface 58
getClone member function 58
getIterator member function 58

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

IOPLsetIterator COM interface 59


getArray member function 60
getEnumValue member function 60
getFloat member function 60
getInt member function 60
getSet member function 61
getString member function 61
getStruct member function 61
next member function 61
ok member function 62
reset member function 62
IOPLsolver COM interface 63
close member function 69
declareData member function 70
display member function 70
displayOnSolution member function 70
evalOnSolution member function 70
evalSolution member function 70
getActivity member function 70
getArray member function 70
getConstraint member function 71
getEnum member function 71
getEnumValue member function 71
getEnumVar member function 72
getFloat member function 72
getFloatRange member function 72
getFloatVar member function 72
getInt member function 73
getIntRange member function 73
getIntVar member function 73
getLastIterationResult member function 73
getMathematicalSolutionStatus member
function 74
getNumberOfChoicePoints member function 74
getNumberOfConstraints member function 74
getNumberOfFails member function 74
getNumberOfIterations member function 74
getNumberOfVariables member function 74
getObjectiveValueFloat member function 74
getObjectiveValueInt member function 74
getSet member function 75
getStruct member function 75
getTime member function 75
isDualFeasible member function 75
isOptimal member function 75

isPrimalFeasible member function 75


loadCompiledModelBuff member function 76
loadCompiledModelBuffAndDataBuff m. f. 76
loadCompiledModelBuffAndDataFile m. f. 76
loadCompiledModelBuffAndDataFiles m. f. 77
loadCompiledModelFile member function 77
loadCompiledModelFileAndDataBuff m. f. 77
loadCompiledModelFileAndDataFile m. f. 78
loadCompiledModelFileAndDataFiles m. f. 78
loadInterpretedModelBuff member function 78
loadInterpretedModelBuffAndDataBuff 78
loadInterpretedModelBuffAndDataFile 79
loadInterpretedModelBuffAndDataFiles 79
loadInterpretedModelFile member function 79
loadInterpretedModelFileAndDataBuff 80
loadInterpretedModelFileAndDataFile 80
loadInterpretedModelFileAndDataFiles 80
nextSolution member function 80
registerCplexLicense member function 81
registerOplLicense member function 81
registerSchedulerLicense member function 81
registerSolverLicense member function 81
reset member function 81
restore member function 81
setDefaultErrorReporterSilent m. f. 81
setErrorReporter member function 82
setExportFile member function 82
setFailLimitmember function 82
setFloatParameter member function 82
setIntegerParameter member function 82
setOPLComponentLogFile member function 83
setOptimizationStep member function 83
setOrLimit member function 83
setStringLimit member function 83
setTimeLimit member function 83
solve member function 83
stateConstraint member function 83
unsetLimit member function 84
IOPLstring COM interface 86
getClone member function 86
getValue member function 86
setValue member function 86
IOPLstruct COM interface 87
getArray member function 88
getChar member function 88

242I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

INDEX

getClone member function 88


getFloat member function 88
getInt member function 88
getSet member function 89
getString member function 89
getStruct member function 89
isDualFeasible member function
IOPLsolver COM interface 75
OPLsolver C++ class 144
OPLsolver Java class 221
isEqualTo member function
IOPLenumValue COM interface 43
isGreaterOrEqualTo member function
IOPLenumValue COM interface 43
isGreaterThan member function
IOPLenumValue COM interface 44
isNotEqualTo member function
IOPLenumValue COM interface 44
isOptimal member function
IOPLsolver COM interface 75
OPLsolver C++ class 144
OPLsolver Java class 221
isPrimalFeasible member function
IOPLsolver COM interface 75
OPLsolver C++ class 144
OPLsolver Java class 221
isSmallerOrEqualTo member function
IOPLenumValue COM interface 44
isSmallerThan member function
IOPLenumValue COM interface 44

J
Java class
OPLactivity 162
OPLadaptor 166
OPLarray 174
OPLbasisStatus 180
OPLchar 181
OPLconstraint 182
OPLdata 184
OPLenum 185
OPLenumIterator 187
OPLenumValue 189
OPLenumVar 191

OPLerrorReporter 192
OPLexception 194
OPLfloat 195
OPLfloatRange 196
OPLfloatVar 197
OPLint 198
OPLintRange 199
OPLintVar 200
OPLrequirement 202
OPLrulesAdaptor 204
OPLscriptSolver 207
OPLset 209
OPLsetIterator 210
OPLsolver 213
OPLstring 229
OPLstruct 230
OPLsymmetricrequirement 232
Java interface
OPLadaptable 164

L
loadCompiledModelBuff member function
IOPLsolver COM interface 76
OPLsolver C++ class 144
OPLsolver Java class 221
loadCompiledModelBuffAndDataBuff m. f.
IOPLsolver COM interface 76
OPLsolver C++ class 144
OPLsolver Java class 221
loadCompiledModelBuffAndDataFile m. f.
IOPLsolver COM interface 76
OPLsolver C++ class 145
OPLsolver Java class 222
loadCompiledModelBuffAndDataFiles m. f.
IOPLsolver COM interface 77
OPLsolver C++ class 145
OPLsolver Java class 222
loadCompiledModelFile member function
IOPLsolver COM interface 77
OPLsolver C++ class 145
OPLsolver Java class 222
loadCompiledModelFileAndDataBuff m. f.
IOPLsolver COM interface 77
OPLsolver C++ class 145
OPLsolver Java class 222

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

loadCompiledModelFileAndDataFile m. f.
IOPLsolver COM interface 78
OPLsolver C++ class 146
OPLsolver Java class 223
loadCompiledModelFileAndDataFiles m. f.
IOPLsolver COM interface 78
OPLsolver C++ class 146
OPLsolver Java class 223
loadInterpretedModelBuff member function
IOPLsolver COM interface 78
OPLsolver C++ class 146
OPLsolver Java class 223
loadInterpretedModelBuffAndDataBuff m. f.
IOPLsolver COM interface 78
OPLsolver C++ class 146
OPLsolver Java class 223
loadInterpretedModelBuffAndDataFile m. f.
IOPLsolver COM interface 79
OPLsolver C++ class 147
OPLsolver Java class 224
loadInterpretedModelBuffAndDataFiles m. f.
IOPLsolver COM interface 79
OPLsolver C++ class 147
OPLsolver Java class 224
loadInterpretedModelFile member function
IOPLsolver COM interface 79
OPLsolver C++ class 147
OPLsolver Java class 224
loadInterpretedModelFileAndDataBuff m. f.
IOPLsolver COM interface 80
OPLsolver C++ class 147
OPLsolver Java class 224
loadInterpretedModelFileAndDataFile m. f.
IOPLsolver COM interface 80
OPLsolver C++ class 148
OPLsolver Java class 225
loadInterpretedModelFileAndDataFiles m. f.
IOPLsolver COM interface 80
OPLsolver C++ class 148
OPLsolver Java class 225

N
next member function
IOPLenumIterator COM interface 41

IOPLsetIterator COM interface 61


OPLenumIterator C++ class 113
OPLenumIterator Java class 187
OPLsetIterator C++ class 133
OPLsetIterator Java class 211
nextSolution member function
IOPLsolver COM interface 80
OPLsolver C++ class 148
OPLsolver Java class 225
notifyInternalError member function
IOPLerrorReporter COM interface 47
OPLerrorReporter C++ class 117
OPLerrorReporter Java class 193
notifyRuntimeError member function
IOPLerrorReporter COM interface 47
OPLerrorReporter C++ class 117
OPLerrorReporter Java class 193
notifyRuntimeWarning member function
IOPLerrorReporter COM interface 47
notifySemanticError member function
IOPLerrorReporter COM interface 47
OPLerrorReporter C++ class 118
OPLerrorReporter Java class 193
notifySyntaxError member function
IOPLerrorReporter COM interface 47
OPLerrorReporter C++ class 118
OPLerrorReporter Java class 193

O
ok member function
IOPLenumIterator COM interface 41
IOPLsetIterator COM interface 62
OPLenumIterator C++ class 113
OPLenumIterator Java class 187
OPLsetIterator C++ class 134
OPLsetIterator Java class 212
operator!=
OPLenumValue C++ class 115
operator<
OPLenumValue C++ class 115
operator<<
OPLenumValue C++ class 115
operator<=
OPLenumValue C++ class 115

244I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

INDEX

operator==
OPLenumValue C++ class 115
operator>
OPLenumValue C++ class 115
operator>=
OPLenumValue C++ class 115
OPLactivity C++ class 94
getDuration member function 94
getEnd member function 94
getStart member function 94
IlcIntervalActivity operator 94
OPLactivity Java class 162
getDuration member function 162
getEnd member function 162
getStart member function 162
OPLadaptable Java interface 164
formatToOPL member function 164
OPLadaptor Java class 166
format member function 168
formatAsArray member function 168, 169, 170
formatAsEnum member function 170
formatAsEnumValue member function 170
formatAsInt member function 170, 171
formatAsSet member function 171, 172
formatAsString member function 172
formatAsStruct member function 172, 173
OPLalternativeResource C++ class 95
IlcAltResSet operator 95
OPLarray C++ class 96
eltActivity member function 97
eltAlternativeResource member function 97
eltArray member function 97
eltChar member function 97
eltConstraint member function 97
eltDiscreteEnergy member function 98
eltDiscreteResource member function 98
eltEnumValue member function 98
eltEnumVar member function 98
eltFloat member function 98
eltFloatVar member function 98
eltInt member function 99
eltIntVar member function 99
eltReservoir member function 99
eltSet member function 99
eltStateResource member function 99

eltString member function 99


eltStruct member function 100
eltUnaryResource member function 100
getActivity member function 100
getAlternativeResource member function 100
getArray member function 100
getChar member function 100
getClone member function 100
getConstraint member function 101
getDiscreteEnergy member function 101
getDiscreteResource member function 101
getEnumValue member function 101
getEnumVar member function 101
getFloat member function 101
getFloatVar member function 102
getHigh member function 102
getInt member function 102
getIntVar member function 102
getLow member function 102
getReservoir member function 102
getSet member function 102
getSize member function 103
getStateResource member function 103
getString member function 103
getStruct member function 103
getUnaryResource member function 103
OPLarray Java class 174
eltActivity member function 175
eltArray member function 175
eltChar member function 175
eltConstraint member function 175
eltEnumValue member function 175
eltEnumVar member function 175
eltFloat member function 176
eltFloatVar member function 176
eltInt member function 176
eltIntVar member function 176
eltSet member function 176
eltString member function 176
eltStruct member function 177
getActivity member function 177
getArray member function 177
getChar member function 177
getClone member function 177
getConstraint member function 177

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

getEnumValue member function 177


getEnumVar member function 178
getFloat member function 178
getFloatVar member function 178
getHigh member function 178
getInt member function 178
getIntVar member function 178
getLow member function 178
getSet member function 179
getSize member function 179
getString member function 179
getStruct member function 179
OPLatLower basis status
OPLbasisStatus C++ class 104
OPLbasisStatus Java class 180
OPLatUpper basis status
OPLbasisStatus C++ class 104
OPLbasisStatus Java class 180
OPLbasisStatus C++ class 104
OPLatLower basis status 104
OPLatUpper basis status 104
OPLfreeSuper basis status 104
OPLinBasis basis status 104
OPLnoBasis basis status 104
OPLbasisStatus Java class 180
OPLatLower basis status 180
OPLatUpper basis status 180
OPLfreeSuper basis status 180
OPLinBasis basis status 180
OPLnoBasis basis status 180
OPLchar C++ class 105
getClone member function 105
getValue member function 105
setValue member function 105
OPLchar Java class 181
getClone member function 181
getValue member function 181
setValue member function 181
OPLconstraint C++ class 106
getBasisStatus member function 106
getDual member function 106
getLeft member function 106
getLhs member function 106
getRhs member function 106
getRight member function 107
getSlack member function 107

OPLconstraint Java class 182


getBasisStatus member function 182
getDual member function 182
getLeft member function 182
getLhs member function 182
getRhs member function 182
getRight member function 183
getSlack member function 183
OPLdata C++ class 108
getImpl member function 108
OPLdata Java class 184
OPLdiscreteEnergy C++ class 109
IlcDiscreteEnergy operator 109
OPLdiscreteResource C++ class 110
IlcDiscreteResource operator 110
OPLenum C++ class 111
getCard member function 111
getFirst member function 111
getIterator member function 111
getLast member function 111
getNext member function 112
getNextc member function 112
getOrd member function 112
getPrev member function 112
getPrevc member function 112
getValue member function 112
OPLenum Java class 185
getCard member function 185
getFirst member function 185
getIterator member function 185
getLast member function 185
getNext member function 186
getNextc member function 186
getOrd member function 186
getPrev member function 186
getPrevc member function 186
getValue member function 186
OPLenumIterator C++ class 113
get member function 113
next member function 113
ok member function 113
reset member function 113
OPLenumIterator Java class 187
get member function 187
next member function 187

246I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

INDEX

ok member function 187


reset member function 188
OPLenumValue C++ class 114
getClone member function 114
getName member function 114
getValue member function 114
operator!= 115
operator< 115
operator<< 115
operator<= 115
operator== 115
operator> 115
operator>= 115
setValue member function 114
OPLenumValue Java class 189
getClone member function 189
getName member function 189
getValue member function 189
setValue member function 190
OPLenumVar C++ class 116
getValue member function 116
IlcIntVar operator 116
OPLenumVar Java class 191
getValue member function 191
OPLerrorReporter C++ class 117
notifyInternalError member function 117
notifyRuntimeError member function 117
notifySemanticError member function 118
notifySyntaxError member function 118
OPLerrorReporter Java class 192
notifyInternalError member function 193
notifyRuntimeError member function 193
notifySemanticError member function 193
notifySyntaxError member function 193
OPLexception Java class 194
OPLfloat C++ class 119
getClone member function 119
getValue member function 119
setValue member function 119
OPLfloat Java class 195
getClone member function 195
getValue member function 195
setValue member function 195
OPLfloatRange C++ class 120
getHigh member function 120

getLow member function 120


OPLfloatRange Java class 196
getHigh member function 196
getLow member function 196
OPLfloatVar C++ class 121
getBasisStatus member function 121
getMax member function 121
getMin member function 121
getReducedCost member function 121
getValue member function 121
IlcFloatVar operator 121
OPLfloatVar Java class 197
getMax member function 197
getMin member function 197
getReducedCost member function 197
getValue member function 197
OPLfreeSuper basis status
OPLbasisStatus C++ class 104
OPLbasisStatus Java class 180
OPLinBasis basis status
OPLbasisStatus C++ class 104
OPLbasisStatus Java class 180
OPLint C++ class 122
getClone member function 122
getValue member function 122
setValue member function 122
OPLint Java class 198
getClone member function 198
getValue member function 198
setValue member function 198
OPLinternalError C++ class 123
getMessage member function 123
OPLintRange C++ class 124
getHigh member function 124
getLow member function 124
OPLintRange Java class 199
getHigh member function 199
getLow member function 199
OPLintVar C++ class 125
getMax member function 125
getMin member function 125
getValue member function 125
IlcIntVar operator 125
OPLintVar Java class 200
getMax member function 200

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

getMin member function 200


getValue member function 200
OPLnoBasis basis status
OPLbasisStatus C++ class 104
OPLbasisStatus Java class 180
OPLrequirement Java class 202
constructor 203
equals member function 203
formatToOPL member function 203
hashCode member function 203
toString member function 203
OPLreservoir C++ class 126
IlcReservoir operator 126
OPLrulesAdaptor Java class 204
formatAsArray member function 205
formatAsEnum member function 205, 206
formatAsSet member function 206
OPLruntimeError C++ class 127
getLine member function 127
getMessage member function 127
OPLscriptSolver C++ class 128
close member function 128
constructor 128
registerCplexLicense member function 128
registerOplLicense member function 129
registerSchedulerLicense m. f. 129
registerSolverLicense member function 129
run member function 129
setDefaultErrorReporterSilent m. f. 129
setErrorReporter member function 129
setIncludePathList member function 129
setOplComponentLogFile member function 129
OPLscriptSolver Java class 207
close member function 207
constructor 207
registerCplexLicense member function 207
registerOplLicense member function 208
registerSchedulerLicense m. f. 208
registerSolverLicense member function 208
run member function 208
setDefaultErrorReporterSilent m. f. 208
setErrorReporter member function 208
setIncludePathList member function 208, 227
setOplComponentLogFile member function 208

OPLsemanticError C++ class 130


getLine member function 130
getMessage member function 130
OPLset C++ class 131
getClone member function 131
getIterator member function 131
OPLset Java class 209
getClone member function 209
getIterator member function 209
OPLsetIterator C++ class 132
getArray member function 132
getChar member function 132
getEnumValue member function 132
getFloat member function 133
getInt member function 133
getSet member function 133
getString member function 133
getStruct member function 133
next member function 133
ok member function 134
reset member function 134
OPLsetIterator Java class 210
getArray member function 210
getChar member function 210
getEnumValue member function 210
getFloat member function 211
getInt member function 211
getSet member function 211
getString member function 211
getStruct member function 211
next member function 211
ok member function 212
reset member function 212
OPLsolver C++ class 135
close member function 137
constructor 137
declareData member function 138
display member function 138
displayOnSolution member function 138
evalOnSolution member function 138
evalSolution member function 138
getActivity member function 138
getAlternativeResource member function 138
getArray member function 139
getChar member function 139

248I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

INDEX

getConstraint member function 139


getDiscreteEnergy member function 139
getDiscreteResource member function 139
getEnum member function 139
getEnumValue member function 140
getEnumVar member function 140
getFloat member function 140
getFloatRange member function 140
getFloatVar member function 140
getIlcLinOpt member function 141
getIlcSchedule member function 141
getInt member function 141
getIntRange member function 141
getIntVar member function 141
getLastIterationResult member function 141
getMathematicalSolutionStatus member
function 142
getNumberOfChoicePoints member function 142
getNumberOfConstraints member function 142
getNumberOfFails member function 142
getNumberOfIterations member function 142
getNumberOfVariables member function 142
getObjectiveValueFloat member function 142
getObjectiveValueInt member function 142
getReservoir member function 143
getSet member function 143
getStateResource member function 143
getString member function 143
getStruct member function 143
getTime member function 143
getUnaryResource member function 144
IlcManager operator 152
isDualFeasible member function 144
isOptimal member function 144
isPrimalFeasible member function 144
loadCompiledModelBuff member function 144
loadCompiledModelBuffAndDataBuff m. f. 144
loadCompiledModelBuffAndDataFile m. f. 145
loadCompiledModelBuffAndDataFiles 145
loadCompiledModelFile m. f. 145
loadCompiledModelFileAndDataBuff m. f. 145
loadCompiledModelFileAndDataFile m. f. 146
loadCompiledModelFileAndDataFiles 146
loadInterpretedModelBuff m. f. 146
loadInterpretedModelBuffAndDataBuff 146

loadInterpretedModelBuffAndDataFile 147
loadInterpretedModelBuffAndDataFiles
147
loadInterpretedModelFile m. f. 147
loadInterpretedModelFileAndDataBuff 147
loadInterpretedModelFileAndDataFile 148
loadInterpretedModelFileAndDataFiles
148
nextSolution member function 148
registerCplexLicense member function 148
registerOplLicense member function 148
registerSchedulerLicense m. f. 148
registerSolverLicense member function 149
reset member function 149
restore member function 149
setErrorReporter member function 149
setExportFile member function 149
setFailLimit member function 149
setFloatParameter member function 150
setIncludePathList member function 150
setIntegerParameter member function 150
setObjFloatValueMax member function 150
setObjFloatValueMin member function 150
setObjValueMax member function 150
setObjValueMin member function 150
setOPLComponentLogFile member function 150
setOptimizationStep member function 150
setOrLimit member function 151
setStringParameter member function 151
setTimeLimit member function 151
solve member function 151
stateConstraint member function 151
unsetLimit member function 151
OPLsolver COM interface
setIncludePathList member function 82
OPLsolver Java class 213
close member function 216
constructor 215
declareData member function 216
display member function 216
displayOnSolution member function 216
evalOnSolution member function 216
evalSolution member function 216
getActivity member function 216
getArray member function 217

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

getChar member function 217


getConstraint member function 217
getEnum member function 217
getEnumValue member function 217
getEnumVar member function 217
getFloat member function 218
getFloatRange member function 218
getFloatVar member function 218
getInt member function 218
getIntRange member function 218
getIntVar member function 219
getLastIterationResult member function 219
getMathematicalSolutionStatus member
function 219
getNumberOfChoicePoints member function 219
getNumberOfConstraints member function 219
getNumberOfFails member function 219
getNumberOfIterations member function 219
getNumberOfVariables member function 220
getObjectiveValueFloat member function 220
getObjectiveValueInt member function 220
getSet member function 220
getString member function 220
getStruct member function 220
getTime member function 220
isDualFeasible member function 221
isOptimal member function 221
isPrimalFeasible member function 221
loadCompiledModelBuff member function 221
loadCompiledModelBuffAndDataBuff m. f. 221
loadCompiledModelBuffAndDataFile m. f. 222
loadCompiledModelBuffAndDataFiles 222
loadCompiledModelFile m. f. 222
loadCompiledModelFileAndDataBuff m. f. 222
loadCompiledModelFileAndDataFile m. f. 223
loadCompiledModelFileAndDataFiles 223
loadInterpretedModelBuff m. f. 223
loadInterpretedModelBuffAndDataBuff 223
loadInterpretedModelBuffAndDataFile 224
loadInterpretedModelBuffAndDataFiles
224
loadInterpretedModelFile m. f. 224
loadInterpretedModelFileAndDataBuff 224
loadInterpretedModelFileAndDataFile 225

loadInterpretedModelFileAndDataFiles
225
nextSolution member function 225
registerCplexLicense member function 225
registerOplLicense member function 225
registerSchedulerLicense m. f. 225
registerSolverLicense member function 226
reset member function 226
restore member function 226
setErrorReporter member function 226
setExportFile member function 226
setFailLimit member function 226
setFloatParameter member function 227
setIntegerParameter member function 227
setOPLComponentLogFile member function 227
setOptimizationStep member function 227
setOrLimit member function 227
setStringParameter member function 227
setTimeLimit member function 227
solve member function 228
stateConstraint member function 228
unsetLimit member function 228
OPLstateResource C++ class 153
IlcStateResource operator 153
OPLstring C++ class 154
getClone member function 154
getValue member function 154
setValue member function 154
OPLstring Java class 229
getClone member function 229
getValue member function 229
setValue member function 229
OPLstruct C++ class 155
getArray member function 155
getChar member function 155
getClone member function 155
getEnumValue member function 155
getFloat member function 156
getInt member function 156
getSet member function 156
getString member function 156
getStruct member function 156
OPLstruct Java class 230
getArray member function 230
getChar member function 230

250I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

INDEX

getClone member function 230


getEnumValue member function 230
getFloat member function 231
getInt member function 231
getSet member function 231
getString member function 231
getStruct member function 231
OPLsymmetricRequirement Java class
constructor 232
equals member function 232
OPLsymmetricrequirement Java class 232
OPLsyntaxError C++ class 157
getLine member function 157
getMessage member function 157
OPLunaryResource C++ class 158
IlcUnaryResource operator 158

R
registerCplexLicense member function
IOPLscriptSolver COM interface 56
IOPLsolver COM interface 81
OPLscriptSolver C++ class 128
OPLscriptSolver Java class 207
OPLsolver C++ class 148
OPLsolver Java class 225
registerOplLicense member function
IOPLscriptSolver COM interface 56
IOPLsolver COM interface 81
OPLscriptSolver C++ class 129
OPLscriptSolver Java class 208
OPLsolver C++ class 148
OPLsolver Java class 225
registerSchedulerLicense member function
IOPLscriptSolver COM interface 56
IOPLsolver COM interface 81
OPLscriptSolver C++ class 129
OPLscriptSolver Java class 208
OPLsolver C++ class 148
OPLsolver Java class 225
registerSolverLicense member function
IOPLscriptSolver COM interface 56
IOPLsolver COM interface 81
OPLscriptSolver C++ class 129
OPLscriptSolverJava class 208

OPLsolver C++ class 149


OPLsolver Java class 226
reset member function
IOPLenumIterator COM interface 41
IOPLsetIterator COM interface 62
IOPLsolver COM interface 81
OPLenumIterator C++ class 113
OPLenumIterator Java class 188
OPLsetIterator C++ class 134
OPLsetIterator Java class 212
OPLsolver C++ class 149
OPLsolver Java class 226
restore member function
IOPLsolver COM interface 81
OPLsolver C++ class 149
OPLsolver Java class 226
run member function
IOPLscriptSolver COM interface 56
OPLscriptSolver C++ class 129
OPLscriptSolver Java class 208

S
setDefaultErrorReporterSilent member function
IOPLscriptSolver COM interface 57
IOPLsolver COM interface 81
OPLscriptSolver C++ class 129
OPLscriptSolverJava class 208
setErrorReporter member function
IOPLscriptSolverCOM interface 57
IOPLsolver COM interface 82
OPLscriptSolver C++ class 129
OPLscriptSolver Java class 208
OPLsolver C++ class 149
OPLsolver Java class 226
setExportFile member function
IOPLsolver COM interface 82
OPLsolver C++ class 149
OPLsolver Java class 226
setFailLimit member function
IOPLsolver COM interface 82
OPLsolver C++ class 149
OPLsolver Java class 226
setFloatParameter member function
IOPLsolver COM interface 82

ILOG OPL STUDIO 3.7 COMPONENT LIBRARIES REFERENCE MANUAL

INDEX

OPLsolver C++ class 150


OPLsolver Java class 227
setIncludePathList member function
IOPLscriptSolver COM interface 57, 82
OPLscriptSolver C++ class 129, 150
OPLscriptSolver Java class 208, 227
setIntegerParameter member function
IOPLsolver COM interface 82
OPLsolver C++ class 150
OPLsolver Java class 227
setObjFloatValueMax member function
OPLsolver C++ class 150
setObjFloatValueMin member function
OPLsolver C++ class 150
setObjValueMax member function
OPLsolver C++ class 150
setObjValueMin member function
OPLsolver C++ class 150
setOPLComponentLogFile member function
IOPLsolver COM interface 83
OPLsolver C++ class 150
OPLsolver Java class 227
setOplComponentLogFile member function
IOPLscriptSolver COM interface 57
OPLscriptSolver C++ class 129
OPLscriptSolverJava class 208
setOptimizationStep member function
IOPLsolver COM interface 83
OPLsolver C++ class 150
OPLsolver Java class 227
setOrLimit member function
IOPLsolver COM interface 83
OPLsolver C++ class 151
OPLsolver Java class 227
setStringLimit member function
IOPLsolver COM interface 83
setStringParameter member function
OPLsolver C++ class 151
OPLsolver Java class 227
setTimeLimit member function
IOPLsolver COM interface 83
OPLsolver C++ class 151
OPLsolver Java class 227
setValue member function
IOPLchar COM interface 32

IOPLenumValue COM interface 44


IOPLfloat COM interface 48
IOPLint COM interface 52
IOPLstring COM interface 86
OPLchar C++ class 105
OPLchar Java class 181
OPLenumValue C++ class 114
OPLenumValue Java class 190
OPLfloat C++ class 119
OPLfloat Java class 195
OPLint C++ class 122
OPLint Java class 198
OPLstring C++ class 154
OPLstring Java class 229
solve member function
IOPLsolver COM interface 83
OPLsolver C++ class 151
OPLsolver Java class 228
stateConstraint member function
IOPLsolver COM interface 83
OPLsolver C++ class 151
OPLsolver Java class 228

T
toString member function
OPLrequirement Java class 203
typographic conventions 8

U
unsetLimit member function
IOPLsolver COM interface 84
OPLsolver C++ class 151
OPLsolver Java class 228

252I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

Das könnte Ihnen auch gefallen