Skip to content

User defined callback for early termination? #3684

Discussion options

You must be logged in to vote

The answer is 'yes.' At least through the Python API. You return a list from eval: [1] to continue, [0] to terminate early.

Note: the documentation and examples for using the callback class correctly are not clear. For my use case, I had to override several of the built in methods, and figuring out what/how to override them correctly was a pretty tedious reverse engineering job.

Also, if you don't pass back a correct datatype from your eval function, the solver will barf and give an error message that repeats something to the effect "function_call returned type with exception" many, many times without explaining which types were acceptable. Lots of trial and error and there, lol.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gelatinouscube42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant