GAMS Model Reader Object
Systems and Computer Engineering
Carleton
University
Ottawa,
Canada
GAMS is a popular language for
describing mathematical programs – see http://www.gams.com/
for further information. The GAMS developers
provide routines for connecting solvers to the GAMS system, however, it still
requires significant programming effort and knowledge to make the interface
work smoothly. We have simplified this
task by creating an object wrapper for the interface routines. This allows programmers to simply reference
the associated GAMS Model Reader object in their code, thereby exposing the
properties of the model and providing a set of useful methods.
Exposed properties include the
names of variables, constraints and objectives, variable bounds, constraint
types, etc. Methods include the ability
to calculate the value of a constraint or objective at a given point, ability
to return gradients at a point, etc.
The properties and methods exposed by the object can be conveniently
viewed via the object browser in the programming development environment.
The object also simplifies other
programming tasks. For example, an
appropriate dialog box is provided when the user wishes to locate a GAMS model.
Two items are provided here:
- The GAMS Model Reader object. Two versions are available: a COM
object, and a .NET object. The
appropriate version should be downloaded and installed on your system.
- The source code for a demonstration program that
shows how to use the object. Two
versions are available: VB6 and VB.NET.
Read the help file after download to see how to attach the GAMS
Model Reader object to the demonstration program so that it will run.
Version History
- Revised
COM and .NET objects version 1.1 released December 15, 2003. No change in functionality, just
changes to ensure compatibility with new GAMS release 21.3.
- COM
and .NET objects version 1.1 released October 30, 2003
- COM
and .NET objects version 1.0 released August 27, 2003.
Download and Installation
The full-featured software is available for free
download. Instructions:
- Permission
to use the object is not needed, but as a courtesy, please email the author to indicate
that you are will be using it, and to be notified when new releases are
available.
- If you
use the object as part of your own software project, please acknowledge
the source.
Notes
·
The GAMS system must be installed on your system for
the reader to work. GAMS is used to
convert the model statements into the scratch files which are read by the model
reader. During first use of the reader
you will be prompted to indicate where the gamskeep.exe file is located – this
file is included with the GAMS distribution.
·
If you are
using GAMS versions 21.0 or 21.1, then it is necessary to install the MPECDUMP
update from http://www.gams.com/update/.
See here
for installation procedures.
COM Object
- The
installation files are WinZipped.
First unzip the files into an installation directory.
- Run
setup.exe. Choose a different
directory as the installation target.
- The
required files scrrun.dll and msvcrt.dll are not included in the package
because they frequently cause installation difficulties. Omitting them is
not a problem on most systems, however, if your system complains:
- More
information on the scrrun.dll problem is available at http://support.microsoft.com/default.aspx?scid=kb;en-us;Q254166,
including a downloadable version of scrrun.dll if needed.
- Msvcrt.dll
is already installed on the newer windows operating systems, so you
should not need it. If it is not
already installed on your system, you may be able to download it from the
Microsoft web site.
- The
final result of running the installation is a DLL by the name of
GAMSfileReader.dll.
- Once
installed on your computer, you will need to make a reference to the
object in your development environment in order to use it. For example, in Visual Basic, you need
to open the dialog box under Project|References and then check the box
next to “GAMSfileReader”
.NET Object
- Download
GAMS Model Reader .NET object
- The
installation files are WinZipped.
First unzip the files into and installation directory.
- Run
setup.exe. Choose a different
directory as the installation target.
- The
final result of running the installation is a .NET DLL by the name of
GAMSFileReaderNET.dll located in the target directory.
- Download
source for VB demo program
- To
run the demonstration program, open the project on your computer and then
add the reference to the GAMSFileReaderNET.dll. In Visual Basic .NET this is done by opening the dialog box
under Project|References and following the instructions. Also copy the
necessary files from the installation directory into the /bin directory as
instructed in the readme.txt file.
Authors
Last
update: January 22, 2004.