Matlab.GAMS.GAMSOptions Class Reference

Manages GAMS options. More...

Public Member Functions

 [instance initializer]
 all selected solvers
 [instance initializer]
 (read only) all selected solvers
 [instance initializer]
 Input file directories (up to 40 are allowed)
 [instance initializer]
 (read only) Input file directories
void defines (string name, string value)
 set the definition of GAMS Dash options More...
void dispose ()
 Release external resources hold by non-java library. More...
void export (string filePath)
 Write GAMSOptions into a parameter file. More...
string getDefinitionOf (string name)
 get the definition of GAMS Dash options More...
string getIDir (integer index)
 get an input file directory of specified index More...
string getSelectedSolvers (integer index)
 get selected solvers More...
logical isDefinitionEmpty ()
 check if the list of GAMS Dash options dictionaries is empty More...
logical isIDirEmpty ()
 check if the list of input file directories is empty More...
void readFromStr (string str)
 read from string More...
void ResetToDefault ()
 Reset all GAMS options to default.
void setAllModelTypes (string solver)
 Set default solver for all model types which the solver can handle. More...
void setModelTypesForSolvers ()
 Set default solver for all model types which the solver can handle.
void setSolversOptions ({string} solvers)
 set all selected solvers More...
integer writeParameterFile (string fileName)
 write parameter file More...

Public Attributes

Action action
 GAMS processing request.
AppendExpand appendExpand
 Expand file append option.
AppendOut appendOut
 Output file append option.
AsyncSolLst asyncSolLst
 Print solution listing when asynchronous solve (Grid or Threads) is used.
double bratio
 Basis acceptance threshold.
CaptureModelInstance captureModelInstance
 Switch to capture all model instances within a run.
integer CErr
 Compile time error limit.
CharSet charSet
 Character set flag.
CheckErrorLevel checkErrorLevel
 Check errorLevel automatically after executing external program.
string CNS
 Default CNS solver.
string decryptKey
 Key to decrypt a text file that was encrypted via $encrypt.
containers.Map definitions
 Dictionaries for GAMS Dash options.
DFormat DFormat
 Date format.
Digit digit
 Switch default for "$on/offDigit".
string DNLP
 Default DNLP solver.
integer domLim
 Domain violation limit solver default.
DumpOpt dumpOpt
 Writes preprocessed input to the file input.dmp.
DumpParms dumpParms
 GAMS parameter logging.
string dumpParmsLogPrefix
 Prefix of lines triggered by DumpParms>1.
string EMP
 Default EMP solver.
Empty empty
 Switch default for "$on/offEmpty".
string encryptKey
 Key to encrypt a text file using $encrypt.
string eolCom
 Switch default for "$on/offEolCom" and "$eolCom".
ErrMsg errMsg
 Placing of compilation error messages.
integer errorLog
 Max error message lines written to the log for each error.
double ETLim
 Elapsed time limit in seconds.
ExecMode execMode
 Limits on external programs that are allowed to be executed.
string expand
 Expanded (include) input file name.
double FDDelta
 Step size for finite differences.
 Options for finite differences.
string FErr
 Alternative error message file.
FileCase fileCase
 Casing of file names and paths (put, gdx, ref, $include, etc.)
string fileStem
 Sets the file stem for output files which use the input file name as stem by default.
string fileStemApFromEnv
 Append a string read from an environment variable to the "FileStem".
Filtered filtered
 Switch default for "$on/offFiltered".
integer forceOptFile
 Overwrites other option file section mechanism.
ForceWork forceWork
 Force GAMS to process a save file created with a newer GAMS version or with execution errors.
integer forLim
 GAMS looping limit.
FreeEmbeddedPython freeEmbeddedPython
 Free external resources at the end of each embedded Python code blocks.
string GDX
 GAMS data exchange file name.
gdxCompress gdxCompress
 Compression of generated GDX file.
gdxConvert gdxConvert
 Version of GDX files generated (for backward compatibility)
gdxUels gdxUels
 Unload labels or UELs to GDX either squeezed or full.
string gridDir
 Grid file directory.
string gridScript
 Grid submission script.
double heapLimit
 Maximum Heap size allowed in MB.
HoldFixed holdFixed
 Treat fixed variables as constants.
string IDCGDXInput
 GDX file name with data for implicit input.
