-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Add logging for branchers #135
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am worried that the statistics are now overwhelming. Turning on statistics will flood the terminal with stats. Should we consider somehow grouping them to turn on specific statistics?
Review re-requested
pub enum IteratedSolution<'a> { | ||
/// A new solution was identified. | ||
Solution(Solution, &'a Solver), | ||
Solution(Solution, &'a Solver, &'a dyn Brancher), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use dyn
here? In all the other solve results we are generic over Brancher
.
pumpkin-solver/src/api/solver.rs
Outdated
pub fn optimise<Var: IntegerVariable, Callback: Fn(&Solver, SolutionReference)>( | ||
pub fn optimise< | ||
Var: IntegerVariable, | ||
Callback: Fn(&Solver, SolutionReference, &dyn Brancher), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why dyn
here? If we explicitly make a generic for impl Brancher
then we can re-use that type in the signature here.
@@ -14,15 +14,24 @@ use crate::Solver; | |||
pub mod linear_sat_unsat; | |||
pub mod linear_unsat_sat; | |||
|
|||
pub trait OptimisationProcedure<Var: IntegerVariable, Callback: Fn(&Solver, SolutionReference)> { | |||
pub trait OptimisationProcedure< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the generics here? They do not seem to be used in any of the function signatures.
Review re-requested
Currently, we only log statistics for propagators; however, it also makes sense to do this for branchers.
This PR proposes to add an additional method to the interface which logs statistics for branchers. A use-case is shown for our implementation of autonomous search.