Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set exit status based on success/failure? #12

Open
rpgoldman opened this issue Oct 10, 2023 · 2 comments
Open

Set exit status based on success/failure? #12

rpgoldman opened this issue Oct 10, 2023 · 2 comments

Comments

@rpgoldman
Copy link

For integrating pandaPIengine into pipelines, scripts, etc. it would be helpful if it was easy to tell whether it had succeeded in finding a plan or not.

For this, it would help if the exit status was set to 2 (or some other designated value) on search failure. Looking at the code, it seems like an exit status of 1 is reserved for an error condition.

I have had a start at trying to make a MR for this. It seems to be straightforward for translation mode, and mostly straightforward for the heuristic search mode, but for the SAT planner option, I can't figure out all of the ways that solve_with_sat_planner and its subsidiary function solve_with_sat_planner_linear_bound_increase can exit (the while(true) loop in the latter I can't figure out -- how does it exit on failure here?)

Any suggestions?

@galvusdamor
Copy link
Collaborator

Thanks for starting the work!

As for the SAT solver, basically whenever the call returns anything other than 10 or 20, this is an error (except if we set terminations, which we don't). I've just pushed a commit that checks for this and exits the program with code 2 if this happens.

Could you add your PR?

@rpgoldman
Copy link
Author

I have a shot at it in #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants