Wednesday, March 9, 2011

dump/restore function in AMPL by Bob Fourer

Sometimes solving a mathematical programming problem is a quite time consuming. So we need to store the solution in the file and hope to restore it next time when we load the model and data. Hopefully AMPL is capable of doing that:

If you give the command of the form

  write bfilename;

before the solve command, then the solution file that the solver sends back
to AMPL will be a permanent file "filename.sol" rather than a temporary
file.  Then if you leave AMPL and later return, you can read back the model
and data files -- and whatever else you need to do to return the current
problem to the state it was in at the previous solve -- and then read back
the previous solution with the command

  solution filename.sol;

There is not a facility to dump the entire state of AMPL at a certain point,
however.

Bob Fourer
4er@ampl.com

No comments:

Post a Comment