gams: Launch GAMS from command line

View source: R/gams.R

gamsR Documentation

Launch GAMS from command line

Description

Launch GAMS from command line

Usage

gams(gmsfile, options = list(), save, restart, gdx, envvar, wd, ...)

Arguments

gmsfile

path to one gms file

options

list of options

save

path to restart file

restart

path to restart file

gdx

path to gdx file

envvar

list of environmental variables

wd

working directory from which to launch the file (default to current working directory)

...

further argument to be passed to 'system'

Value

A 'tibble()' with three columns: 'gmsfile' containing the name of the gms file that was launched, 'return_code' containing the return code following the call, and 'status' a list column containing a 'tibble()' of solver and model status. The most standard return codes are

  • 0 for normal return

  • 2 for compilation error

  • 3 for execution error

see https://www.gams.com/latest/docs/UG_GAMSReturnCodes.html#UG_GAMSReturnCodes_ListOfErrorCodes for the full list of GAMS return codes. For solver status codes, see https://www.gams.com/latest/docs/UG_GAMSOutput.html#UG_GAMSOutput_SolverStatus and for model status, see https://www.gams.com/latest/docs/UG_GAMSOutput.html#UG_GAMSOutput_ModelStatus.

See Also

system() for the list of options of the command used to launch GAMS.

Examples

fpath <- file.path(
  sub(";.*$", "", Sys.getenv("GAMSDIR")),
  "gamslib_ml", "trnsport.1"
)
gams(fpath, options = list(output = "NUL", lp = "cplex"))

christophe-gouel/gamsr documentation built on Feb. 13, 2025, 12:42 p.m.