[AMPL 1851] iterations

View: New views
3 Messages — Rating Filter:   Alert me  

[AMPL 1851] iterations

by Dr. P K Modi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
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
-~----------~----~----~----~------~----~------~--~---


[AMPL 1852] Re: iterations

by Paul A. Rubin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




On Jun 22, 5:53 am, "Dr. P K Modi" <pkmodip...@...> wrote:
> 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.

I don't think the iteration count is returned separately to AMPL; it's
part of the solver's standard output.  If you name your problem,
the .message suffix will contain whatever message the solver spat out
after solving the problem, which apparently includes the iteration
count.  For instance,

# ... declaration of variables, constraints, objective here ...
problem P: ...;  # name the problem and list its components
solve;
display P.message;  # the iteration count should be in the message (?)

If you just want to write this to a file, you can write P.message.  If
you need the iteration count within a script, good luck.  AFAIK, AMPL
has no string parsing capabilities.

/Paul

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---


[AMPL 1854] Re: iterations

by Robert Fourer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
-~----------~----~----~----~------~----~------~--~---


LightInTheBox - Buy quality products at wholesale price