ContentsIndexHome
PreviousUpNext
openSession Method

Creates a new AIMMS session object.

Creates an ISession object that represents the specified AIMMS model, using the default configuration.

public static ISession openSession(string aimmsLocation, string projectLocation);

 

Creates an ISession object that represents the specified AIMMS model, using a user-specified configuration.

public static ISession openSession(string aimmsLocation, string projectLocation, IConfig sessionConfig);

The specified AIMMS model runs in a separate process. 

For the format of the location URI you can either specify the local folder name (see examples) where AIMMS is installed, or use a URI as discussed in Running a remote session to start a remote AIMMS session. 

As second argument, you need an AIMMS project file (*.prj), if you have an AIMMS pack (*.aimmspack), unpack it first. 

 

When the session cannot be created, an exception is thrown, describing what went wrong. Common causes are:

  • Incorrect path for AIMMS installation specified;
  • Project filename cannot be opened (especially when running remotely);
  • The remote server is configured incorrectly or not started.

 

Open session may timeout for different reasons:

  • The ConnectTimeout determines the time it may take to setup the connection.
  • The normal timeout determines the time further initialization steps may take, especially starting the AimmsModel may take some time.

 

Configure the timeout for opening the session by IConfig.ConnectTimeout.