string IDCGDXOutput
 GDX file name for data for implicit output.
string inlineCom
 Switch default for "$on/offInline" and "$inlineCom".
integer integer1
 Integer communication cell N.
integer integer2
 Integer communication cell N.
integer integer3
 Integer communication cell N.
integer integer4
 Integer communication cell N.
integer integer5
 Integer communication cell N.
InteractiveSolver interactiveSolver
 Allow solver to interact via command line input.
IntVarUp intVarUp
 Set default upper bound on integer variables.
integer iterLim
 Iteration limit of solver.
string jobTrace
 Job trace string to be written to the trace file at the end of a GAMS job.
Keep keep
 Controls keeping or deletion of process directory and scratch files.
string libIncDir
 LibInclude directory.
string license
 Use alternative license file.
integer limCol
 Maximum number of columns listed in one variable block.
integer limRow
 Maximum number of rows listed in one equation block.
Listing listing
 Switch default for "$on/offListing".
LogLine logLine
 Amount of line tracing to the log file.
string LP
 Default LP solver.
LstCase LstCase
 Output case option for LST file.
LstTitleLeftAligned lstTitleLeftAligned
 Write title of LST file all left aligned.
integer maxExecError
 Execution time error limit.
integer maxProcDir
 Maximum number of 225* process directories.
string MCP
 Default MCP solver.
string MINLP
 Default MINLP solver.
string MIP
 Default MIP solver.
string MIQCP
 Default MIQCP solver.
string MPEC
 Default MPEC solver.
string NLP
 Default NLP solver.
integer nodLim
 Node limit in branch and bound tree.
NoNewVarEqu noNewVarEqu
 Triggers a compilation error when new equations or variable symbols are introduced.
On115 on115
 Generate errors for unknown unique element in an equation.
double optCA
 Absolute Optimality criterion solver default.
double optCR
 Relative Optimality criterion solver default.
string optDir
 Option file directory.
integer optFile
 Default option file.
string output
 Listing file name.
PageContr pageContr
 Output file page control option.
integer pageSize
 Output file page size (=0 no paging)
integer pageWidth
 Output file page width.
string PLicense
 Privacy license file name.
PrefixLoadPath prefixLoadPath
 Prepend GAMS system directory to library load path.
PreviousWork previousWork
 Indicator for writing workfile with previous workfile version.
ProcTreeMemMonitor procTreeMemMonitor
 Monitor the memory used by the GAMS process tree.
integer procTreeMemTicks
 Set wait interval between memory monitor checks: ticks = milliseconds.
integer profile
 Execution profiling.
string profileFile
 Write profile information to this file.
double profileTol
 Minimum time a statement must use to appear in profile generated output.
string putDir
 Put file directory.
integer putND
 Number of decimals for put files.
PutNR putNR
 Numeric round format for put files.
integer putPS
 Page size for put files.
integer putPW
 Page width for put files.
PyMultInst pyMultInst
 GAMS/Python Multiple Instance Interpreter.
string QCP
 Default QCP solver.
string reference
 Symbol reference file.
double resLim
 Wall-clock time limit for solver.
string RMINLP
 Default RMINLP solver.
string RMIP
 Default RMIP solver.
string RMIQCP
 Default RMIQCP solver.
string RMPEC
 Default RMPEC solver.
SavePoint savePoint
 Save solver point in GDX file.
string scriptExit
 Program or script to be executed at the end of a GAMS run.
integer seed
 Random number seed.
ShowOSMemory showOSMemory
 Show the memory usage reported by the Operating System instead of the internal counting.
SolPrint solPrint
 Solution report print option.
SolveLink solveLink
 Solver link option.
StepSum stepSum
 Summary of computing resources used by job steps.
strictSingleton strictSingleton
 Error if assignment to singleton set has multiple elements.
StringChk stringChk
 String substitution options.
SuffixDLVars suffixDLVars
 Switch default for "$on/offSuffixDLVars".
Suppress suppress
 Compiler listing option.
string symbol
 Symbol table file.
string symPrefix
 Prefix all symbols encountered during compilation by the specified string in work file.
Sys10 sys10
 Changes rpower to ipower when the exponent is constant and within 1e-12 of an integer.
Sys11 sys11
 Dynamic resorting if indices in assignment/data statements are not in natural order.
