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

How to create a multi-objective model with objective priority

I'm trying to solve a multi-objective problem in which I have to minimize two different objectives but with one taking priority over the other one. To solve the problem, and hence the question, I tried to use weighted sum of both objective…
John
  • 37
  • 3
1
vote
0 answers

Why is my tuple for time breakpoints [m, m+1] not working?

I hope that somebody can help me. I modeled a vehicle routing problem with time windows and outsourcing option, in addition I want to make the model time dependent. To do this I made some time zones that need to be connected …
eva
  • 11
  • 1
1
vote
1 answer

How to fix errors when using opl.end() in main flow control loop

I'm batch running tens of thousands of tests using a loop inside a main flow control block. Each run of the loop spawns a new OPL model using the designated .dat data file and .mod model file (which is separate from the batch runner .mod file which…
Jordan Ticktin
  • 435
  • 4
  • 8
1
vote
1 answer

How to write average constraints in CPLEX OPL?

I have several questions regarding modelling constraints. I guess it should be really simple, but I am unable to figure it out. First, let me sketch the situation: I would like to optimize a multi-dimensional knapsack problem. However, I get some…
Snowflake
  • 2,869
  • 3
  • 22
  • 44
1
vote
1 answer

How is the lower bound that is displayed created?

my Flexible Job Shop Problem (CP) shows me a result of Best objective :423 (gap is 49,88%) and Best bound: 212. So my question is how is this bound created? Because In my case the lowest value that can be theoretical achived is in the area…
Alex
  • 71
  • 6
1
vote
3 answers

Is it possible to solve a CP formulated problem with the CPLEX-Engine without transforming the model?

I have formulated a flexible job shop problem as a CP model like it is advised in CPLEX Optimization Studio. The problem is running and creates correct schedules. So my question is if there is a possibilty also to let this problem be solved with the…
Alex
  • 71
  • 6
1
vote
0 answers

Import .dat file in JS

This may seem like a silly question as I am starting to study JS... I have a .dat file called adressCoordinates looking like this : addressBase = { <1.9600642,48.4508028, "39 Rue des Pavillons", 91410, "Authon-la-Plaine", "France">, …
Elliott Addi
  • 370
  • 4
  • 18
1
vote
1 answer

Traversing the elements of set in a set of tuples using OPL

I am trying to model a problem using OPL, cplex. I got stuck at a constraint. I have a set of tuples in the format: N_set = { <1, {180}> <8, {546, 154}> <11, {193, 532, 43, 363}> ... }; So I basically try to use a map structure. Given an…
begumgenc
  • 393
  • 1
  • 2
  • 12
1
vote
1 answer

How to define a sequence dependant constraint?

I want to model a constraint where I want to say if a mode mode1 is scheduled on a sequence before another mode mode2 then a mode mode3 on a parallel working machine (so in an other sequence) cannot be started before the end of mode1 in an other…
Alex
  • 71
  • 6
1
vote
1 answer

How to code in a flexible job shop that the successor of an operation is done on the same machine?

In the model we have 3 operations that have to be performed for each Job. I would like that if operation 1 is processed in a machine of type OR, operation 2 and operation 3 also have to be performed on the same machine of type OR if they are…
Alex
  • 71
  • 6
1
vote
1 answer

Why do I get only a relaxed solution to my model?

I try to code the model of Nourinejad et al 2005 "Vehicle relocation and staff rebalancing in one-way carsharing systems". There are no errors in my model, but I get only a relaxed solution. I don't understand why. int n = 4; range user =…
piezi1203
  • 11
  • 1
1
vote
1 answer

Create a list of tuples in OPL with scripting based on conditions

I'm trying to write a script in OPL that will take a nxm matrix of 1s and 0s, and return for each n, the corresponding m where the value is 1. Let's say I've defined my data like this: col = {"r1","r2","r3"}; row = {"s1","s2"}; value = [ [1 0 1] …
John Lee
  • 35
  • 4
1
vote
1 answer

How do I use forall or an aggregator in the objective function?

I have a decision variable x[i,j] which is 1 or 0 where I want to maximize the sum of each row. I want to use something like forall but it seems like it will only let me use that in the constraints. Is there a way to use it for the objective…
John Lee
  • 35
  • 4
1
vote
1 answer

How to avoid scheduling conflicts for a timetable problem

I'm trying to create a schedule for shifts for each employee given employee shift availability. I have a tuple defined to include shift start time, shift end time, max people on shift. The input also includes a list of arrays for employee shift…
John Lee
  • 35
  • 4
1
vote
1 answer

How to set time limits to sub models?

I want to limit the whole run time to be 1800 s for the given configuration which consists of main problem through which sub-problems:1 & 2 are called. In addition to this, can you please tell me how to set the time limit differently for…
sam
  • 31
  • 3