Opening .sol files

149 views
Skip to first unread message

Pradyumn Shukla

unread,
Oct 3, 2015, 11:09:44 AM10/3/15
to AMPL Modeling Language
Dear AMLP users,

Does anyone know how to open the .sol files that are generated by AMPL? For example, if I use BARON with numsol=10, I get 10 .sol files

Solution1.sol
Solution2.sol
...
Solution10.sol

and I want to extract the information in them (optimal variable etc.).

Many thanks.
Pradyumn

Robert Fourer

unread,
Oct 5, 2015, 3:36:14 PM10/5/15
to am...@googlegroups.com
There is a "solution" command that reads a .sol file and extracts the values from it. For example:

solution Solution1.sol;

Also you can write a loop to read a series of solution files, as in this example:

for {i in 1..10} {
solution ('Solution' & i & '.sol');
...
}

In place of ... you would put the statements that process the solution.

Bob Fourer
am...@googlegroups.com

=======
Reply all
Reply to author
Forward
0 new messages