Beruflich Dokumente
Kultur Dokumente
7
Component Libraries Reference Manual
September 2003
Contents
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
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
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
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
(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).
its description
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
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 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.
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
Japan
oplstudio-support@ilog.jp
North America
oplstudio-support@ilog.com
1-877-ILOG-TECH
(toll free)
Singapore
+65 773 04 39
Spain
oplstudio-support@ilog.es
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
http://www.ilog.com.sg
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
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");
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
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);
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
model.
IDL Synopsis
C++ Synopsis
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
IDL Synopsis
};
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
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
*i, IOPLset
* *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
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
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
C++ Synopsis
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);
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
IDL Synopsis
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
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
C++ Synopsis
* *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
IDL Synopsis
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
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
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
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
C++ Synopsis
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
IDL Synopsis
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
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
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
IDL Synopsis
C++ Synopsis
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
C++ Synopsis
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
IDL Synopsis
C++ Synopsis
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
IDL Synopsis
C++ Synopsis
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
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
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
IDL Synopsis
C++ Synopsis
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
IDL Synopsis
C++ Synopsis
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
IDL Synopsis
C++ Synopsis
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
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
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);
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
C++ Synopsis
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
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
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
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
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();
};
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
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
C++ Synopsis
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
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
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
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
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 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
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
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
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
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
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
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
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
C++ Synopsis
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
IDL Synopsis
C++ Synopsis
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
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
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
Include File
<ilopl/component.h>
Synopsis
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
Include File
<ilopl/component.h>
Synopsis
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
Include File
<ilopl/component.h>
Synopsis
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
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
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
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
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
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
Member Functions
char getValue();
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
Include File
<ilopl/component.h>
Synopsis
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
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
Include File
<ilopl/component.h>
Synopsis
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
Include File
<ilopl/component.h>
Synopsis
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
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
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
Include File
<ilopl/component.h>
Synopsis
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
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
Include File
<ilopl/component.h>
Synopsis
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
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
Include File
<ilopl/oplcomponent.h>
Synopsis
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
Include File
<ilopl/oplcomponent.h>
Synopsis
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
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
Include File
<ilopl/oplcomponent.h>
Synopsis
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
<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
Include File
<ilopl/oplcomponent.h>
Synopsis
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
Include File
<ilopl/oplcomponent.h>
Synopsis
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
Include File
<ilopl/oplcomponent.h>
Synopsis
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
<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
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
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);
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
<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
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)
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
Constructor
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
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
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
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 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
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
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
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
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);
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
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
Include File
<ilopl/oplcomponent.h>
Synopsis
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
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
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
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
<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
Include File
<ilopl/oplcomponent.h>
Synopsis
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
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.
OPLactivity
OPLactivity
Category
Java class
Inheritance Path
OPLdata
Description
Package
ilog.opl.engine;
Synopsis
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
Package
ilog.opl.engine;
Synopsis
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
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
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
Member Functions
public static final void format(StringBuffer buffer,
String name,
Object object,
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
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
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
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);
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 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
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
Package
ilog.opl.engine;
Synopsis
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
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
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
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
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
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
Member Functions
public final short getValue();
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
Package
ilog.opl.engine;
Synopsis
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
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
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
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
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
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
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
Package
ilog.opl.engine;
Synopsis
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
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
Package
ilog.opl.engine;
Synopsis
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
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();
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
Package
ilog.opl.engine;
Synopsis
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
Package
ilog.opl.engine;
Synopsis
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
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
Package
ilog.opl.engine;
Synopsis
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
Package
ilog.opl.engine;
Synopsis
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
Package
ilog.opl.engine;
Synopsis
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
Package
ilog.opl.engine;
Synopsis
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
object2);
object2,
object2,
object4);
object2,
object4,
object2,
object4,
object6);
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();
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
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);
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);
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
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
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
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);
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
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
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
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
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
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
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
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
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
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
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 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
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
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
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
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
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);
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
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
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
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
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
Package
ilog.opl.engine;
Synopsis
Constructor
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
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
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
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
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
INDEX
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
INDEX
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
INDEX
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
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
INDEX
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
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
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
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
INDEX
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
INDEX
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
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
INDEX
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
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
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
INDEX
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