argmin-rs / argmin

Numerical optimization in pure Rust
http://argmin-rs.org
Apache License 2.0
1.01k stars 79 forks source link

Timeout #332

Closed thibc81 closed 9 months ago

thibc81 commented 1 year ago

Hi

is there an option to specify a timeout in the Executor to abort the solver after a certain duration?

Thanks!

stefan-k commented 1 year ago

Unfortunately no but this would be a great feature! It should be rather easy to add if a bit of "inaccuracy" is acceptable. What I mean by this is that the condition whether the timeout is reached would be checked at the end of each iteration, meaning that in the worst case, it would stop one iteration after the timeout is reached. An exact timeout handling would be more difficult to achieve and I don't think it would be worth the additional complexity.