Loading...
Searching...
No Matches
matlab.gams.control.Job Class Reference

Manages the execution of a GAMS program given by GAMS model source. More...

Public Member Functions

logical interrupt ()
 Send interrupt message to GAMS during Job instance executes its run method.
 
void run (varargin)
 run Job
 
void runEngine (gams.control.engine.RunParameters parameters)
 Run Engine Job with engine.RunParameters.
 

Public Attributes

string fileName
 (read only) file name associated to Job
 
string jobName
 (read only) name of Job
 
gams.control.Database outDB
 (read only) Database created by run method
 

Detailed Description

Manages the execution of a GAMS program given by GAMS model source.

The GAMS source (or more precisely the root of a model source tree) of the job can be provided as a string or by a filename (relative to the working directory of the Workspace) of a text file containing the GAMS model source. The run method organizes the export of the input Database(s), calls the GAMS compiler and execution system with the supplied options and on successful completion provides through the property outDB (of type Database) the results of the model run.

While the result data is captured in a Database, the run method can also create a Checkpoint that not only captures data but represents the state of the entire Job and allows some other Job to continue from this state. In case of a compilation or execution error, the run method will raise an error. If the log output of GAMS is of interest, this can be captured.

A Job is connected to external resources and needs to be properly disposed before the Java garbage collector can claim the instance.

See also
Checkpoint, Workspace, Workspace.addJobFromGamsLib, Workspace.addJobFromTestLib, Workspace.addJobFromDataLib, Workspace.addJobFromFinLib, Workspace.addJobFromEmpLib, Workspace.addJobFromFile, Workspace.addJobFromString

Member Function Documentation

◆ interrupt()

logical matlab.gams.control.Job.interrupt ( )

Send interrupt message to GAMS during Job instance executes its run method.

This method is useful for interrupting the long running Job.

Return: true if GAMS has acknowledged an interrupt message, false otherwise

◆ run()

void matlab.gams.control.Job.run ( varargin  )

run Job

Valid VARARGIN signatures:

Arguments:

  • cp: Checkpoint to be created by Job
  • db1,...,dbN: Arbitrary number of GAMS databases
  • opt: GAMS opt to control job
  • createOutDB: Flag determined if outDB should be created
  • output: File name to store output in or 'cmdout' to print to command line
See also
ExitCodeMessage

◆ runEngine()

void matlab.gams.control.Job.runEngine ( gams.control.engine.RunParameters  parameters)

Run Engine Job with engine.RunParameters.

Valid VARARGIN signatures:

Arguments: