Matthias Fripp
unread,Jul 15, 2011, 12:10:43 PM7/15/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AMPL Modeling Language
There may be an easy way to do this, but I haven't found it. Under
certain conditions, I would like my ampl script (called from an
interactive session) to abort and return to the command line, e.g., so
I can use various commands to diagnose the model. I believe that
"exit" or "quit" will quit from ampl, which is not what I want. I
tried "end", but ampl treats that like an "end of file" marker even if
it's within an if statement. This is the closest I've come so far:
solve;
if solve_result = "infeasible" then {
printf "Problem is infeasible; halting."
display 0/0; # exit the script
}
I'm using "display 0/0;" because this doesn't cause an error when I
load the script, but does cause one at run time, interrupting script
execution. Is there anything I could use in place of this that would
be neater?
Matthias