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)?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top