Generate out files

Hi,

I’m using amplpy. How can I generate .out files instead of .sol files ? I can’t read the .sol files

This is what I’m using in AMPL but I want to use it in AMPLPY:

option solver cplex;
option cplex_options ‘timing=1 lpdisplay=2 mipdisplay=2 poolstub=obj poolcapacity=5 poolreplace=1 timelimit=1800’;

solve;

for {n in 1…obj.npool} {

  • solution (“obj” & n & “.sol”);*
  • display x,z,y >(“obj” & n & “.out”);*
    }

Thanks in advance.

1 Like

Hi @juan.carlos,

In amplpy you can run that for loop in an eval call:

ampl = AMPL()
...
ampl.eval(r"""
for {n in 1..obj.npool} {
    solution ("obj" & n & ".sol");
    display x, z, y >("obj" & n & ".out");
}
""")