Decision Optimization

 View Only

Exporting OPL models from CPLEX Optimization Studio and importing them in a Decision Optimization experiment in Cloud Pak for Data

By Shirley de Jonk posted Mon November 07, 2022 09:18 AM

  

Easily transfer your OPL models to Cloud Pak for Data!

Watch this video to see how to export OPL models from CPLEX Optimization Studio and import them into your Decision Optimization experiment in Cloud Pak for Data.

OPL settings (Cloud Pak for Data as a Service)

You can also import an .ops file from CPLEX Optimization Studio into your Decision Optimization experiment in Cloud Pak for Data as a Service from the Build Model view. Click + > Import files... and select your .ops file. Once imported, you can view the different parameters in a Visual Editor. For more information see OPL models in the Cloud Pak for Data as a Service documentation.

OPL structures supported in Cloud Pak for Data

OPL models in Decision Optimization experiments in Cloud Pak for Data must have tuples declared for each of the tables that you have imported. This means that you might have to reformulate some external data structures into tuples. For example, a model containing data structures such as:

float Consumption[Products][Resources] = ...;

with data defined in the .dat file as

Products = { "kluski", "capellini", "fettuccine" };
Resources = { "flour", "eggs" };

Consumption = [ [0.5, 0.2], [0.4, 0.4], [0.3, 0.6] ];

must be reformulated as

tuple TConsumption {
key string productId;
key string resourceId;
float consumption;
}

{TConsumption} Consumptions = ...;

and the data as

Consumptions = {
<"kluski", "flour", 0.5>,
<"kluski", "eggs", 0.2>,
<"capellini", "flour", 0.4>,
<"capellini", "eggs", 0.4>,
<"fettucine", "flour", 0.3>,
<"fettucine", "eggs", 0.6>
};

This can then be converted into a .csv file that can be imported into the Prepare Data view in your Decision Optimization experiment in Cloud Pak for Data.

Similarly, to obtain solution tables in the Explore Solution view, you must declare tuples for these output tables. See Inputs and Outputs in the Cloud Pak for Data as a Service documentation for more details.

Some OPL structures, however, are not supported in Decision Optimization experiments in Cloud Pak for Data, for example, external Java calls or other structures requiring access to disk.


#DecisionOptimization
0 comments
23 views

Permalink

Comments

Currently no comments.