gams.options.GamsOptions Class Reference

The GamsOptions class manages GAMS options (sometimes also called GAMS parameters since they correspond to the command line parameters of the GAMS executable) for a GamsJob and GamsModelInstance. More...

Inherits object.

Public Member Functions

def __init__ (self, ws, opt_from=None, opt_file=None)
 Constructor. More...
def export (self, file_path)
 Write GamsOptions into a parameter file. More...

Public Attributes

 GAMS Dash Options.


 all_model_types = property(fset=set_all_model_types)
 Set solver for all model types.
 lp = property(get_lp, set_lp)
 Default lp solver.
 mip = property(get_mip, set_mip)
 Default mip solver.
 rmip = property(get_rmip, set_rmip)
 Default rmip solver.
 nlp = property(get_nlp, set_nlp)
 Default nlp solver.
 mcp = property(get_mcp, set_mcp)
 Default mcp solver.
 mpec = property(get_mpec, set_mpec)
 Default mpec solver.
 rmpec = property(get_rmpec, set_rmpec)
 Default rmpec solver.
 cns = property(get_cns, set_cns)
 Default cns solver.
 dnlp = property(get_dnlp, set_dnlp)
 Default dnlp solver.
 rminlp = property(get_rminlp, set_rminlp)
 Default rminlp solver.
 minlp = property(get_minlp, set_minlp)
 Default minlp solver.
 qcp = property(get_qcp, set_qcp)
 Default qcp solver.
 miqcp = property(get_miqcp, set_miqcp)
 Default miqcp solver.
 rmiqcp = property(get_rmiqcp, set_rmiqcp)
 Default rmiqcp solver.
 emp = property(get_emp, set_emp)
 Default emp solver.
 output = property(get_output, set_output)
 Listing file name.
 symbol = property(get_symbol, set_symbol)
 Symbol table file.
 expand = property(get_expand, set_expand)
 Expanded (include) input file name.
 pagewidth = property(get_pagewidth, set_pagewidth)
 Output file page width.
 pagesize = property(get_pagesize, set_pagesize)
 Output file page size (=0 no paging)
 pagecontr = property(get_pagecontr, set_pagecontr)
 Output file page control option.
 action = property(get_action, set_action)
 GAMS processing request.
 putdir = property(get_putdir, set_putdir)
 Put file directory.
 griddir = property(get_griddir, set_griddir)
 Grid file directory.
 scriptexit = property(get_scriptexit, set_scriptexit)
 Program or script to be executed at the end of a GAMS run.
 logline = property(get_logline, set_logline)
 Amount of line tracing to the log file.
 trace = property(get_trace, set_trace)
 Trace file name.
 appendout = property(get_appendout, set_appendout)
 Output file append option.
 stepsum = property(get_stepsum, set_stepsum)
 Summary of computing resources used by job steps.
 suppress = property(get_suppress, set_suppress)
 Compiler listing option.
 dformat = property(get_dformat, set_dformat)
 Date format.
 tformat = property(get_tformat, set_tformat)
 Time format.
 tabin = property(get_tabin, set_tabin)
 Tab spacing.
 intvarup = property(get_intvarup, set_intvarup)
 Set default upper bound on integer variables.
 case = property(get_case, set_case)
 Output case option for LST file.
 license = property(get_license, set_license)
 Use alternative license file.
 dumpparms = property(get_dumpparms, set_dumpparms)
 GAMS parameter logging.
 profile = property(get_profile, set_profile)
 Execution profiling.
 libincdir = property(get_libincdir, set_libincdir)
 LibInclude directory.
 sysincdir = property(get_sysincdir, set_sysincdir)
 SysInclude directory.
 user1 = property(get_user1, set_user1)
 User string N.
 user2 = property(get_user2, set_user2)
 User string N.
 user3 = property(get_user3, set_user3)
 User string N.
 user4 = property(get_user4, set_user4)
 User string N.
 user5 = property(get_user5, set_user5)
 User string N.
 forcework = property(get_forcework, set_forcework)
 Force GAMS systems to process save files for example with an execution error.
 cerr = property(get_cerr, set_cerr)
 Compile time error limit.
 ferr = property(get_ferr, set_ferr)
 Alternative error message file.
 optfile = property(get_optfile, set_optfile)
 Default option file.
 dumpopt = property(get_dumpopt, set_dumpopt)
 Writes preprocessed input to the file input.dmp.
 errmsg = property(get_errmsg, set_errmsg)
 Placing of compilation error messages.
 stringchk = property(get_stringchk, set_stringchk)
 String substitution options.
 reference = property(get_reference, set_reference)
 Symbol reference file.
 optdir = property(get_optdir, set_optdir)
 Option file directory.
 execerr = property(get_execerr, set_execerr)
 Execution time error limit.
 errorlog = property(get_errorlog, set_errorlog)
 Max error message lines written to the log for each error.
 limrow = property(get_limrow, set_limrow)
 Maximum number of rows listed in one equation block.
 limcol = property(get_limcol, set_limcol)
 Maximum number of columns listed in one variable block.
 charset = property(get_charset, set_charset)
 Character set flag.
 keep = property(get_keep, set_keep)
 Controls keeping or deletion of process directory and scratch files.
 traceopt = property(get_traceopt, set_traceopt)
 Trace file format option.
 iterlim = property(get_iterlim, set_iterlim)
 Iteration limit of solver.
 domlim = property(get_domlim, set_domlim)
 Domain violation limit solver default.
 reslim = property(get_reslim, set_reslim)
 Wall-clock time limit for solver.
 optcr = property(get_optcr, set_optcr)
 Relative Optimality criterion solver default.
 optca = property(get_optca, set_optca)
 Absolute Optimality criterion solver default.
 sysout = property(get_sysout, set_sysout)
 Solver Status file reporting option.
 solprint = property(get_solprint, set_solprint)
 Solution report print option.
 bratio = property(get_bratio, set_bratio)
 Basis acceptance threshold.
 holdfixed = property(get_holdfixed, set_holdfixed)
 Treat fixed variables as constants.
 nodlim = property(get_nodlim, set_nodlim)
 Node limit in branch and bound tree.
 workfactor = property(get_workfactor, set_workfactor)
 Memory Estimate multiplier for some solvers.
 workspace = property(get_workspace, set_workspace)
 Work space for some solvers in MB.
 forlim = property(get_forlim, set_forlim)
 GAMS looping limit.
 seed = property(get_seed, set_seed)
 Random number seed.
 on115 = property(get_on115, set_on115)
 Generate errors for unknown unique element in an equation.
 execmode = property(get_execmode, set_execmode)
 Limits on external programs that are allowed to be executed.
 interactivesolver = property(get_interactivesolver, set_interactivesolver)
 Allow solver to interact via command line input.
 plicense = property(get_plicense, set_plicense)
 Privacy license file name.
 jobtrace = property(get_jobtrace, set_jobtrace)
 Job trace string to be written to the trace file at the end of a GAMS job.
 warnings = property(get_warnings, set_warnings)
 Number of warnings permitted before a run terminates.
 tracelevel = property(get_tracelevel, set_tracelevel)
 Solvestat threshold used in conjunction with action=GT.
 timer = property(get_timer, set_timer)
 Instruction timer threshold in milli seconds.
 filecase = property(get_filecase, set_filecase)
 Casing of new file names (put, gdx, ref etc.)
 savepoint = property(get_savepoint, set_savepoint)
 Save solver point in GDX file.
 solvelink = property(get_solvelink, set_solvelink)
 Solver link option.
 sys10 = property(get_sys10, set_sys10)
 Changes rpower to ipower when the exponent is constant and within 1e-12 of an integer.
 sys11 = property(get_sys11, set_sys11)
 Dynamic resorting if indices in assignment/data statements are not in natural order.
 sys12 = property(get_sys12, set_sys12)
 Pass model with generation errors to solver.
 zerores = property(get_zerores, set_zerores)
 The results of certain operations will be set to zero if abs(result) LE ZeroRes.
 zeroresrep = property(get_zeroresrep, set_zeroresrep)
 Report underflow as a warning when abs(results) LE ZeroRes and result set to zero.
 heaplimit = property(get_heaplimit, set_heaplimit)
 Maximum Heap size allowed in MB.
 gdxcompress = property(get_gdxcompress, set_gdxcompress)
 Compression of generated GDX file.
 gdxconvert = property(get_gdxconvert, set_gdxconvert)
 Version of GDX files generated (for backward compatibility)
 appendexpand = property(get_appendexpand, set_appendexpand)
 Expand file append option.
 etlim = property(get_etlim, set_etlim)
 Elapsed time limit in seconds.
 profiletol = property(get_profiletol, set_profiletol)
 Minimum time a statement must use to appear in profile generated output.
 profilefile = property(get_profilefile, set_profilefile)
 Write profile information to this file.
 maxprocdir = property(get_maxprocdir, set_maxprocdir)
 Maximum number of 225* process directories.
 integer1 = property(get_integer1, set_integer1)
 Integer communication cell N.
 integer2 = property(get_integer2, set_integer2)
 Integer communication cell N.
 integer3 = property(get_integer3, set_integer3)
 Integer communication cell N.
 integer4 = property(get_integer4, set_integer4)
 Integer communication cell N.
 integer5 = property(get_integer5, set_integer5)
 Integer communication cell N.
 gridscript = property(get_gridscript, set_gridscript)
 Grid submission script.
 threads = property(get_threads, set_threads)
 Number of threads to be used by a solver.
 nonewvarequ = property(get_nonewvarequ, set_nonewvarequ)
 Triggers a compilation error when new equations or variable symbols are introduced.
 forceoptfile = property(get_forceoptfile, set_forceoptfile)
 Overwrites other option file section mechanism.
 symprefix = property(get_symprefix, set_symprefix)
 Prefix all symbols encountered during compilation by the specified string in work file.
 gdxuels = property(get_gdxuels, set_gdxuels)
 Unload labels or UELs to GDX either squeezed or full.
 dumpparmslogprefix = property(get_dumpparmslogprefix, set_dumpparmslogprefix)
 Prefix of lines triggered by DumpParms>1.
 strictsingleton = property(get_strictsingleton, set_strictsingleton)
 Error if assignment to singleton set has multiple elements.
 fddelta = property(get_fddelta, set_fddelta)
 Step size for finite differences.
 fdopt = property(get_fdopt, set_fdopt)
 Options for finite differences.
 prefixloadpath = property(get_prefixloadpath, set_prefixloadpath)
 Prepend GAMS system directory to library load path.
 threadsasync = property(get_threadsasync, set_threadsasync)
 Number of threads to be used for asynchronous solve (solveLink=6)
 asyncsollst = property(get_asyncsollst, set_asyncsollst)
 Print solution listing when asynchronous solve (Grid or Threads) is used.
 filestem = property(get_filestem, set_filestem)
 Sets the file stem for output files which use the input file name as stem by default.
 pysetup = property(get_pysetup, set_pysetup)
 GAMS/Python Setup.
 pymultinst = property(get_pymultinst, set_pymultinst)
 GAMS/Python Multiple Instance Interpreter.
 filestemapfromenv = property(get_filestemapfromenv, set_filestemapfromenv)
 Append a string read from an environment variable to the "FileStem".
 showosmemory = property(get_showosmemory, set_showosmemory)
 Show the memory usage reported by the Operating System instead of the internal counting.
 lsttitleleftaligned = property(get_lsttitleleftaligned, set_lsttitleleftaligned)
 Write title of LST file all left aligned.

Detailed Description

The GamsOptions class manages GAMS options (sometimes also called GAMS parameters 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 (all_model_types).

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

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

Constructor & Destructor Documentation

◆ __init__()

def gams.options.GamsOptions.__init__ (   self,
  opt_from = None,
  opt_file = None 


wsGamsWorkspace containing GamsOptions
opt_fromGamsOptions used to initialize the new object
opt_fileParameter used to initialize the new objectfile

Member Function Documentation

◆ export()

def gams.options.GamsOptions.export (   self,

Write GamsOptions into a parameter file.

file_pathThe path used to write the parameter file. A relative path is relative to the GAMS working directory.