All Questions
385 questions
0
votes
2
answers
38
views
Docplex: KeyError: (-1, 0) when attempting to add a constraint that makes the first value have to equal the last
Part of my model states that the initial value of a time series should always equal the last. When modelling this for just one time series, the constraint is added no problem.
m.add_constraint(var_1[-...
0
votes
2
answers
84
views
Installing IBM ILOG CPLEX academic version for use with python
I am struggling to activate the academic version of CPLEX for use in docplex. I had tried following the steps outlines in https://www.ibm.com/docs/en/icos/22.1.2?topic=cplex-setting-up-python-api, but ...
0
votes
1
answer
97
views
IBM CPLEX does not have a python folder on install
I have installed IBM CPLEX Studio 2212, and am attempting to verify that I have installed the academic version to remove the limit on DOCPLEX. However, upon install there is no python folder in the ...
0
votes
1
answer
28
views
Docplex use for timeseries based variables
I am trying to model an optimisation problem where each item in a list is essentially power generated at that hour. I am trying to minimise the amount of energy stored while still getting the same ...
0
votes
1
answer
35
views
Docplex and callback problems
I’m trying to implement a custom callback that solves a subproblem during the optimization process. I want to:
Get the values of certain variables from the main model's solution.
Solve a subproblem (...
0
votes
1
answer
43
views
Limit the memory used when solving using docplex
I am implementing a mathematical model using docplex and the academic version of CPLEX.
I am attempting to solve very big problem instances.
I faced a MemoryError.
Is there a way to overcome this? I ...
0
votes
1
answer
102
views
In CPLEX 2212 version in LINUX no CPLEX runtime found
I tried to run CPLEX full version to run my models , tried with pycharm using python 3.9 as the version. but the issue-
docplex.mp.utils.DOcplexException: Cannot solve model: no CPLEX runtime found.
...
0
votes
0
answers
42
views
I want to change the input of an optimization problem and store the solution of the optimization problem for every input
Python code for one input is given below:
from doopl.factory import create_opl_model
Damage_Nodes = [
(8,), (9,), (12,) , (16,) , (19,) , (23,) , (24,) , (27,) , (30,),
]
model_path = "C:/...
0
votes
1
answer
37
views
How to input a set into an OPL (Optimization Programming Language) model using Python
In OPL for input set we are defining as given below:
tuple Damage_line_Nodes {
int value;
};
// Declare a set with a few tuples
{Damage_line_Nodes} Damage_line_Node = ...;
In python (we are trying ...
0
votes
1
answer
52
views
How to provide input to an OPL model in CPLEX using Python and then print the solution of the OPL model in Python?
We have five scenarios, each with a different set of damaged nodes. We want to input the set of damaged lines into the OPL model one scenario at a time, storing the result in Python for each scenario. ...
0
votes
1
answer
75
views
CPU Time for CPLEX in Python docplex.mp
I am running an optimization model using the Python API of CPLEX, docplex.mp.
Right now it looks like this:
from docplex.mp.model import Model
import time
mdl = Model()
# variables, constraints and ...
0
votes
1
answer
171
views
How to install cplex python API on mac os
I am using mac M1 with Sonoma 14.5 and trying to install the cplex warper for Python. CPLEX 22.1.1. is already installed on my machine and works with docplex, the IDE and oplrun.
When trying to ...
0
votes
0
answers
59
views
In Python, Docplex reports BrokenPipeError and Invalid argument when solving a particularly large cp model
The model is solved fine, but when the model is relatively large (150,000 variables, 620,600 constraints), cp.solve() reports an error
"0SError: [Errno 22] Invalid argument" in self.pout....
0
votes
1
answer
91
views
Can't install picos in Python 3.7
I am trying to solve a mathematical problem using python 3.7.0 . For this I've installed CPLEX 12.10 and I decided to install some dependencies, like numpy, prettytable and picos. Numpy and ...
1
vote
2
answers
99
views
Use ProgressListener with multiobjective in docplex (CPLEX)
I am translating an implementation of a gurobi model to cplex which uses multi-objective functionality and uses the following callbacks. The purpose of the callbacks is to extract the information from ...