--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Thanks, Paras, I understand, but what I wanted to achieve, was the detection of an AMPL-presolve-error without invoking CPLEX via solve ...(?)
On Wed, Apr 18, 2018 at 8:21 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
AMPL provides command to modify data and model from the run file. You can read more about it https://ampl.com/BOOK/CHAPTERS/14-command.pdf. For your specific problem:
Let's say you have a model file as follows:
param lb;
var x>=lb,<=1;
minimize f: x;
lb is a param that I am going to set from the run file. In run file, I will have something as follows:
model dummy.mod;
let lb :=3;
solve;
if solve_result_num >=200 and solve_result_num <= 299 then let lb:=1;
solve;
Initially, I assigned lb = 3, so that x>=3,<=1, and the problem will be infeasible. I could detect the infeasibility in the presolve phase by comparing the solve_result_num. You can find about the status code at https://ampl.com/NEW/statuses.html. After detecting the infeasibility, I could use the modeling commands to change the data.
Thanks,
Paras
--
Paras Tiwari
am...@googlegroups.com
The solve command invokes AMPL presolve and sends the problem to CPLEX only if the problem passes the presolve phase. You can read about presolve at https://ampl.com/BOOK/CHAPTERS/17-solvers.pdf .
--
Paras Tiwari
am...@googlegroups.com
On Fri, Apr 20, 2018 at 7:53 PM UTC, Ampl Modeling Language <am...@googlegroups.com> wrote:
Thanks, Paras, I understand, but what I wanted to achieve, was the detection of an AMPL-presolve-error without invoking CPLEX via solve ...(?)
On Wed, Apr 18, 2018 at 8:21 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
AMPL provides command to modify data and model from the run file. You can read more about it https://ampl.com/BOOK/CHAPTERS/14-command.pdf. For your specific problem:
Let's say you have a model file as follows:
param lb;
var x>=lb,<=1;
minimize f: x;
lb is a param that I am going to set from the run file. In run file, I will have something as follows:
model dummy.mod;
let lb :=3;
solve;
if solve_result_num >=200 and solve_result_num <= 299 then let lb:=1;
solve;
Initially, I assigned lb = 3, so that x>=3,<=1, and the problem will be infeasible. I could detect the infeasibility in the presolve phase by comparing the solve_result_num. You can find about the status code at https://ampl.com/NEW/statuses.html. After detecting the infeasibility, I could use the modeling commands to change the data.
Thanks,
Paras
--
Paras Tiwari
am...@googlegroups.com
AMPL's presolve procedure does set solve_result and solve_result_num appropriately when it finds that there is no solution possible. Here is a simple example:{#HS:564068131-5541#}
ampl: solve;
presolve, variable Buy['FISH']:
impossible deduced bounds: lower = 105, upper = 100;
difference = 5
ampl: display solve_result,solve_result_num;
solve_result = infeasible
solve_result_num = 299
The same solve_result and solve_result_num values are set when presolve returns a "constraint . . . cannot hold" message. Are you encountering a situation where presolve reports infeasibility but your script cannot detect infeasibility by testing solve_result and solve_result_num?
--
Robert Fourer
am...@googlegroups.com
On Sat, Apr 21, 2018 at 3:18 AM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
The solve command invokes AMPL presolve and sends the problem to CPLEX only if the problem passes the presolve phase. You can read about presolve at https://ampl.com/BOOK/CHAPTERS/17-solvers.pdf .
--
Paras Tiwari
am...@googlegroups.com
On Fri, Apr 20, 2018 at 7:53 PM UTC, Ampl Modeling Language <am...@googlegroups.com> wrote:
Thanks, Paras, I understand, but what I wanted to achieve, was the detection of an AMPL-presolve-error without invoking CPLEX via solve ...(?)
...