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

feat: Add logging for branchers #135

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

ImkoMarijnissen
Copy link
Contributor

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.

Copy link
Contributor

@maartenflippo maartenflippo left a 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?

pub enum IteratedSolution<'a> {
/// A new solution was identified.
Solution(Solution, &'a Solver),
Solution(Solution, &'a Solver, &'a dyn Brancher),
Copy link
Contributor

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.

pub fn optimise<Var: IntegerVariable, Callback: Fn(&Solver, SolutionReference)>(
pub fn optimise<
Var: IntegerVariable,
Callback: Fn(&Solver, SolutionReference, &dyn Brancher),
Copy link
Contributor

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<
Copy link
Contributor

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.

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

Successfully merging this pull request may close these issues.

2 participants