reinterpretcat / vrp

A Vehicle Routing Problem solver
https://reinterpretcat.github.io/vrp/
Apache License 2.0
348 stars 69 forks source link

Return current best solution on SIGTERM #119

Closed qwelias closed 1 year ago

qwelias commented 1 year ago

I haven't looked at the source yet, but from the current CLI behaviour max-time option interrupts solution search and returns the current best. Would it be possible to do the same upon receiving SIGTERM (or another signal in case of any conflicts)?

reinterpretcat commented 1 year ago

Yes, it is possible. At the moment, the search is also interrupted by ctrl+C combination when vrp-cli is used.

https://github.com/reinterpretcat/vrp/blob/master/vrp-cli/src/commands/solve.rs#L564-L589

qwelias commented 1 year ago

Nice, SIGINT works!