Loading...
Searching...
No Matches
gams.control.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.
 
def export (self, file_path)
 Write GamsOptions into a parameter file.
 

Public Attributes

 defines
 GAMS Dash Options.
 

Properties

property all_model_types = property(fset=set_all_model_types)
 Set solver for all model types.
 
property lp = property(get_lp, set_lp)
 Default lp solver.
 
property mip = property(get_mip, set_mip)
 Default mip solver.
 
property rmip = property(get_rmip, set_rmip)
 Default rmip solver.
 
property nlp = property(get_nlp, set_nlp)
 Default nlp solver.
 
property mcp = property(get_mcp, set_mcp)
 Default mcp solver.
 
property mpec = property(get_mpec, set_mpec)
 Default mpec solver.
 
property rmpec = property(get_rmpec, set_rmpec)
 Default rmpec solver.
 
property cns = property(get_cns, set_cns)
 Default cns solver.
 
property dnlp = property(get_dnlp, set_dnlp)
 Default dnlp solver.
 
property rminlp = property(get_rminlp, set_rminlp)
 Default rminlp solver.
 
property minlp = property(get_minlp, set_minlp)
 Default minlp solver.
 
property qcp = property(get_qcp, set_qcp)
 Default qcp solver.
 
property miqcp = property(get_miqcp, set_miqcp)
 Default miqcp solver.
 
property rmiqcp = property(get_rmiqcp, set_rmiqcp)
 Default rmiqcp solver.
 
property emp = property(get_emp, set_emp)
 Default emp solver.
 
property action = property(get_action, set_action)
 GAMS processing request.
 
property appendexpand = property(get_appendexpand, set_appendexpand)
 Expand file append option.
 
property appendout = property(get_appendout, set_appendout)
 Output file append option.
 
property asyncsollst = property(get_asyncsollst, set_asyncsollst)
 Print solution listing when asynchronous solve (Grid or Threads) is used.
 
property bratio = property(get_bratio, set_bratio)
 Basis detection threshold.
 
property capturemodelinstance = property(get_capturemodelinstance, set_capturemodelinstance)
 Switch to capture all model instances within a run.
 
property case = property(get_case, set_case)
 Output case option for LST file.
 
property cerr = property(get_cerr, set_cerr)
 Compile time error limit.
 
property charset = property(get_charset, set_charset)
 Character set flag.
 
property checkerrorlevel = property(get_checkerrorlevel, set_checkerrorlevel)
 Check errorLevel automatically after executing external program.
 
property decryptkey = property(get_decryptkey, set_decryptkey)
 Key to decrypt a text file that was encrypted via $encrypt.
 
property dformat = property(get_dformat, set_dformat)
 Date format.
 
property digit = property(get_digit, set_digit)
 Switch default for "$on/offDigit".
 
property domlim = property(get_domlim, set_domlim)
 Domain violation limit solver default.
 
property dumpopt = property(get_dumpopt, set_dumpopt)
 Writes preprocessed input to the file input.dmp.
 
property dumpoptgdx = property(get_dumpoptgdx, set_dumpoptgdx)
 Defines a GDX file name stem created when using DumpOpt.
 
property dumpparms = property(get_dumpparms, set_dumpparms)
 GAMS parameter logging.
 
property dumpparmslogprefix = property(get_dumpparmslogprefix, set_dumpparmslogprefix)
 Prefix of lines triggered by DumpParms>1.
 
property ecimplicitload = property(get_ecimplicitload, set_ecimplicitload)
 Allow implicit loading of symbols from embedded code or not.
 
property empty = property(get_empty, set_empty)
 Switch default for "$on/offEmpty".
 
property encryptkey = property(get_encryptkey, set_encryptkey)
 Key to encrypt a text file using $encrypt.
 
property eolcom = property(get_eolcom, set_eolcom)
 Switch default for "$on/offEolCom" and "$eolCom".
 
property errmsg = property(get_errmsg, set_errmsg)
 Placing of compilation error messages.
 
property errorlog = property(get_errorlog, set_errorlog)
 Max error message lines written to the log for each error.
 
property etlim = property(get_etlim, set_etlim)
 Elapsed time limit in seconds.
 
property execmode = property(get_execmode, set_execmode)
 Limits on external programs that are allowed to be executed.
 
property expand = property(get_expand, set_expand)
 Expanded (include) input file name.
 
property fddelta = property(get_fddelta, set_fddelta)
 Step size for finite differences.
 
property fdopt = property(get_fdopt, set_fdopt)
 Options for finite differences.
 
property ferr = property(get_ferr, set_ferr)
 Alternative error message file.
 
property filecase = property(get_filecase, set_filecase)
 Casing of file names and paths (put, gdx, ref, $include, etc.)
 
property filestem = property(get_filestem, set_filestem)
 Sets the file stem for output files which use the input file name as stem by default.
 
property filestemapfromenv = property(get_filestemapfromenv, set_filestemapfromenv)
 Append a string read from an environment variable to the "FileStem".
 
property filtered = property(get_filtered, set_filtered)
 Switch between filtered and domain-checked read from GDX.
 
