sending interrupt to AMPL

42 views
Skip to first unread message

Hossein Haghighat

unread,
Nov 27, 2022, 7:24:15 PM11/27/22
to AMPL Modeling Language
hello,
In Gurobi 9.5, Ctl+B caused the solver reports its best-found solution (stops proving optimality). In the new Gurobi 10,  this key causes AMPL to stop and it does not provide a solution. I was wondering if I am right and if there is another key for this.

AMPL Google Group

unread,
Nov 28, 2022, 6:10:21 PM11/28/22
to AMPL Modeling Language
Use Ctl+C to stop a solver and get the best solution that has been found. We have tested that this works with both the old "ASL" and the new "MP" version of Gurobi 10 for AMPL.


--
Robert Fourer
am...@googlegroups.com
{#HS:2080190856-113001#}

Hossein Haghighat

unread,
Dec 2, 2022, 12:47:26 AM12/2/22
to AMPL Modeling Language
hello,
I have noticed that sometimes what is printed in an output file (using "printf") is different from what is shown using the "display" command in the IDE. Is this a bug or normal? 

AMPL Google Group

unread,
Dec 2, 2022, 3:59:37 PM12/2/22
to AMPL Modeling Language
At the default setting, display shows numbers to 6 significant digits. (You can change this by setting non-default values for option display_precision or option display_round -- see Display Command Options at https://dev.ampl.com/ampl/options.html.) Also display can decide whether to use exponential notation (as in 1.23e+08 or 123000000) depending on what results in a shorter expression.

The printf command works differently. It includes a format string that specifies the appearance of each number, including the number of digits and the notation used. Thus an expression shown using display may appear differently than the same expression shown using printf.


--
Robert Fourer
am...@googlegroups.com
{#HS:2080190856-113001#}
On Fri, Dec 2, 2022 at 5:47 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
hello,

I have noticed that sometimes what is printed in an output file (using "printf") is different from what is shown using the "display" command in the IDE. Is this a bug or normal?
On Mon, Nov 28, 2022 at 11:09 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Use Ctl+C to stop a solver and get the best solution that has been found. We have tested that this works with both the old "ASL" and the new "MP" version of Gurobi 10 for AMPL.


--
Robert Fourer
am...@googlegroups.com

Hossein Haghighat

unread,
Dec 2, 2022, 11:33:25 PM12/2/22
to AMPL Modeling Language
thank you for your reply.
Actually, the number is an integer. Sometimes in the output file, it is 71 (wrong) but when I display it using "display" it is 72 (correct). 

AMPL Google Group

unread,
Dec 5, 2022, 11:49:24 AM12/5/22
to AMPL Modeling Language
The actual value in AMPL could be something like 71.99999999, which display will show (accurate to 6 significant digits) as 72:

ampl: param a = 71.99999999;
ampl: display a;
a = 72

But if in the output file a value like this is truncated, it will show as 71. To give more specific explanation, however, I would need a reproducible example.


--
Robert Fourer
am...@googlegroups.com
{#HS:2080190856-113001#}
On Sat, Dec 3, 2022 at 4:33 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
thank you for your reply.
Actually, the number is an integer. Sometimes in the output file, it is 71 (wrong) but when I display it using "display" it is 72 (correct).

On Fri, Dec 2, 2022 at 8:59 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
At the default setting, display shows numbers to 6 significant digits. (You can change this by setting non-default values for option display_precision or option display_round -- see Display Command Options at https://dev.ampl.com/ampl/options.html.) Also display can decide whether to use exponential notation (as in 1.23e+08 or 123000000) depending on what results in a shorter expression.

The printf command works differently. It includes a format string that specifies the appearance of each number, including the number of digits and the notation used. Thus an expression shown using display may appear differently than the same expression shown using printf.


--
Robert Fourer
am...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages