Closed sebrockm closed 1 year ago
Hi, You might have some luck with either setMaximumSeconds() or setMaximumIterations(). Documentation on Doxygen can be found here
Thanks for the quick answer! Yes, that looks rather obvious. No idea how I missed that...
I will run some tests with it and, if everything works as expected, close this issue. Thanks again!
Yep, it works, exactly what I was looking for, thanks @Iain-R!
BTW, the reason why I didn't find it myself was that I only looked into ClpSimplex
's documentation where only inherited member variables show up, but no inherited methods. Is that on purpose?
Still, my bad that I didn't look at the base class.
In my C++ project I'm solving linear programs using
ClpSimplex::primal
andClpSimplex::dual
. Unfortunately, for some instances this takes very long and I cannot find a way to terminate them. I would imagine something like a timeout parameter or stop token. Have I missed anything in the docs?My current workaround is to spawn them on a different thread and simply detach from that if the solution is not available after some time. This at least allows my program flow to continue, but still one CPU core is busy and lots of memory is being consumed for an uncertain amount of time.