property forceoptfile = property(get_forceoptfile, set_forceoptfile)
 Overwrites other option file section mechanism.
 
property forcework = property(get_forcework, set_forcework)
 Force GAMS to process a save file created with a newer GAMS version or with execution errors.
 
property forlim = property(get_forlim, set_forlim)
 GAMS looping limit.
 
property freeembeddedpython = property(get_freeembeddedpython, set_freeembeddedpython)
 Free external resources at the end of each embedded Python code blocks.
 
property gdxcompress = property(get_gdxcompress, set_gdxcompress)
 Compression of generated GDX file.
 
property gdxconvert = property(get_gdxconvert, set_gdxconvert)
 Version of GDX files generated (for backward compatibility)
 
property gdxuels = property(get_gdxuels, set_gdxuels)
 Unload labels or UELs to GDX either squeezed or full.
 
property griddir = property(get_griddir, set_griddir)
 Grid file directory.
 
property gridscript = property(get_gridscript, set_gridscript)
 Grid submission script.
 
property heaplimit = property(get_heaplimit, set_heaplimit)
 Maximum Heap size allowed in MB.
 
property holdfixed = property(get_holdfixed, set_holdfixed)
 Treat fixed variables as constants.
 
property holdfixedasync = property(get_holdfixedasync, set_holdfixedasync)
 Allow HoldFixed for models solved asynchronously as well.
 
property idcgdxinput = property(get_idcgdxinput, set_idcgdxinput)
 GDX file name with data for implicit input.
 
property idcgdxoutput = property(get_idcgdxoutput, set_idcgdxoutput)
 GDX file name for data for implicit output.
 
property implicitassign = property(get_implicitassign, set_implicitassign)
 Switch default for "$on/offImplicitAssign".
 
property inlinecom = property(get_inlinecom, set_inlinecom)
 Switch default for "$on/offInline" and "$inlineCom".
 
property integer1 = property(get_integer1, set_integer1)
 Integer communication cell N.
 
property integer2 = property(get_integer2, set_integer2)
 Integer communication cell N.
 
property integer3 = property(get_integer3, set_integer3)
 Integer communication cell N.
 
property integer4 = property(get_integer4, set_integer4)
 Integer communication cell N.
 
property integer5 = property(get_integer5, set_integer5)
 Integer communication cell N.
 
property interactivesolver = property(get_interactivesolver, set_interactivesolver)
 Allow solver to interact via command line input.
 
property intvarup = property(get_intvarup, set_intvarup)
 Set mode for default upper bounds on integer variables.
 
property iterlim = property(get_iterlim, set_iterlim)
 Iteration limit of solver.
 
property jobtrace = property(get_jobtrace, set_jobtrace)
 Job trace string to be written to the trace file at the end of a GAMS job.
 
property keep = property(get_keep, set_keep)
 Controls keeping or deletion of process directory and scratch files.
 
property libincdir = property(get_libincdir, set_libincdir)
 LibInclude directory.
 
property license = property(get_license, set_license)
 Use alternative license file.
 
property limcol = property(get_limcol, set_limcol)
 Maximum number of columns listed in one variable block.
 
property limrow = property(get_limrow, set_limrow)
 Maximum number of rows listed in one equation block.
 
property listing = property(get_listing, set_listing)
 Switch default for "$on/offListing".
 
property logline = property(get_logline, set_logline)
 Amount of line tracing to the log file.
 
property lsttitleleftaligned = property(get_lsttitleleftaligned, set_lsttitleleftaligned)
 Write title of LST file all left aligned.
 
property maxexecerror = property(get_maxexecerror, set_maxexecerror)
 Execution time error limit.
 
property maxprocdir = property(get_maxprocdir, set_maxprocdir)
 Maximum number of 225* process directories.
 
property miimode = property(get_miimode, set_miimode)
 Model Instance Mode.
 
property multi = property(get_multi, set_multi)
 Switch default for "$on/offMulti[R]".
 
property nodlim = property(get_nodlim, set_nodlim)
 Node limit in branch and bound tree.
 
property nonewvarequ = property(get_nonewvarequ, set_nonewvarequ)
 Triggers a compilation error when new equations or variable symbols are introduced.
 
property on115 = property(get_on115, set_on115)
 Generate errors for unknown unique element in an equation.
 
property optca = property(get_optca, set_optca)
 Absolute Optimality criterion solver default.
 
property optcr = property(get_optcr, set_optcr)
 Relative Optimality criterion solver default.
 
property optdir = property(get_optdir, set_optdir)
 Option file directory.
 
property optfile = property(get_optfile, set_optfile)
 Default option file.
 
property output = property(get_output, set_output)
 Listing file name.
 
property pagecontr = property(get_pagecontr, set_pagecontr)
 Output file page control option.
 
property pagesize = property(get_pagesize, set_pagesize)
 Output file page size (=0 no paging)
 
property pagewidth = property(get_pagewidth, set_pagewidth)
 Output file page width.
 
property plicense = property(get_plicense, set_plicense)
 Privacy license file name.
 
property prefixloadpath = property(get_prefixloadpath, set_prefixloadpath)
 Prepend GAMS system directory to library load path.
 
