Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以使用_nvars. 然后,我尝试了_niters,_niterations但没有工作。
_nvars
_niters
_niterations
我也在手册中搜索了它,但没有成功。
有没有一种简单的方法来获取迭代次数,而不是从solve_message(例如使用正则表达式)中提取它?
solve_message
据我所知,AMPL 中没有代表多次迭代的内置参数。事实上,这是非常特定于求解器的,不同的求解器,甚至单个求解器中的不同算法可能有多个不同的迭代计数,例如 MIP 迭代、Simplex 迭代、使用分解时的主迭代等。你最好的选择可能是解析求解器消息。