Loading...
Searching...
No Matches
GAMS.GAMSJob Class Reference

Public Member Functions

bool Interrupt ()
 Send interrupt signal to running GAMSJob.
 
void Run (GAMSOptions gamsOptions=null, GAMSCheckpoint checkpoint=null, TextWriter output=null, Boolean createOutDB=true)
 Run GAMSJob.
 
void Run (params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSOptions gamsOptions, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSCheckpoint checkpoint, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (TextWriter output, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSOptions gamsOptions, GAMSCheckpoint checkpoint, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSOptions gamsOptions, TextWriter output, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSCheckpoint checkpoint, TextWriter output, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSOptions gamsOptions, GAMSCheckpoint checkpoint, TextWriter output, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSOptions gamsOptions, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSCheckpoint checkpoint, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (TextWriter output, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSOptions gamsOptions, GAMSCheckpoint checkpoint, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSOptions gamsOptions, TextWriter output, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSCheckpoint checkpoint, TextWriter output, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void Run (GAMSOptions gamsOptions, GAMSCheckpoint checkpoint, TextWriter output, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob.
 
void RunEngine (GAMSEngineConfiguration engineConfiguration, HashSet< string > extraModelFiles=null, Dictionary< string, string > engineOptions=null, GAMSOptions gamsOptions=null, GAMSCheckpoint checkpoint=null, TextWriter output=null, Boolean createOutDB=true, Boolean removeResults=true, params GAMSDatabase[] databases)
 Run GAMSJob on GAMS Engine.
 

Properties

string Name [get]
 Retrieve name of GAMSJob.
 
GAMSWorkspace Workspace [get]
 Get GAMSWorkspace containing GAMSJob.
 
GAMSDatabase OutDB [get]
 Get GAMSDatabase created by Run method.
 

Detailed Description

The GAMSJob class 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 GAMSWorkspace) of a text file containing the GAMS model source. The Run method organizes the export of the input GAMSDatabases, calls the GAMS compiler and execution system with the supplied options and on successful completion provides through the property OutDB (of type GAMSDatabase) the results of the model run.

While the result data is captured in a GAMSDatabase, the Run method can also create a GAMSCheckpoint that not only captures data but represents the state of the entire GAMSJob and allows some other GAMSJob to continue from this state. In case of a compilation or execution error, the Run method will throw an exception. If the log output of GAMS is of interest, this can be captured by providing a TextWriter instance.

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

Member Function Documentation

◆ Interrupt()

bool GAMS.GAMSJob.Interrupt ( )
inline

Send interrupt signal to running GAMSJob.

Returns
True meaning "the signal was sent", false meaning "there is no Job running"

◆ Run() [1/17]

void GAMS.GAMSJob.Run ( Boolean  createOutDB,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
createOutDBFlag to define if OutDB should be created
databasesGAMSDatabases read by the GAMSJob

◆ Run() [2/17]

void GAMS.GAMSJob.Run ( GAMSCheckpoint  checkpoint,
Boolean  createOutDB,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
checkpointGAMSCheckpoint to be created by GAMSJob
createOutDBFlag to define if OutDB should be created
databasesGAMSDatabases read by the GAMSJob

◆ Run() [3/17]

void GAMS.GAMSJob.Run ( GAMSCheckpoint  checkpoint,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
checkpointGAMSCheckpoint to be created by GAMSJob
databasesGAMSDatabases read by the GAMSJob

◆ Run() [4/17]

void GAMS.GAMSJob.Run ( GAMSCheckpoint  checkpoint,
TextWriter  output,
Boolean  createOutDB,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
checkpointGAMSCheckpoint to be created by GAMSJob
outputStream to capture GAMS log
createOutDBFlag to define if OutDB should be created
databasesGAMSDatabases read by the GAMSJob

◆ Run() [5/17]

void GAMS.GAMSJob.Run ( GAMSCheckpoint  checkpoint,
TextWriter  output,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
checkpointGAMSCheckpoint to be created by GAMSJob
outputStream to capture GAMS log
databasesGAMSDatabases read by the GAMSJob

◆ Run() [6/17]

void GAMS.GAMSJob.Run ( GAMSOptions  gamsOptions,
Boolean  createOutDB,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
gamsOptionsGAMS options to control job
createOutDBFlag to define if OutDB should be created
databasesGAMSDatabases read by the GAMSJob

◆ Run() [7/17]

void GAMS.GAMSJob.Run ( GAMSOptions  gamsOptions,
GAMSCheckpoint  checkpoint,
Boolean  createOutDB,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
gamsOptionsGAMS options to control job
checkpointGAMSCheckpoint to be created by GAMSJob
createOutDBFlag to define if OutDB should be created
databasesGAMSDatabases read by the GAMSJob

◆ Run() [8/17]

void GAMS.GAMSJob.Run ( GAMSOptions  gamsOptions,
GAMSCheckpoint  checkpoint,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
gamsOptionsGAMS options to control job
checkpointGAMSCheckpoint to be created by GAMSJob
databasesGAMSDatabases read by the GAMSJob

◆ Run() [9/17]

void GAMS.GAMSJob.Run ( GAMSOptions  gamsOptions,
GAMSCheckpoint  checkpoint,
TextWriter  output,
Boolean  createOutDB,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
gamsOptionsGAMS options to control job
checkpointGAMSCheckpoint to be created by GAMSJob
outputStream to capture GAMS log
createOutDBFlag to define if OutDB should be created
databasesGAMSDatabases read by the GAMSJob

◆ Run() [10/17]

void GAMS.GAMSJob.Run ( GAMSOptions  gamsOptions,
GAMSCheckpoint  checkpoint,
TextWriter  output,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
gamsOptionsGAMS options to control job
checkpointGAMSCheckpoint to be created by GAMSJob
outputStream to capture GAMS log
databasesGAMSDatabases read by the GAMSJob

◆ Run() [11/17]

void GAMS.GAMSJob.Run ( GAMSOptions  gamsOptions,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
gamsOptionsGAMS options to control job
databasesGAMSDatabases read by the GAMSJob

◆ Run() [12/17]

void GAMS.GAMSJob.Run ( GAMSOptions  gamsOptions,
TextWriter  output,
Boolean  createOutDB,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
gamsOptionsGAMS options to control job
outputStream to capture GAMS log
createOutDBFlag to define if OutDB should be created
databasesGAMSDatabases read by the GAMSJob

◆ Run() [13/17]

void GAMS.GAMSJob.Run ( GAMSOptions  gamsOptions,
TextWriter  output,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
gamsOptionsGAMS options to control job
outputStream to capture GAMS log
databasesGAMSDatabases read by the GAMSJob

◆ Run() [14/17]

void GAMS.GAMSJob.Run ( GAMSOptions  gamsOptions = null,
GAMSCheckpoint  checkpoint = null,
TextWriter  output = null,
Boolean  createOutDB = true 
)
inline

Run GAMSJob.

Parameters
gamsOptionsGAMS options to control job
checkpointGAMSCheckpoint to be created by GAMSJob
outputStream to capture GAMS log
createOutDBFlag to define if OutDB should be created

◆ Run() [15/17]

void GAMS.GAMSJob.Run ( params GAMSDatabase[]  databases)
inline

Run GAMSJob.

Parameters
databasesGAMSDatabases read by the GAMSJob

◆ Run() [16/17]

void GAMS.GAMSJob.Run ( TextWriter  output,
Boolean  createOutDB,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
outputStream to capture GAMS log
createOutDBFlag to define if OutDB should be created
databasesGAMSDatabases read by the GAMSJob

◆ Run() [17/17]

void GAMS.GAMSJob.Run ( TextWriter  output,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob.

Parameters
outputStream to capture GAMS log
databasesGAMSDatabases read by the GAMSJob

◆ RunEngine()

void GAMS.GAMSJob.RunEngine ( GAMSEngineConfiguration  engineConfiguration,
HashSet< string >  extraModelFiles = null,
Dictionary< string, string >  engineOptions = null,
GAMSOptions  gamsOptions = null,
GAMSCheckpoint  checkpoint = null,
TextWriter  output = null,
Boolean  createOutDB = true,
Boolean  removeResults = true,
params GAMSDatabase[]  databases 
)
inline

Run GAMSJob on GAMS Engine.

Parameters
engineConfigurationGAMSEngineConfiguration object
extraModelFilesSet of additional file paths (apart from main file) required to run the model (e.g. include files)
engineOptionsDictionary of GAMS Engine options to control job execution
gamsOptionsGAMS options to control job
checkpointGAMSCheckpoint to be created by GAMSJob
outputStream to capture GAMS log
createOutDBFlag to define if OutDB should be created
removeResultsRemove results from GAMS Engine after downloading them
databasesGAMSDatabases read by the GAMSJob

Property Documentation

◆ Name

string GAMS.GAMSJob.Name
get

Retrieve name of GAMSJob.

◆ OutDB

GAMSDatabase GAMS.GAMSJob.OutDB
get

Get GAMSDatabase created by Run method.

◆ Workspace

GAMSWorkspace GAMS.GAMSJob.Workspace
get

Get GAMSWorkspace containing GAMSJob.