[AMPL 24771] Capturing Result

Hi, I’m using path solver in my project but when I’m running the following script code in my .run file:

model test14.mod;

solve;

display cost;

display x;

printf “cost,pathflows,\n” > “results.csv”;

for {i in 1…Total_Num_Var} {

printf “%f,”, cost[i] >> “results.csv”;

printf “%f,”, x[i] >> “results.csv”;

}

for {i in 1…80} {

printf “%f\n”, LinkFlows[i] >> “resultLinkFlow.csv”;}

close “results.csv”;

close “resultLinkFlow.csv”;

close {results_out};

I received the following error:

** EXIT - solution found.

Major Iterations. . . . 34

Minor Iterations. . . . 30022

Restarts. . . . . . . . 2

Crash Iterations. . . . 4

Gradient Steps. . . . . 12

Function Evaluations. . 329

Gradient Evaluations. . 41

Basis Time. . . . . . . 182.244000

Total Time. . . . . . . 190.953000

Residual. . . . . . . . 8.398294e-09

Postsolved residual: 8.3983e-09

Path 5.0.05: Solution found.

38 iterations (4 for crash); 30022 pivots.

329 function, 41 gradient evaluations.

Error at _cmdno 174 executing “solve” command

(file temp.run, line 18, offset 409):

Solution obtained using an unauthorized or unknown solver. Please contact support@ampl.com.

So I can’t capture my results to save in an Excel file.

I would appreciate it if you let me know how can I fix it.

Hi Nastaran,

The Path solver is not part of the solvers authorized to be used with AMPL CE licenses. You can use AMPL CE with selected open-source solvers (CBC, HiGHS, Couenne, Bonmin, Ipopt, SCIP, and GCG) and commercial solvers during solver trials. To use the Path solver you will need a full-featured AMPL license, which you can request at https://portal.ampl.com/user/ampl/request/trial