Question

I can get the number of variables using _nvars. Then, I tried _niters and _niterations but don't work.

I have also searched it in the manual unsuccessfully.

Is there a simple way to get the number of iterations, other than extracting it from solve_message (e.g. with regular expressions)?

Was it helpful?

Solution

To the best of my knowledge there is no built-in parameter representing a number of iterations in AMPL. In fact, this is very solver specific and different solvers and even different algorithms within a single solver may have multiple different iteration counts, such as MIP iterations, Simplex iterations, master iterations when using decomposition, etc. Your best bet is probably to parse the solver message.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top