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

Update to pindakaas with generic propagator interface #134

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading