Changing CPLEX time limit during an AMPL execution

225 views
Skip to first unread message

Francesc López

unread,
Jan 29, 2012, 9:04:23 AM1/29/12
to AMPL Modeling Language, francisco....@upc.edu
Hi to everyone,
I was wondering if it’s possible to change the
CPLEX time limit during the AMPL execution. I’m running a set of ILP
problems as part of the resolution of a big problem, so that I need to
call several times CPLEX. The whole amount of time cannot reach a
certain value.

I tried to change at every loop that cplex time limit option as
follows:

let tlim:= tlim - _solve_time;
let stlim:= 'timelimit=' & tlim
option cplex_options (stlim);

where,

solve_time is the time that CPLEX takes to solve the current ILP
problem.
Stim is a string containing the CPLEX directive
Tlim is the total elapsed time since the algorithm has started

I noticed that that directive only takes effect at the first CPLEX
call.

What can I do?

Best Regards,

Francesc.

Robert Fourer

unread,
Jan 31, 2012, 1:06:25 PM1/31/12
to am...@googlegroups.com
After defining "param tlim" and "param stlim symbolic" I could find nothing
wrong with your AMPL statements. But it's not clear what you mean when you
say that the "directive only takes effect at the first CPLEX call." Is the
value of tlim or stlim or cplex_options not changing from one pass through
the loop to the next? Is _solve_time equal to zero? Or is it that
cplex_options is being changed but CPLEX is ignoring it? In any case, it
may be necessary to consider the entire loop and not just these three
statements in order to determine what the problem is.

Bob Fourer
4...@ampl.com

Reply all
Reply to author
Forward
0 new messages