Skip to content

GAMS-dev/gams-mii

Repository files navigation

GAMS Model Instance Inspector (MII)

GAMS Model Instance Inspector (MII) is a system to examine the structure and properties of a model instance generated by the General Algebraic Modeling System (GAMS). It is strongly inspired by the tool GAMSCHK developed by Bruce McCarl. For further information about GAMS please visit GAMS or the GAMS documentation.

How To Get Started

Before the MII is downloaded and installed please make sure that GAMS is installed. Details on how to install GAMS can be found on the download page. Please make sure that the PATH variable is set during the GAMS installation. If this is not done on your system you have to copy the MII to the GAMS system directory. Details on adding GAMS to the path can be found in the GAMS documentation.

When GAMS has been successfully installed the MII needs to be downloaded. All the MII releases can be found on GitHub, but the recommendation is that the latest version is used.

Now the MII needs to be installed. If you did not add GAMS to the PATH please copy/move the MII to the GAMS system directory; otherwise our recommendations are

  • Windows
    • Extract the archive, e.g. GAMS_MII-0.4.9-x86_64.zip
    • Move the MII directory to your prefered location.
    • Navigate into the directory and run the mii.exe
  • Linux
    • Move the AppImage (GAMS_MII-0.4.9-x86_64.AppImage) to your prefered location
    • Make the AppImage executable: chmod +x GAMS_MII-0.4.9-x86_64.AppImage
    • Run the MII: ./GAMS_MII-0.4.9-x86_64.AppImage
  • macOS x86 (Intel)
    • Open the dmg, e.g. GAMS_MII-0.4.9-x86_64.dmg
    • Run the MII by double clicking on the MII icon
  • macOS M (ARM)
    • Open the dmg, e.g. GAMS_MII-0.4.9-arm_64.dmg
    • Run the MII by double clicking on the MII icon

How to use

There are two ways to use the MII to inspect a model instance:

  1. Select the .gms file to execute in the MII and hit the Run button.
    • This will run the selected .gms file with some required command line parameter and the data of the last model instance in that file will be openend for inspection.
  2. Select gamscntr.dat from a scratch directory of a model that was executed already and hit the Run button.
    • This does not run the model again but just opens the given data for inspection.
    • The easiest way to generate such a scratch directory is to execute a .gms file with the command line parameter MIIMode.

How to build

1. Download and install Qt

The recommended way to get Qt is via its official Qt online installer. If you are interested in the Qt sources you can download them through the installer or build Qt from scratch by following the Qt documentation. Alternatively, you can get and build Qt from the official Qt GitHub mirror.

2. Download and install GAMS

The GAMS Model Instance Inspector requires the GAMS low-level APIs. All those files are provided by the GAMS distribution packages, which are available for all major platforms. The installation package for your platform can be obtained from the GAMS download page. After downloading the package please follow the latest GAMS installation instructions.

Note By default GAMS will run in demo mode. Please check the download page for further details.

3. Get the GAMS Model Instance Inspector source code

Download the GAMS Model Instance Inspector sources from GitHub (via git or as zip archive). All information about the usage of this program can be found within the GAMS Documentation.

4. Building the GAMS Model Instance Inspector project

Start Qt Creator, open the project file model-inspector.pro and click Build -> Run qmake. This generates the file gamsinclude.pri that defines the default location of the GAMS installation location. The path within the gamsinclude.pri may have to be updated to the correct GAMS installation location on your system.

On Windows the file contains:

GAMS_DISTRIB=C:/GAMS/47
GAMS_DISTRIB_C_API=$$GAMS_DISTRIB/apifiles/C/api
GAMS_DISTRIB_CPP_API=$$GAMS_DISTRIB/apifiles/C++/api

On Unix it will look like:

GAMS_DISTRIB=$$(HOME)/gams/gams47.1_linux_x64_64_sfx
GAMS_DISTRIB_C_API=$$GAMS_DISTRIB/apifiles/C/api
GAMS_DISTRIB_CPP_API=$$GAMS_DISTRIB/apifiles/C++/api

Then perform a Build All operation (Build -> Build All) to build the project. Finally, the GAMS Model Instance Inspector can be executed by triggering Run button or pressing Ctrl + R.

Contributing

Your contributions to the GAMS Model Instance Inspector project are highly appreciated! Depending on your type of improvement you may want to create an issue or fork GAMS Model Instance Inspector and open a pull request when your changes are ready.

Before you request a review of your changes please make sure that you used the latest GAMS release for development and that your code is following the Qt Coding Style.

Dependencies and Licenses

Dependency License Description
Qt 6 LGPL Qt Licensing. The Qt 6 everywhere package (source) can be downloaded from GAMS or directly from https://www.qt.io/download, where installers are provided as well.
dtoaLoc License