property previouswork = property(get_previouswork, set_previouswork)
 Indicator for writing workfile with previous workfile version.
 
property proctreememmonitor = property(get_proctreememmonitor, set_proctreememmonitor)
 Monitor the memory used by the GAMS process tree.
 
property proctreememticks = property(get_proctreememticks, set_proctreememticks)
 Set wait interval between memory monitor checks: ticks = milliseconds.
 
property profile = property(get_profile, set_profile)
 Execution profiling.
 
property profilefile = property(get_profilefile, set_profilefile)
 Write profile information to this file.
 
property profiletol = property(get_profiletol, set_profiletol)
 Minimum time a statement must use to appear in profile generated output.
 
property putdir = property(get_putdir, set_putdir)
 Put file directory.
 
property putnd = property(get_putnd, set_putnd)
 Number of decimals for put files.
 
property putnr = property(get_putnr, set_putnr)
 Numeric round format for put files.
 
property putps = property(get_putps, set_putps)
 Page size for put files.
 
property putpw = property(get_putpw, set_putpw)
 Page width for put files.
 
property reference = property(get_reference, set_reference)
 Symbol reference file.
 
property referencelineno = property(get_referencelineno, set_referencelineno)
 Controls the line numbers written to a reference file.
 
property replace = property(get_replace, set_replace)
 Switch between merge and replace when reading from GDX into non-empty symbol.
 
property reslim = property(get_reslim, set_reslim)
 Wall-clock time limit for solver.
 
property savepoint = property(get_savepoint, set_savepoint)
 Save solver point in GDX file.
 
property scriptexit = property(get_scriptexit, set_scriptexit)
 Program or script to be executed at the end of a GAMS run.
 
property seed = property(get_seed, set_seed)
 Random number seed.
 
property showosmemory = property(get_showosmemory, set_showosmemory)
 Show the memory usage reported by the Operating System instead of the internal counting.
 
property solprint = property(get_solprint, set_solprint)
 Solution report print option.
 
property solvelink = property(get_solvelink, set_solvelink)
 Solver link option.
 
property solveopt = property(get_solveopt, set_solveopt)
 Multiple solve management.
 
property stepsum = property(get_stepsum, set_stepsum)
 Summary of computing resources used by job steps.
 
property strictsingleton = property(get_strictsingleton, set_strictsingleton)
 Error if assignment to singleton set has multiple elements.
 
property stringchk = property(get_stringchk, set_stringchk)
 String substitution options.
 
property suffixdlvars = property(get_suffixdlvars, set_suffixdlvars)
 Switch default for "$on/offSuffixDLVars".
 
property suffixalgebravars = property(get_suffixalgebravars, set_suffixalgebravars)
 Switch default for "$on/offSuffixAlgebraVars".
 
property suppress = property(get_suppress, set_suppress)
 Compiler listing option.
 
property symbol = property(get_symbol, set_symbol)
 Symbol table file.
 
property symprefix = property(get_symprefix, set_symprefix)
 Prefix all symbols encountered during compilation by the specified string in work file.
 
property sys10 = property(get_sys10, set_sys10)
 Changes rpower to ipower when the exponent is constant and within 1e-12 of an integer.
 
property sys11 = property(get_sys11, set_sys11)
 Dynamic resorting if indices in assignment/data statements are not in natural order.
 
property sys12 = property(get_sys12, set_sys12)
 Pass model with generation errors to solver.
 
property sysincdir = property(get_sysincdir, set_sysincdir)
 SysInclude directory.
 
property sysout = property(get_sysout, set_sysout)
 Solver Status file reporting option.
 
property tabin = property(get_tabin, set_tabin)
 Tab spacing.
 
property tformat = property(get_tformat, set_tformat)
 Time format.
 
property threads = property(get_threads, set_threads)
 Number of processors to be used by a solver.
 
property threadsasync = property(get_threadsasync, set_threadsasync)
 Limit on number of threads to be used for asynchronous solves (solveLink=6)
 
property timer = property(get_timer, set_timer)
 Instruction timer threshold in milli seconds.
 
property trace = property(get_trace, set_trace)
 Trace file name.
 
property tracelevel = property(get_tracelevel, set_tracelevel)
 Modelstat/Solvestat threshold used in conjunction with action=GT.
 
property traceopt = property(get_traceopt, set_traceopt)
 Trace file format option.
 
property user1 = property(get_user1, set_user1)
 User string N.
 
property user2 = property(get_user2, set_user2)
 User string N.
 
property user3 = property(get_user3, set_user3)
 User string N.
 
property user4 = property(get_user4, set_user4)
 User string N.
 
property user5 = property(get_user5, set_user5)
 User string N.
 
property warnings = property(get_warnings, set_warnings)
 Number of warnings permitted before a run terminates.
 
property workfactor = property(get_workfactor, set_workfactor)
 Memory Estimate multiplier for some solvers.
 
property workspace = property(get_workspace, set_workspace)
 Work space for some solvers in MB.
 
property zerores = property(get_zerores, set_zerores)
 The results of certain operations will be set to zero if abs(result) LE ZeroRes.
 
property 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.control.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.control.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.