« Return to Thread: [AMPL 1851] iterations

[AMPL 1854] Re: iterations

by Robert Fourer-2 :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.

There is no builtin parameter that contains the number of iterations, unless the solver's interface has been written to create such a parameter.  And I don't know of any solver interfaces that does create such a parameter.

 

With most solvers, however, you can use the builtin parameter Initial.message to get a brief optimality message that contains the number of iterations.  (Initial is always the name of the current AMPL "problem" if you don't define a name.)  For example,

 

ampl: model nltransd.mod;

ampl: data nltrans.dat;

ampl: option solver minos;

 

ampl: solve;

MINOS 5.5: optimal solution found.

65 iterations, objective 427568.1225

Nonlin evals: obj = 139, grad = 138.

 

ampl: display Initial.message;

Initial.message = 'MINOS 5.5: optimal solution found.\

65 iterations, objective 427568.1225\

Nonlin evals: obj = 139, grad = 138.'

 

Initial.message is an AMPL string-valued item, and so you can apply AMPL's string functions to it to extract particular sub-strings, such as the number of iterations.  See section A.4.2 in the AMPL book for specifics.

 

Bob Fourer

4er@...

 

 


From: ampl@... [mailto:ampl@...] On Behalf Of Dr. P K Modi
Sent: Sunday, June 22, 2008 4:54 AM
To: info@...; ampl@...
Subject: [AMPL 1851] iterations

 

What variable name is assigned to iterations so that I can use the number of iterations in my solution report. It is displayed on the AMPL command window but I want to sava it on line.

Dr. P. K. Modi




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


 « Return to Thread: [AMPL 1851] iterations

LightInTheBox - Buy quality products at wholesale price!