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
1
vote
2 answers

Logical constraints in CPLEX

I am a beginner at using CPLEX and I have come across a problem with creating logical constraints (if ... then ...). I use IBM ILOG CPLEX Optimization Studio version 12.7. According to the the manual, it should be able to handle logical constraints…
TracedWill
  • 13
  • 7
1
vote
2 answers

importing a .txt file into a .dat cplex opl

In an optimization problem I need to open my data for the problem in the .dat file. The problem is that the data is in a text file (notebook) and I don't know how I should connect it and work with a lot of instances. Could someone help me? I am…
1
vote
0 answers

Cplex speed in Matlab versus OPL

I had an optimization model in OPL studio. I decided to use Cplex in Matlab since it provides a higher freedom. But Unfortunately I realized that Matlab is much slower than OPL. To be more specific, the "Root node processing (before b&c)" is taking…
Milad
  • 11
  • 1
1
vote
0 answers

Constraint on standard deviation of counts always zero

I'm currently trying to solve a scheduling problem for a sports team. My decision variables are declared as: dvar int plays[Games][0..1] in Teams; Where Games is a range from 0..19 and Teams is a range from 0..9 in this specific case. This forms a…
1
vote
1 answer

Passing data to OPL model from Java

I have OPL .mod model and I run it from Java code. The model needs some external data. Currently model loads the data from .dat file with IloOplFactory.createOplRunConfiguration(String modelName, String[] dataFiles) method. I want to load the data…
Michail L
  • 37
  • 1
  • 4
1
vote
1 answer

0-1 knapsack using python cplex

I'm trying to solve a slight modification of a 0-1 knapsack problem, where each item is a vector of values from which one value is chosen, instead of a scalar using Python Cplex. This is a variant of a Mixed integer problem. I wrote a IBM OPL…
0x0
  • 2,915
  • 5
  • 40
  • 67
1
vote
1 answer

Issue with IBM Optimization Studio CPLEX OPL?

I develop a program using IBM Optimization Studio CPLEX(OPL), I tried to do this line : If (P_p(t) >= (P_L(t))/(Einv )) Pb(t) = Pb0+(Eb_c/3600)*(Pp(t)-P_L(t))/Einv) t Є {t0,t0+1,,t0+nΔt} , Δt: step time I did something like that : maximize…
prof122
  • 23
  • 5
1
vote
2 answers

Turning off Presolve option in CPLEX OPL

Does anyone know how to disable "presolve" in CPLEX? (without using Java, C++, etc.) My CPLEX Version is 12.4, in case it makes a difference. Thanks in advance,
Dubeddo
  • 135
  • 2
  • 4
  • 12
1
vote
1 answer

In CPLEX, How can I use variables in forall loop syntax?

I wanna use variables in cplex forall syntax like as below.. forall(j in {1,2,3,4,5,6,7}) { x[1][j] + x[1][(j+3)%7] + x[1][(j+4)%7] + x[1][(j+5)%7] + x[1][(j+6)%7] + x[2][j] + x[2][(j+3)%7] + x[2][(j+4)%7] + x[2][(j+5)%7] + x[2][(j+6)%7] >=…
1
vote
1 answer

initializing a set in cplex/opl

i am currently working on establishing a negotiation between a buyer and a supplier on basis of the multi-capacitated lot sizing problem, implemented in cplex. in a small scenario, the buyer is producing items 1-4, whereas the supplier is…
inkognito
  • 11
  • 3
0
votes
2 answers

Why does cplex return a solution which doesn't meet the constraints?

int n=6; int a[1..n] = [12,0,10,4,10,8]; dvar int x in 0..1; maximize x; subject to { forall(i,j in 1..n) (i!=j && a[i]==a[j]) => x==0; } Since there is a duplicate inside the array a, x should be 0 but cplex returns 1, why?
Josh.K
  • 3
  • 1
  • 3
0
votes
0 answers

cplex out of memory 1001 - CPLEX flow control

I am trying to solve a complex MILP, however, CPLEX keeps going out of memory (cplex out of memory 1001). This happens because the memory (RAM) allocated to CPLEX is insufficient to store the tree (in branch n bound). I found a way to move this to…
Damsara
  • 1
  • 1
0
votes
1 answer

Problem with reading the values of variables in constraint programming (CP)

I am trying to access the variables of my optimization problem solved with constraint programming (CP) in Cplex Opl IDE. In the previous versions of Cplex, I used to reach the variable values through the "problem browser" module. But now, I can't…
sorour
  • 49
  • 6
0
votes
0 answers

A problem with the solution graph appearing in the statistics tab using constraint programing in Cplex Opl Studio

I am using CPLEX studio IDE version 22.1.1, and I am solving my problem using Constraint Programming (CP). I have a little issue with the statistics tab of my solution. There is a chart on the right side of this section presenting the…
sorour
  • 49
  • 6
0
votes
1 answer

CPLEX inserting results to Excel Sheet in main method

I am creating a project where I have one model where one variable is always changing, namely ForecastMultiplier. I need to put the results of each iteration into an excel spreadsheet. You can find main down below: main { var source = new…
Anduliska
  • 11
  • 2