Re: [AMPL 6520] Reading .sol file after running Bonmin on .nl file

333 views
Skip to first unread message

Pietro Belotti

unread,
Jan 27, 2013, 11:52:34 AM1/27/13
to am...@googlegroups.com
The .sol file only contains information about the best solution found by Bonmin. The output by Bonmin, however, contains what you are looking for: search for the line of the output containing "Search completed"; that line contains both the objective function value of the best solution found and the CPU time, although I am not sure whether the latter refers to the Branch and bound only. If you are on a *nix terminal, precede your command with "time ".

Hope this helps.

Pietro


On Sun, Jan 27, 2013 at 9:12 AM, <shau...@gmail.com> wrote:
Hello,

I am trying to obtain information such as cpu time and optimal objective value on solving MINLP problems by running Bonmin directly from the terminal on .nl-files. An output .sol file is produced for each solution. However, I am not quite sure how to obtain the information from these files.

I tried running: "ampl -obstub filname.sol" but that gives me a syntax error with the output: "syntax error context:   >>> bonmin: <<<  Optimal".

How can I resolve this issue?

Any help is greatly appreciated :)

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to am...@googlegroups.com.
To unsubscribe from this group, send email to ampl+uns...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Robert Fourer

unread,
Jan 28, 2013, 8:10:15 PM1/28/13
to am...@googlegroups.com

If you want AMPL to show you the solution that's reported in a .sol file, you need to re-load the model and then use the "solution" command to read in the contents of the file.  The general idea is like this:

 

   model trans.mod;

   data trans.dat;

   solution trans.sol;

   display ... >file;

 

If you don't want to do this interactively you can put all of these commands in a file, say "transout.run", and then execute the file as a script with a command like "ampl transout.run".

 

If you write a text .nl file then you'll get a text .sol file back, so you can see exactly what's in it.  However, as explained in the previous post, it does not contain the objective value or the time.

 

Bob Fourer

4...@ampl.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of shau...@gmail.com
Sent: Sunday, January 27, 2013 8:13 AM
To: am...@googlegroups.com
Subject: [AMPL 6520] Reading .sol file after running Bonmin on .nl file

Reply all
Reply to author
Forward
0 new messages