integer sys12
 Pass model with generation errors to solver.
string sysIncDir
 SysInclude directory.
SysOut sysOut
 Solver Status file reporting option.
integer tabIn
 Tab spacing.
TFormat TFormat
 Time format.
integer threads
 Number of threads to be used by a solver.
integer threadsAsync
 Limit on number of threads to be used for asynchronous solves (solveLink=6)
integer timer
 Instruction timer threshold in milli seconds.
string trace
 Trace file name.
integer traceLevel
 Modelstat/Solvestat threshold used in conjunction with action=GT.
TraceOpt traceOpt
 Trace file format option.
string user1
 User string N.
string user2
 User string N.
string user3
 User string N.
string user4
 User string N.
string user5
 User string N.
integer warnings
 Number of warnings permitted before a run terminates.
double workFactor
 Memory Estimate multiplier for some solvers.
double workSpace
 Work space for some solvers in MB.
double zeroRes
 The results of certain operations will be set to zero if abs(result) LE ZeroRes.
ZeroResRep zeroResRep
 Report underflow as a warning when abs(results) LE ZeroRes and result set to zero.

Detailed Description

Manages GAMS options.

The GAMSOptions class manages GAMS options (sometimes also called GAMS parameter, since they correspond to the command line parameters of the GAMS executable) for a GAMSJob and GAMSModelInstance. There are integer (e.g. NodLim), double (e.g. ResLim), and string (e.g. PutDir) valued options. There are also a few list options (Defines to set string macros inside GAMS and IDir provide multiple search paths for include files) and a power option to set a solver for all suitable model types (allModelTypes).

Some options known from other interfaces to GAMS that are of limited use or could even create problematic situations in the Matlab environment are not settable through the GAMSOptions class.

For some options (e.g. LstCase) other GAMS interfaces use numeric values (e.g. 0,1) while the GAMSOptions class has enumerated types with proper names (e.g. MixedCase, UpperCase).

See also
GAMSWorkspace, GAMSWorkspace.addOptions

Member Function Documentation

◆ defines()

void Matlab.GAMS.GAMSOptions.defines ( string  name,
string  value 

set the definition of GAMS Dash options


  • name: dash option name
  • value: dash option value

◆ dispose()

void Matlab.GAMS.GAMSOptions.dispose ( )

Release external resources hold by non-java library.

A subsequent call on the object after disposed potentially causes an unexpected error or exception. Call this method either when the object is no longer needed and/or when resource management is a critical issue in the application.

◆ export()

void Matlab.GAMS.GAMSOptions.export ( string  filePath)

Write GAMSOptions into a parameter file.


  • filePath: The file path used to write the parameter file. A relative path is relative to the GAMS working directory

◆ getDefinitionOf()

string Matlab.GAMS.GAMSOptions.getDefinitionOf ( string  name)

get the definition of GAMS Dash options


  • name: dash option name

Return: dash option value of definition that matches argument

◆ getIDir()

string Matlab.GAMS.GAMSOptions.getIDir ( integer  index)

get an input file directory of specified index


  • index: index of input file directory

Return: input file directory of specified index

◆ getSelectedSolvers()

string Matlab.GAMS.GAMSOptions.getSelectedSolvers ( integer  index)

get selected solvers


  • index: solver index

◆ isDefinitionEmpty()

logical Matlab.GAMS.GAMSOptions.isDefinitionEmpty ( )

check if the list of GAMS Dash options dictionaries is empty

Return: true if empty

◆ isIDirEmpty()

logical Matlab.GAMS.GAMSOptions.isIDirEmpty ( )

check if the list of input file directories is empty

Return: true if empty

◆ readFromStr()

void Matlab.GAMS.GAMSOptions.readFromStr ( string  str)

read from string


  • str: string

◆ setAllModelTypes()

void Matlab.GAMS.GAMSOptions.setAllModelTypes ( string  solver)

Set default solver for all model types which the solver can handle.


  • solver: name of default solver

◆ setSolversOptions()

void Matlab.GAMS.GAMSOptions.setSolversOptions ( {string}  solvers)

set all selected solvers


  • solvers: name of solvers

◆ writeParameterFile()

integer Matlab.GAMS.GAMSOptions.writeParameterFile ( string  fileName)

write parameter file


  • fileName: name of parameter file