Skip to content

Commit

Permalink
Update to pindakaas with generic propagator interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekker1 committed Oct 28, 2024
1 parent 1d3f796 commit 7b654a7
Show file tree
Hide file tree
Showing 29 changed files with 292 additions and 393 deletions.
121 changes: 46 additions & 75 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions crates/fzn-huub/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::{
use flatzinc_serde::{FlatZinc, Literal, Method};
use huub::{
FlatZincError, FlatZincStatistics, Goal, InitConfig, LitMeaning, ReformulationError,
SlvTermSignal, SolveResult, Solver, SolverView, Valuation,
SlvTermSignal, SolveResult, Solver, SolverView, Valuation, Value,
};
use pico_args::Arguments;
use tracing::{subscriber::set_default, warn};
Expand Down Expand Up @@ -342,7 +342,7 @@ where
warn!("--all-solutions is ignored when optimizing, use --intermediate-solutions or --all-optimal instead");
}
let mut no_good_vals = vec![
None;
Value::Bool(false);
if self.all_optimal {
output_vars.len()
} else {
Expand Down Expand Up @@ -608,7 +608,7 @@ impl Solution<'_> {
Literal::Int(i) => format!("{i}"),
Literal::Float(f) => format!("{f}"),
Literal::Identifier(ident) => {
format!("{}", (self.value)(self.var_map[ident]).unwrap())
format!("{}", (self.value)(self.var_map[ident]))
}
Literal::Bool(b) => format!("{b}"),
Literal::IntSet(is) => is
Expand Down Expand Up @@ -640,11 +640,7 @@ impl Display for Solution<'_> {
.join(",")
)?;
} else {
writeln!(
f,
"{ident} = {};",
(self.value)(self.var_map[ident]).unwrap()
)?;
writeln!(f, "{ident} = {};", (self.value)(self.var_map[ident]))?;
}
}
writeln!(f, "{}", FZN_SEPERATOR)
Expand Down
2 changes: 1 addition & 1 deletion crates/huub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ flatzinc-serde = { workspace = true }
index_vec = "0.1.3"
itertools = "0.13.0"
pindakaas = { git = "https://github.com/pindakaashq/pindakaas.git", features = [
"ipasir-up",
"external-propagation",
] }
rangelist = "0.2"
thiserror = "1.0.63"
Expand Down
Loading

0 comments on commit 7b654a7

Please sign in to comment.