GAMS.GAMSJob Class Reference

More...

Public Member Functions

bool Interrupt ()
 Send interrupt signal to running GAMSJob Note: On Mac OS using Mono this call requires the tool pstree to be installed More...
 
void Run (GAMSOptions gamsOptions=null, GAMSCheckpoint checkpoint=null, TextWriter output=null, Boolean createOutDB=true)
 Run GAMSJob More...
 
void Run (params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSOptions gamsOptions, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSCheckpoint checkpoint, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (TextWriter output, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSOptions gamsOptions, GAMSCheckpoint checkpoint, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSOptions gamsOptions, TextWriter output, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSCheckpoint checkpoint, TextWriter output, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSOptions gamsOptions, GAMSCheckpoint checkpoint, TextWriter output, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSOptions gamsOptions, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSCheckpoint checkpoint, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (TextWriter output, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSOptions gamsOptions, GAMSCheckpoint checkpoint, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSOptions gamsOptions, TextWriter output, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSCheckpoint checkpoint, TextWriter output, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob More...
 
void Run (GAMSOptions gamsOptions, GAMSCheckpoint checkpoint, TextWriter output, Boolean createOutDB, params GAMSDatabase[] databases)
 Run GAMSJob More...
 

Properties

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

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 Note: On Mac OS using Mono this call requires the tool pstree to be installed

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

◆ Run() [1/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() [2/17]

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

Run GAMSJob

Parameters
databasesGAMSDatabases read by the GAMSJob

◆ Run() [3/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() [4/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() [5/17]

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

Run GAMSJob

Parameters
outputStream to capture GAMS log
databasesGAMSDatabases read by the GAMSJob

◆ Run() [6/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() [7/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() [8/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() [9/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() [10/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() [11/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() [12/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() [13/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() [14/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() [15/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() [16/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() [17/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

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