Questions tagged [opl]

Optimization Programming Language (OPL) is an algebraic modeling language to describe models of optimization and mathematical programming. It is part of IBM ILOG CPLEX Optimization Studio.

Optimization Programming Language (OPL) is a high-level, mathematical language for the description of optimization models, which produces substantially simpler and shorter code than general-purpose programming languages.

438 questions
3
votes
1 answer

CPLEX optimization array error in objective function

I am trying to optimize the below problem in CPLEX OPL. I have defined the parameters and decision variables. However, when I try to formulate the objective function and the constraints I seem to encounter a problem as I receive an error in the line…
Willem B
  • 41
  • 6
3
votes
1 answer

Vehicle Routing with Pickup and Dropoffs with MIP

I am trying to solve a Vehicle Routing Problem with multiple pickups and dropoffs with multiple products carried by just one car. After solving this problem I am going to extend to multiple types of cars as well. One special setting is that it has a…
Josh Cho
  • 159
  • 1
  • 13
3
votes
1 answer

Benders.Strategy using Java and opl

I'm solving a mathematical model using Java however when i tried to call the Benders Strategy i keep receiving this error: Exception in thread "main" java.lang.IllegalArgumentException: No enum class ilog.cplex.cppimpl.IloCplex$IntParam with value…
3
votes
0 answers

Ruby initialize method not throwing wrong number of arguments error

I have setup IRB for my Rails application. I have used following gems gem 'sprockets-rails', '<= 3.0.0' gem 'opal' gem 'opal-rails', '0.8.0' gem 'opal-jquery' gem 'opal-browser' gem 'opal-irb', github: 'fkchang/opal-irb', require:…
3
votes
0 answers

IBM Optimization Studio CPLEX OPL jar returns wrong version

I have been using the IBM OPL Java API library in Eclipse to run my OPL model and data file in Java. This has been working fine in Eclipse but now that I have compiled my program to an executable jar and try running it on Windows 7 command line I…
user134589
  • 2,499
  • 2
  • 16
  • 12
2
votes
1 answer

How do I switch the max function from CPLEX OPL to Docplex?

I have the following restriction implemented on CPLEX OPL. forall (i in N) forall (j in M) forall (k in 1..i) sum(z in 1 ..i)(p[z]*(x[z][j][k]+y[z][j][k])) + (t[k]*max(z in 1 ..i)(x[z][j][k]+y[z][j][k]))<= d[i]; …
2
votes
1 answer

all entries at implied bounds CPLEX

I have a set of cars with scheduled time originaltime[cars] to arrive at destination. However, based on the sequence of arrival, they have to be some time apart (given by data input separate[cars][cars]). My objective is to minimize the delay of…
gawdzilla
  • 45
  • 7
2
votes
1 answer

How to use a solution from a model to solve another one

I'm solving an optimization problem in which I need the result from one model to be used as a restriction in another model. I'm using CPLEX with OPL language without any addon. I tried to save the values from one model into an Excel file and reading…
John
  • 37
  • 3
2
votes
1 answer

Error: cplex (default) cannot extract expression; OPL cannot extract expression AND change interface language

I'm a total beginner with CPLEX and OPL, so maybe someone can help me with the coding of a mixed integer programming model. I finished the model and the data. When I run the configuration I get 44 errors, including "opl cannot extract expression",…
tabacoben
  • 41
  • 2
2
votes
2 answers

Connecte Excel file to Cplex

I'm to solve an optimization problem using Cplex. In my file.dat I use SheetConnection my_sheet("ExcelFile.xls") to link Excel file to my cplex program, and after that I use SheetRead() to read data from Excel file. But after I run my configuration…
AIA
  • 23
  • 1
  • 5
2
votes
1 answer

Power function in OPL script

I'm trying to initialize a matrix in an OPL script (an execute{}block) Each element must be set to a float power (> 0) The pow function is not recognized in script, so I tried the ^ operator... but it is not what I expected : the reference says "^…
Aname
  • 515
  • 4
  • 16
1
vote
0 answers

two step vehicle routing problem with pickup and delivery

Hi I have to solve a problem which contains a two-index node-based problem with pickup and delivery. This is my work in cplex but i am not really satisfied with the final result even though it works. Are there any suggestions on how to improve the…
1
vote
0 answers

keeping solution for next iteration

Thank you very much for your help Mr. Alex; I have written the following main block with your help to save the output value in the next iteration. But this is not working properly; I have put the output results below. main { var source = new…
yalan
  • 17
  • 4
1
vote
1 answer

OPL CPLEX Syntax Problem with Array of Tuple

This is .mod (model file) tuple TDayPair{ string day1; string day2; } {TDayPair} DAYS={<"Mon","Tue">,<"Thurs","Fri">}; int a[DAYS]= ...; execute { writeln(a[<"Mon","Tue">]); //<--it gives syntax error here } This is .dat (data file) a = #[ …
william007
  • 17,375
  • 25
  • 118
  • 194
1
vote
1 answer

CPLEX opl soft objective of grouping high priority stock

The goal of the opl model below is to choose the freights with total minimum cost to fulfill all orders, I have a soft optimization objective objective1 where it's to try to put all orders with CategoryPriority on one freight or as small number of…
william007
  • 17,375
  • 25
  • 118
  • 194
1
2 3
29 30