« Return to Thread: [AMPL 1851] iterations
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
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
« Return to Thread: [AMPL 1851] iterations
| Free Forum Powered by Nabble | Forum Help |