48.1.0 (October 2024)
- Added new value KEEP_FILES_ON_ERROR to GAMSGlobals.DebugLevel which keeps temporary files only in case of an error when executing GAMS during GAMS.GAMSJob.run or GAMSJob.runEngine. Its internal numerical value is
1
and all values for GAMSGlobals.DebugLevel or greater have been increased by 1. The value KEEP_FILES_ON_ERROR is also a new default value of GAMSGlobals.DebugLevel and is added to Java API that works with both Java SE 8 and Java from SE 11 on.
47.1.0 (June 2024)
- Fixed
GAMSOptions.setOptDir
property used with GAMSModelInstance.instantiate having no effect in GAMSModelInstance.solve for classes that work with both Java SE 8 and Java from SE 11 on. - Changed the behavior of DebugLevel.ShowLog to use logOption=4 instead of
3
internally when executing GAMS for classes that work with both Java SE 8 and Java from SE 11 on.
44.1.0 (July 2023)
- Added method
runEngine
toGAMSJob
class to run jobs on GAMS Engine, only for classes that work with Java SE 11 or later. - since GAMS 44.1.0
- all classes in
GAMSJavaAPI.jar
require Java SE 11 or later to run.GAMSJavaAPI.jar
has additional dependency onjson-simple-1.1.1.jar
.GAMSJavaAPI.jar
andjson-simple-1.1.1.jar
are required to be in the same directory to run. - all classes that work with Java SE 8 are in
GAMSJavaAPI-8.jar
but without updated functionalities that are released after GAMS 43. Only corrective maintenance support will be provided for this version in the future. - all jar files are located under the
[Path/To/GAMS]/apifiles/Java/api/
directory.
- all classes in
43.1.0 (April 2023)
- GAMSModelInstance of this version is no longer compatible with GAMS 33 or older.
39.1.0 (April 2022)
- Added
GAMSSet.getSetType
returning property to distinguish betweenmulti
andsingleton
sets. - Added
GAMSDatabase.addSet
allowing to set type of Set. - Fixed defined enumerated value for options FDOpt and DumpOpt.
35.1.0 (April 2021)
- Fixed
GAMSOptions.setOutput
parameter being ignored inGAMSJob.run()
.
32.1.0 (July 2020)
- On windows platform, change of window registry configuration used for finding the installed GAMS directory from:
[HKEY_CURRENT_USER|HKEY_CLASSES_ROOT]\gams.location
to:[HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE]\Software\Classes\gams.location
, effective only when the installed GAMS directory is not found from "PATH" environment variable.
29.1.0 (November 2019)
- Increase the minimum version requirement of the Java Runtime Environment to Java SE 8.
- The remove operation GAMSDatabaseIterator.remove is no longer supported. The method now throws an instance of
java.lang.UnsupportedOperationException
and performs no other actions. (To remove all records of the current iterating symbol, use the method GAMSSymbol.clear instead.) - Fixed the behavior of the remove operation GAMSSymbolIterator.remove. The method now removes all records of the last GAMSSymbol element returned by an instance of GAMSSymbolIterator and can be called only once per call to GAMSSymbolIterator.next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling the method.
28.2.0 (August 2019)
- Added new method GAMSSymbolRecord.dispose for on-demand release of external resources hold by non-java library.
28.1.0 (August 2019)
- Announced a plan to increase the minimum version requirement of the Java Runtime Environment to Java SE 8 with the next major release.
25.1.1 (May 2018)
- Changed the naming scheme of a temporary working directory to be created from
yyyyMMdd_HHmmss
to the prefixedgams_
(defined byGAMSGlobals.workingDirectoryPrefix
), in case no working directory has been specified. - Fixed the behavior when GAMSDatabase is added with the name that already exists, now GAMSException will be raised. (see GAMSWorkspace.addDatabase(String databaseName) and GAMSWorkspace.addDatabaseFromGDX(String gdxFileName, String databaseName))
- Calls on
GAMSWorkspace.finalize
andGAMSSymbolIterator.finalize
are no longer available. As calling a finalizer method can arbitrarily delay the reclamation of object instances and potentially create unpredictable outcome. Whenever the object is no longer needed it is recommened to explicitly dispose the object rather than to rely on the Java garbage collector to do the job. See GAMSDatabase.dispose, GAMSModelInstance.dispose, and GAMSOptions.dispose. - All Java native interfaces to Expert-Level APIs are now included in the distributed
GAMSJavaAPI.jar
, located under the[Path/To/GAMS]/apifiles/Java/api/
directory.
25.0.1 (January 2018)
- The minimum version requirement of Java Runtime Environment for using with GAMS Java API is now Java SE 7.
- New
TransportGDX
example to demonstrate how to import and export GDX files. - Removed
GAMSSymbol.compact
, deprecated since 24.8.1 (December 2016). Changed equivalence behavior of
GAMSSymbol
andGAMSSymbolRecord
objects. As a result, two symbol objects with the same internal reference are now equivalent, similar to symbol record objects:- Two symbols are equivalent if and only if they have the same internal reference.
- Two symbol records are equivalent if and only if they have the same internal reference.
The behavior of operator
==
remains unchanged. The following exmaple illustrates the new equivalence behavior:GAMSVariable x1 = db.getVariable("x");GAMSVariable x2 = db.getVariable("x");GAMSVariable x3 = x1;assertTrue(x1.equals(x2)); // true, previously falseassertFalse(x1 == x2); // false, previously falseassertTrue(x1.equals(x3)); // true, previously trueassertTrue(x1 == x3); // true, previously trueGamsWorkspace db
24.8.1 (December 2016)
- Deprecated
GAMSSymbol.compact
and the method will be removed in the next major release - an exception or an error thrown by GAMSWorkspace.finalize and GAMSSymbolIterator.finalize now must be caught or declared to be thrown. Note that an explicit call on one of these two methods is not recommended unless it is necessary to do so.
24.7.4 (September 2016)
- GAMSModelInstance.instantiate: Skip creation of GDX file, which was unreachable from within the API anyway
24.7.1 (March 2016)
- Fixed a bug with the property GAMSOptions.defines : When too many entries were added, all of them were ignored.
24.5.1 (August 2015)
- New examples
- Clad at
[Path/To/GAMS]/apifiles/Java/clad/Clad.java
- SpecialValues at
[Path/To/GAMS]/apifiles/Java/specialvalues/SpecialValues.java
- Clad at
- New functions GAMSWorkspace.addJobFromApiLib and GAMSWorkspace.addJobFromNoaLib that can be used to retrieve models from GAMS API Library and Nonlinear Optimization Applications Library.
24.4.2 (March 2015)
- New property GAMSSymbol.getDomainsAsStrings: get domains of symbol, each element is a string
Note: If the domain is an alias in GAMS, this call will return the name of the alias, not the name of the aliased set. - Disable unwanted debug output from Couenne when running with GAMSModelInstance
- Change naming scheme of gdx oputput scratch file to sequence number.
24.4.1 (December 2014)
- Modify the handling of GAMS Aliases in the object oriented APIs:
- If we ask for the number of GAMSSymbol in a GAMSDatabase, the Aliases will be excluded.
- If we iterate over all GAMSSymbol in a GAMSDatabase, Aliases will be skipped.
- If we ask explicitly for an Alias in a GAMSDatabase (GAMSDatabase.getSet("a") with a being an Alias) we will get a reference to the GAMSSet referenced by the Alias, not the Alias itself.
- Note:
- Aliases can appear in a GAMSDatabase only, if it was initialized by a GDX file containing an Alias.
- The new example Alias at
[Path/To/GAMS]/apifiles/Java/alias/Alias.java
demonstrates this new behavior.
24.3.3 (September 2014)
Fixed
- a location of listing file when creating a job from (full-path) file without giving a job name
24.3.2 (August 2014)
- Make more GAMS options available through the GAMSOptions class:
- GAMSOptions.EAppendExpand (enum,
getter
, andsetter
): Expand file append option - GAMSOptions.EAppendOut (enum,
getter
, andsetter
): Output file append option - GAMSOptions.EDumpOpt (enum,
getter
, andsetter
): Writes preprocessed input to the file input.dmp - GAMSOptions.EDumpParms (enum,
getter
, andsetter
): GAMS parameter logging - GAMSOptions.EErrMsg (enum,
getter
, andsetter
): Placing of compilation error messages - GAMSOptions.EAppendExpand (
getter
, andsetter
): Expanded (include) input file name - GAMSOptions.FErr (
getter
, andsetter
): Alternative error message file - GAMSOptions.JobTrace (
getter
, and sette): Job trace string to be written to the trace file at the end of a Gams job - GAMSOptions.LimCol (
getter
, andsetter
): Maximum number of columns listed in one variable block - GAMSOptions.LimRow (
getter
, andsetter
): Maximum number of rows listed in one equation block - GAMSOptions.ELogLine (enum,
getter
, andsetter
): Amount of line tracing to the log file - GAMSOptions.EOn115 (enum,
getter
, andsetter
): Generate errors for unknown unique element in an equation - GAMSOptions.Output (
getter
, andsetter
): Output file - GAMSOptions.EPageContr (enum,
getter
, andsetter
): Output file page control option - GAMSOptions.PageSize (
getter
, andsetter
): Output file page size (=0
no paging) - GAMSOptions.PageWidth (
getter
, andsetter
): Output file page width - GAMSOptions.Reference (
getter
, andsetter
): Symbol reference file - GAMSOptions.ScriptExit (
getter
, andsetter
): Program or script to be executed at the end of a GAMS run - GAMSOptions.ESuppress (enum,
getter
, andsetter
): Compiler listing option - GAMSOptions.Symbol (
getter
, andsetter
): Symbol table file - GAMSOptions.TraceLevel (
getter
, andsetter
): Solvestat threshold used in conjunction witha=GT
- GAMSOptions.EAppendExpand (enum,
24.3.1 (July 2014)
New
- Transport14 example at
[Path/To/GAMS]/apifiles/Java/transport/Transport14.java
. - GAMSSymbolRecord.getKey method: to retrieve key of GAMSWorkspace on specified position index.
Changed
- no longer necessary to set up environment variable before running a program
- possible to specify the GAMS system directory during run time using GAMSWorkspaceInfo.setSystemDirectory(String directory) and GAMSWorkspace(GAMSWorkspaceInfo info)
- no longer necessary to specify
-Djava.library.path
when running a program- if
java.library.path
is specified, the shared libraries will be loaded fromjava.library.path
- otherwise the shared libraries will be loaded from the class path that contains
GAMSJavaAPI.jar
.
- if
- when exporting a database to GDX: a symbol with real domains from now on will be registered
- in GAMSJob.run : always creates output database
OutDB
even if GAMSExecutionException has been raised. - in GAMSSymbol.copySymbol when copy into the Universe symbol (GAMSDatabase.getSet("*")) of a GAMSDatabase : merge operation will be performed.
- in GAMSWorkspace default constructor: API will apply the default setting, that is, finding GAMS system directory from environment variable in the following order (depends on the target platform):
- Windows: first from
PATH
environment variable. If not found, from the platform windows registrygams.location
, - macOS: first from
PATH
environment variable. If not found, fromDYLD_LIBRARY_PATH
, - Unix: from
PATH
environment variable. If not found, fromLD_LIBRARY_PATH
.
- Windows: first from
- in non-default GAMSWorkspace constructor:
- user can specify a GAMS system directory during run time, API will not search for a GAMS system directory from an environment variable.
- in case the specified system directory is null or user speicify other workspace attributes but a system directory, API will apply the default setting (see changed in GAMSWorkspace default constructor above).
Fixed
- API memory leak issue in GAMSDatabaseIterator.
- a bug when reading an option file on Unix platform with non-standard locale
Removed
- all deprecated classes and methods since 24.1.
24.2.3 (May 2014)
Fixed
- API memory leak issue in GAMSDatabase.
- a bug in GAMSDatabase.getDatabaseDomainViolations.
24.2.2 (March 2014)
Changed
- null string is treated as an invalid key for all record operations of GAMSSymbol.
Fixed
- a bug when creating GAMSDatabase from source database.
- a bug when initializing a variable type in GAMSVariable.
- a bug in GAMSSymbol: methods getVarType and getEquType.
- a bug in GAMSWorkspaceInfo : method getSystemDirectory.
- exit codes in GAMSGlobals.ExitCodeMessage. Improved
- GAMSModelInstance.instantiate: make sure that the method does not solve the model, but only prepares everything required for the following GAMSModelInstance.solve.
24.2.1 (December 2013)
New
- tutorial: (
GAMS_java_Tutorial.pdf
) under<Path/To/GAMS>/docs/API
. From the GAMSIDE this document can be accessed at Help -> Docs -> API. - method in GAMSGlobals.SpecialValues : setValue, to set a GAMS special value
- method in GAMSOptions: export, to write an option into a parameter file
- methods in GAMSWorkspace : addOptions to create a GAMSOptions object from either another object or an option file
- methods in GAMSWorkspace: getAPIVersion, getAPIMajorReleaseNumber, getAPIMinorReleaseNumber, and getAPIGoldReleaseNumber, to retrieve API version number
Changed
- default value of GAMSGlobals.SpecialValues: NAN, PLUS_INF, MINUS_INF, and EPS
- deprecated
GAMSGlobals.ModelStat.NONOPTIMAL_INTERMED
, replaced by GAMSGlobals.ModelStat.FEASIBLE - deprecated
GAMSOptions.PoolFree4
, replaced by GAMSOptions.EIntVarUp - deprecated the type of
GAMSOptions.NoNewVarEqu
, replaced by enum GAMSOptions.ENoNewVarEqu
Fixed
- a bug when running a job with an input directory
IDir
added into GAMSOptions object.
24.1.3 (July 2013)
Improve data iterator
- New classes:
- GAMSDatabaseIterator implements
java.util.Iterator
- GAMSSymbolIterator implements
java.util.Iterator
- GAMSDatabaseIterator implements
- Deprecated Interface:
GAMSSymbolIterable
, replaced by GAMSDatabaseIterator and GAMSSymbolIterator
- Changes in GAMSDatabase :
- GAMSDatabase implements GAMSDatabaseIterator instead of
GAMSSymbolIterable
- deprecated the implemented methods of
GAMSSymbolIterable
: next(), hasnext(), and remove()
- GAMSDatabase implements GAMSDatabaseIterator instead of
- Changes in GAMSSymbol:
- GAMSSymbol implements GAMSSymbolIterator instead of
GAMSSymbolIterable
- deprecated the implemented methods of
GAMSSymbolIterable
: next(), hasnext(), and remove()
- GAMSSymbol implements GAMSSymbolIterator instead of
- New methods in GAMSSymbolRecord:
- moveNext: to iterate to the next record using the current data iterator criterion
- movePrevious : to iterate to the previous record using the current data iterator criterion
Update example:
- Transport12 at
[Path/To/GAMS]/apifiles/Java/transport/Transport12.java
24.1.1 (May 2013)
Changes in GAMSDatabase:
- deprecates the
compact
method, as it has no effect anymore.
Changes in GAMSGlobals:
- the default value of working directory has been changed from
System.getProperty("user.dir")
toSystem.getProperty("java.io.tmpdir")
.
Changes in GAMSModelInstance :
- deprecates the instantiate(GAMSOptions options), instantiate(GAMSModifier[]), and instantiate(GAMSOptions, GAMSModifier[]) methods and replaced by instantiate(String, GAMSModifier ...) and instantiate(String, GAMSOptions, GAMSModifier ...) methods
Changes in GAMSWorkspace and GAMSWorkspaceInfo:
- deprecates boolean
debug
flag and replaced by a debug level flag (type of a new class GAMSGlobals.DebugLevel). - allows an override of debug level flag from an environment variable
GAMSOOAPIDEBUG
New methods in GAMSDatabase:
- GAMSDatabase.addEquation, addParameter, addSet, and addVariable: to add symbols with domain information.
- checkDomains: to check whether or not all records of all symbols are within the specified domain of the symbols.
- getDatabaseDomainViolations: to retrieve a domain violation information as a list of GAMSDatabaseDomainViolation objects.
- isAutoDomainCheckingSuppressed and suppressAutoDomainChecking: to control whether domain checking will be called when exporting a database.
New class GAMSDatabaseDomainViolation:
- contains domain violation information of all symbols (if any) in the database.
- returns call from a new method GAMSDatabase.getDatabaseDomainViolations.
New enumeration class GAMSGlobals.DebugLevel:
- defines values of different GAMS Debug Levels.
New methods in GAMSModelInstance:
- copyModelInstance: to copy a GAMSModelInstance object.
- interrupt : to send an interrupt signal to a running GAMSModelInstance object.
New enumerated value of GAMSModelInstance.SymbolUpdateType:
- GAMSModelInstance.SymbolUpdateType.INHERIT: to specify GAMSModelInstance.SymbolUpdateType separately for each GAMSModifier.
New methods in GAMSModifier:
constructor
: to specify SymbolUpdateType for each GAMSModifier object.- getUpdateType: to retrieve SymbolUpdateType property of the object.
New methods in GAMSSymbol:
- checkDomains: to check whether or not all records of the symbol are within the specified domain.
- getDomains: to retrieve a list of domains of the symbol, each element is either a GAMSSet (real domain) or a
String
(relaxed domain). - getSymbolDomainViolations: to retrieve a domain violation information as a list of GAMSSymbolDomainViolation objects.
- mergeRecord: to add a new symbol record in case the record does not exist.
New class GAMSSymbolDomainViolation:
- contains domain violation information of the symbol (if any).
- returns call from a new method GAMSSymbol.getSymbolDomainViolations.
New methods in GAMSWorkspace
- getGAMSVersion: to retrieve information about GAMS Version.
- getGoldReleaseNumber: to retrieve GAMS GOLD Release Number.
- getMajorReleaseNumber: to retrieve GAMS Major Release Number.
- getMinorReleaseNumber: to retrieve GAMS Minor Release Number.
Fixed a bug when iterating through the records of a GAMSSymbol
Changes of location of examples:
- Bender Examples: from
[Path/To/GAMS]/apifiles/Java/Benders*.java
to[Path/To/GAMS]/apifiles/Java/benders/Benders*.java
- Cutstock: from
[Path/To/GAMS]/apifiles/Java/Custock.java
to[Path/To/GAMS]/apifiles/Java/cutstock/Cutstock.java
- ConsoleInterrupt: from
[Path/To/GAMS]/apifiles/Java/ConsoleInterrupt.java
to[Path/To/GAMS]/apifiles/Java/interrupt/ConsoleInterrupt.java
- Transport Examples: from
[Path/To/GAMS]/apifiles/Java/Transport*.java
to[Path/To/GAMS]/apifiles/Java/transport/Transport*.java
- Warehouse: from
[Path/To/GAMS]/apifiles/Java/Warehouse.java
to[Path/To/GAMS]/apifiles/Java/warehouse/Warehouse.java
New examples :
- SimpleCutstock at
[Path/To/GAMS]/apifiles/Java/cutstock/SimpleCutstock.java
- DomainCheck at
[Path/To/GAMS]/apifiles/Java/domain/DomainCheck.java
- Transport13 at `
[Path/To/GAMS]/apifiles/Java/transport/Transport13.java
- Tsp at
[Path/To/GAMS]/apifiles/Java/tsp/Tsp.java
24.0.2 (February 2013)
New method in GAMSSymbol
- added new method copySymbol.
24.0.1 (December 2012)
This release contains a beta version of the object-oriented Java API that can be used to control GAMS from a Java program. It allows the seamless integration of GAMS into Java by providing appropriate classes for the interaction with GAMS. GAMS Java API objects allow a convenient way to exchange input data and model results with in-memory representation of data (GAMSDatabase), and to create and run GAMS models (GAMSJob) that can be customized by GAMS options (GAMSOptions). Furthermore, they introduce a way to solve a sequence of closely related model instances in the more efficient way (GAMSModelInstance).
- A Java program that uses object-oriented Java API requires at least Java SE 5 to compile and run.
- All classes are distributed within one single jar file
GAMSJavaAPI.jar
with a namespacecom.gams.api
, located under the[Path/To/GAMS]/apifiles/Java/api/
directory. - Java program examples are distributed with namespace
com.gams.examples
, located under[Path/To/GAMS]/apifiles/Java/
directory. - Installation and detailed documents can be found in
[Path/To/GAMS]/apifiles/readme.txt
and[Path/To/GAMS]/docs/API/GAMS_java.pdf
. - Javadoc for
GAMSJavaAPI.jar
can be found under[Path/To/GAMS]/apifiles/java/api/javadoc
directory.