Loading...
Searching...
No Matches
com.gams.api.GAMSWorkspaceInfo Class Reference

Public Member Functions

 GAMSWorkspaceInfo ()
 Constructs a new GAMSWorkspaceInfo instance.
 
 GAMSWorkspaceInfo (String workingDir, String systemDir, GAMSGlobals.DebugLevel level)
 Constructs a new GAMSWorkspaceInfo instance.
 
void setWorkingDirectory (String directory)
 Set GAMS working directory.
 
String getWorkingDirectory ()
 Get GAMS working directory from this GAMSWorkspaceInfo instance.
 
void setSystemDirectory (String directory)
 Set GAMS system directory.
 
String getSystemDirectory ()
 Get GAMS system directory from this GAMSWorkspaceInfo instance.
 
void setDebugLevel (GAMSGlobals.DebugLevel level)
 Set GAMS debug mode.
 
GAMSGlobals.DebugLevel getDebugLevel ()
 Get GAMS debug mode from this GAMSWorkspaceInfo instance.
 

Detailed Description

The GAMSWorkspaceInfo can be used as input parameter for the GAMSWorkspace constructor. The GAMSWorkspaceInfo contains essential information for initializing GAMSWorkspace; GAMS working directory, GAMS System directory, and GAMS debug level.

GAMS system directory is the directory where GAMS has been installed.
The default value of the working directory is NULL.

GAMS working directory anchors for all file-based operations, whereas GAMS system directory is the directory where GAMS has been installed. The default value of the working directory is NULL.

GAMS debug level indicates how GAMS produces debug messages during the execution. The default value of the debug level is GAMSGlobals.DebugLevel.KEEP_FILES_ON_ERROR, no debug information available.

Note
Once GAMSWorkspace has been constructed using information from GAMSWorkspaceInfo object, changing an attribute value of the GAMSWorkspaceInfo object will not change the attribute value of GAMSWorkspace object.

For example:

  GAMSWorkspaceInfo wsInfo = new GAMSWorkspaceInfo();   
  String workingDirectory = System.getProperty("user.dir"); 
  wsInfo.workingDirectory( workingDirectory ); 
  wsInfo.setDebug(DebugLevel.SHOW_LOG);  
  GAMSWorkspace workspace = new GAMSWorkspace(wsInfo); 


See also
GAMSWorkspace
GAMSGlobals.DebugLevel

Constructor & Destructor Documentation

◆ GAMSWorkspaceInfo() [1/2]

com.gams.api.GAMSWorkspaceInfo.GAMSWorkspaceInfo ( )

Constructs a new GAMSWorkspaceInfo instance.

The default value of GAMS working directory and GAMS System directory are NULL, and the default value of the debug level is GAMSGlobals.DebugLevel.KEEP_FILES_ON_ERROR, no debug information available.

◆ GAMSWorkspaceInfo() [2/2]

com.gams.api.GAMSWorkspaceInfo.GAMSWorkspaceInfo ( String  workingDir,
String  systemDir,
GAMSGlobals.DebugLevel  level 
)

Constructs a new GAMSWorkspaceInfo instance.

Parameters
workingDirthe name of working Directory, anchor for all file-based operations
systemDirthe name of system directory, where GAMS is installed
leveldebug level
See also
GAMSGlobals.DebugLevel

Member Function Documentation

◆ getDebugLevel()

GAMSGlobals.DebugLevel com.gams.api.GAMSWorkspaceInfo.getDebugLevel ( )

Get GAMS debug mode from this GAMSWorkspaceInfo instance.

Returns
The value of the debug level of type GAMSGlobals.DebugLevel
See also
GAMSGlobals.DebugLevel

◆ getSystemDirectory()

String com.gams.api.GAMSWorkspaceInfo.getSystemDirectory ( )

Get GAMS system directory from this GAMSWorkspaceInfo instance.

Returns
the name of system directory (NULL if not initialized).

◆ getWorkingDirectory()

String com.gams.api.GAMSWorkspaceInfo.getWorkingDirectory ( )

Get GAMS working directory from this GAMSWorkspaceInfo instance.

Returns
the name of GAMS working directory (null if not initialized).

◆ setDebugLevel()

void com.gams.api.GAMSWorkspaceInfo.setDebugLevel ( GAMSGlobals.DebugLevel  level)

Set GAMS debug mode.

The debug mode will be verified later when a GAMSWorkspace instance is created from the information specified by this GAMSWorkspaceInfo instance.

Parameters
leveldebug level for debug mode of type GAMSGlobals.DebugLevel
See also
GAMSGlobals.DebugLevel

◆ setSystemDirectory()

void com.gams.api.GAMSWorkspaceInfo.setSystemDirectory ( String  directory)

Set GAMS system directory.

The specified directory will be verified later when a GAMSWorkspace instance is created from the information specified by this GAMSWorkspaceInfo instance.

Parameters
directorythe name of system directory.
See also
GAMSWorkspace

◆ setWorkingDirectory()

void com.gams.api.GAMSWorkspaceInfo.setWorkingDirectory ( String  directory)

Set GAMS working directory.

The specified directory will be verified later when a GAMSWorkspace instance is created from the information specified by this GAMSWorkspaceInfo instance.

Parameters
directorythe name of GAMS working directory, anchor all file-based operations
See also
GAMSWorkspace