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...

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

 defines
 GAMS Dash Options.
 

Properties

 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.
 
 action = property(get_action, set_action)
 GAMS processing request.
 
 appendexpand = property(get_appendexpand, set_appendexpand)
 Expand file append option.
 
 appendout = property(get_appendout, set_appendout)
 Output file append option.
 
 asyncsollst = property(get_asyncsollst, set_asyncsollst)
 Print solution listing when asynchronous solve (Grid or Threads) is used.
 
 bratio = property(get_bratio, set_bratio)
 Basis detection threshold.
 
 capturemodelinstance = property(get_capturemodelinstance, set_capturemodelinstance)
 Switch to capture all model instances within a run.
 
 case = property(get_case, set_case)
 Output case option for LST file.
 
 cerr = property(get_cerr, set_cerr)
 Compile time error limit.
 
 charset = property(get_charset, set_charset)
 Character set flag.
 
 checkerrorlevel = property(get_checkerrorlevel, set_checkerrorlevel)
 Check errorLevel automatically after executing external program.
 
 decryptkey = property(get_decryptkey, set_decryptkey)
 Key to decrypt a text file that was encrypted via $encrypt.
 
 dformat = property(get_dformat, set_dformat)
 Date format.
 
 digit = property(get_digit, set_digit)
 Switch default for "$on/offDigit".
 
 domlim = property(get_domlim, set_domlim)
 Domain violation limit solver default.
 
 dumpopt = property(get_dumpopt, set_dumpopt)
 Writes preprocessed input to the file input.dmp.
 
 dumpoptgdx = property(get_dumpoptgdx, set_dumpoptgdx)
 Defines a GDX file name stem created when using DumpOpt.
 
 dumpparms = property(get_dumpparms, set_dumpparms)
 GAMS parameter logging.
 
 dumpparmslogprefix = property(get_dumpparmslogprefix, set_dumpparmslogprefix)
 Prefix of lines triggered by DumpParms>1.
 
 ecimplicitload = property(get_ecimplicitload, set_ecimplicitload)
 Allow implicit loading of symbols from embedded code or not.
 
 empty = property(get_empty, set_empty)
 Switch default for "$on/offEmpty".
 
 encryptkey = property(get_encryptkey, set_encryptkey)
 Key to encrypt a text file using $encrypt.
 
 eolcom = property(get_eolcom, set_eolcom)
 Switch default for "$on/offEolCom" and "$eolCom".
 
 errmsg = property(get_errmsg, set_errmsg)
 Placing of compilation error messages.
 
 errorlog = property(get_errorlog, set_errorlog)
 Max error message lines written to the log for each error.
 
 etlim = property(get_etlim, set_etlim)
 Elapsed time limit in seconds.
 
 execmode = property(get_execmode, set_execmode)
 Limits on external programs that are allowed to be executed.
 
 expand = property(get_expand, set_expand)
 Expanded (include) input file name.
 
 fddelta = property(get_fddelta, set_fddelta)
 Step size for finite differences.
 
 fdopt = property(get_fdopt, set_fdopt)
 Options for finite differences.
 
 ferr = property(get_ferr, set_ferr)
 Alternative error message file.
 
 filecase = property(get_filecase, set_filecase)
 Casing of file names and paths (put, gdx, ref, $include, etc.)
 
 filestem = property(get_filestem, set_filestem)
 Sets the file stem for output files which use the input file name as stem by default.
 
 filestemapfromenv = property(get_filestemapfromenv, set_filestemapfromenv)
 Append a string read from an environment variable to the "FileStem".
 
 filtered = property(get_filtered, set_filtered)
 Switch default for "$on/offFiltered".
 
 forceoptfile = property(get_forceoptfile, set_forceoptfile)
 Overwrites other option file section mechanism.
 
 forcework = property(get_forcework, set_forcework)
 Force GAMS to process a save file created with a newer GAMS version or with execution errors.
 
 forlim = property(get_forlim, set_forlim)
 GAMS looping limit.
 
 freeembeddedpython = property(get_freeembeddedpython, set_freeembeddedpython)
 Free external resources at the end of each embedded Python code blocks.
 
 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)
 
 gdxuels = property(get_gdxuels, set_gdxuels)
 Unload labels or UELs to GDX either squeezed or full.
 
 griddir = property(get_griddir, set_griddir)
 Grid file directory.
 
 gridscript = property(get_gridscript, set_gridscript)
 Grid submission script.
 
 heaplimit = property(get_heaplimit, set_heaplimit)
 Maximum Heap size allowed in MB.
 
 holdfixed = property(get_holdfixed, set_holdfixed)
 Treat fixed variables as constants.
 
 holdfixedasync = property(get_holdfixedasync, set_holdfixedasync)
 Allow HoldFixed for models solved asynchronously as well.
 
 idcgdxinput = property(get_idcgdxinput, set_idcgdxinput)
 GDX file name with data for implicit input.
 
 idcgdxoutput = property(get_idcgdxoutput, set_idcgdxoutput)
 GDX file name for data for implicit output.
 
 inlinecom = property(get_inlinecom, set_inlinecom)
 Switch default for "$on/offInline" and "$inlineCom".
 
 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.
 
 interactivesolver = property(get_interactivesolver, set_interactivesolver)
 Allow solver to interact via command line input.
 
 intvarup = property(get_intvarup, set_intvarup)
 Set mode for default upper bounds on integer variables.
 
 iterlim = property(get_iterlim, set_iterlim)
 Iteration limit of solver.
 
 jobtrace = property(get_jobtrace, set_jobtrace)
 Job trace string to be written to the trace file at the end of a GAMS job.
 
 keep = property(get_keep, set_keep)
 Controls keeping or deletion of process directory and scratch files.
 
 libincdir = property(get_libincdir, set_libincdir)
 LibInclude directory.
 
 license = property(get_license, set_license)
 Use alternative license file.
 
 limcol = property(get_limcol, set_limcol)
 Maximum number of columns listed in one variable block.
 
 limrow = property(get_limrow, set_limrow)
 Maximum number of rows listed in one equation block.
 
 listing = property(get_listing, set_listing)
 Switch default for "$on/offListing".
 
 logline = property(get_logline, set_logline)
 Amount of line tracing to the log file.
 
 lsttitleleftaligned = property(get_lsttitleleftaligned, set_lsttitleleftaligned)
 Write title of LST file all left aligned.
 
 maxexecerror = property(get_maxexecerror, set_maxexecerror)
 Execution time error limit.
 
 maxprocdir = property(get_maxprocdir, set_maxprocdir)
 Maximum number of 225* process directories.
 
 multi = property(get_multi, set_multi)
 Switch default for "$on/offMulti[R]".
 
 nodlim = property(get_nodlim, set_nodlim)
 Node limit in branch and bound tree.
 
 nonewvarequ = property(get_nonewvarequ, set_nonewvarequ)
 Triggers a compilation error when new equations or variable symbols are introduced.
 
 on115 = property(get_on115, set_on115)
 Generate errors for unknown unique element in an equation.
 
 optca = property(get_optca, set_optca)
 Absolute Optimality criterion solver default.
 
 optcr = property(get_optcr, set_optcr)
 Relative Optimality criterion solver default.
 
 optdir = property(get_optdir, set_optdir)
 Option file directory.
 
 optfile = property(get_optfile, set_optfile)
 Default option file.
 
 output = property(get_output, set_output)
 Listing file name.
 
 pagecontr = property(get_pagecontr, set_pagecontr)
 Output file page control option.
 
 pagesize = property(get_pagesize, set_pagesize)
 Output file page size (=0 no paging)
 
 pagewidth = property(get_pagewidth, set_pagewidth)
 Output file page width.
 
 plicense = property(get_plicense, set_plicense)
 Privacy license file name.
 
 prefixloadpath = property(get_prefixloadpath, set_prefixloadpath)
 Prepend GAMS system directory to library load path.
 
 previouswork = property(get_previouswork, set_previouswork)
 Indicator for writing workfile with previous workfile version.
 
 proctreememmonitor = property(get_proctreememmonitor, set_proctreememmonitor)
 Monitor the memory used by the GAMS process tree.
 
 proctreememticks = property(get_proctreememticks, set_proctreememticks)
 Set wait interval between memory monitor checks: ticks = milliseconds.
 
 profile = property(get_profile, set_profile)
 Execution profiling.
 
 profilefile = property(get_profilefile, set_profilefile)
 Write profile information to this file.
 
 profiletol = property(get_profiletol, set_profiletol)
 Minimum time a statement must use to appear in profile generated output.
 
 putdir = property(get_putdir, set_putdir)
 Put file directory.
 
 putnd = property(get_putnd, set_putnd)
 Number of decimals for put files.
 
 putnr = property(get_putnr, set_putnr)
 Numeric round format for put files.
 
 putps = property(get_putps, set_putps)
 Page size for put files.
 
 putpw = property(get_putpw, set_putpw)
 Page width for put files.
 
 pymultinst = property(get_pymultinst, set_pymultinst)
 GAMS/Python Multiple Instance Interpreter.
 
 reference = property(get_reference, set_reference)
 Symbol reference file.
 
 referencelineno = property(get_referencelineno, set_referencelineno)
 Controls the line numbers written to a reference file.
 
 reslim = property(get_reslim, set_reslim)
 Wall-clock time limit for solver.
 
 savepoint = property(get_savepoint, set_savepoint)
 Save solver point in GDX file.
 
 scriptexit = property(get_scriptexit, set_scriptexit)
 Program or script to be executed at the end of a GAMS run.
 
 seed = property(get_seed, set_seed)
 Random number seed.
 
 showosmemory = property(get_showosmemory, set_showosmemory)
 Show the memory usage reported by the Operating System instead of the internal counting.
 
 solprint = property(get_solprint, set_solprint)
 Solution report print option.
 
 solvelink = property(get_solvelink, set_solvelink)
 Solver link option.
 
 stepsum = property(get_stepsum, set_stepsum)
 Summary of computing resources used by job steps.
 
 strictsingleton = property(get_strictsingleton, set_strictsingleton)
 Error if assignment to singleton set has multiple elements.
 
 stringchk = property(get_stringchk, set_stringchk)
 String substitution options.
 
 suffixdlvars = property(get_suffixdlvars, set_suffixdlvars)
 Switch default for "$on/offSuffixDLVars".
 
 suppress = property(get_suppress, set_suppress)
 Compiler listing option.
 
 symbol = property(get_symbol, set_symbol)
 Symbol table file.
 
 symprefix = property(get_symprefix, set_symprefix)
 Prefix all symbols encountered during compilation by the specified string in work file.
 
 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.
 
 sysincdir = property(get_sysincdir, set_sysincdir)
 SysInclude directory.
 
 sysout = property(get_sysout, set_sysout)
 Solver Status file reporting option.
 
 tabin = property(get_tabin, set_tabin)
 Tab spacing.
 
 tformat = property(get_tformat, set_tformat)
 Time format.
 
 threads = property(get_threads, set_threads)
 Number of threads to be used by a solver.
 
 threadsasync = property(get_threadsasync, set_threadsasync)
 Limit on number of threads to be used for asynchronous solves (solveLink=6)
 
 timer = property(get_timer, set_timer)
 Instruction timer threshold in milli seconds.
 
 trace = property(get_trace, set_trace)
 Trace file name.
 
 tracelevel = property(get_tracelevel, set_tracelevel)
 Modelstat/Solvestat threshold used in conjunction with action=GT.
 
 traceopt = property(get_traceopt, set_traceopt)
 Trace file format option.
 
 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.
 
 warnings = property(get_warnings, set_warnings)
 Number of warnings permitted before a run terminates.
 
 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.
 
 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.
 

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,
  ws,
  opt_from = None,
  opt_file = None 
)

Constructor.

Parameters
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,
  file_path 
)

Write GamsOptions into a parameter file.

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