Overview of the .NET interface

Presents a high-level overview of the OPL .NET interface.

The .NET interface offers basically the same functionality as the C++ one.

The .NET API is split into several namespaces:

  • The ILOG.Concert namespace contains the Concert modeling API, for modifying models.

  • The ILOG.CP namespace contains the CP Optimizer control API, for controlling the solving process of constraint programming models.

  • The ILOG.CPLEX namespace contains the CPLEX control API, for controlling the solving process of mathematical programming models.

  • The ILOG.OPL namespace contains the OPL control API, for loading and accessing models.

This API is available for all the languages supported by the .NET platform. Examples are provided with OPL for C#, and Visual Basic.

The .NET API is written as a wrapper on the equivalent C++ libraries; it offers the same functionality as the C++ API.

Each call to a method of the API goes through a wrapping layer. This may result in a slight performance overhead while the model is created, compared to using the C++ API, depending on the number of API function calls. Since you call only few API functions to load and solve your model, the overhead is negligible in usual cases, but it may become important if you use the low-level Concert, CP Optimizer, or CPLEX API for a complete model creation (for example, constructing a matrix line by line using INumExpr APIs or adding IConstraint objects one by one to an IModel using the API). It is therefore recommended to use the OPL language to model your problems whenever possible, and use only the low-level Concert APIs for the parts that need it (runtime additions, etc.).

Note:

The .NET API requires the vjslib.dll library.