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

Interfacing for external interaction #144

Merged
merged 5 commits into from
Jan 31, 2025

Conversation

Dekker1
Copy link
Contributor

@Dekker1 Dekker1 commented Jan 30, 2025

This PR is made with users of huub as library in mind. With these changes, it is possible to add your own Brancher and Propagator implementations to Solver. The modelling layer has been fully rewritten, still allowing the analyses of known constraints, but also allowing custom Constraint implementations.

This also exposes the propagators to the users.
This change separates most of the behaviour of constraints in Model
objects into their own structures, allowing the addition of user-custom
constraints. However, it maintains the identify of the different
constraints for library-defined constraints. This ensures we can still
perform a global analysis of the model.
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 68.75187% with 1044 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/huub/src/lib.rs 55.27% 377 Missing and 13 partials ⚠️
crates/huub/src/constraints/int_linear.rs 82.40% 90 Missing and 14 partials ⚠️
crates/huub/src/solver.rs 66.87% 102 Missing and 2 partials ⚠️
crates/huub/src/flatzinc.rs 43.97% 73 Missing and 6 partials ⚠️
crates/huub/src/constraints/int_times.rs 52.38% 70 Missing ⚠️
crates/huub/src/reformulate.rs 75.65% 36 Missing and 1 partial ⚠️
crates/huub/src/constraints/int_abs.rs 62.63% 34 Missing ⚠️
crates/huub/src/constraints/int_in_set.rs 0.00% 33 Missing ⚠️
crates/huub/src/constraints/int_array_element.rs 75.21% 25 Missing and 4 partials ⚠️
crates/huub/src/constraints/bool_array_element.rs 0.00% 25 Missing ⚠️
... and 15 more
Files with missing lines Coverage Δ
crates/huub/src/solver/activation_list.rs 91.80% <ø> (ø)
crates/huub/src/solver/bool_to_int.rs 88.57% <100.00%> (ø)
crates/huub/src/solver/queue.rs 100.00% <ø> (ø)
crates/huub/src/solver/trail.rs 97.96% <100.00%> (ø)
crates/huub/src/tests.rs 96.77% <100.00%> (-0.20%) ⬇️
crates/huub/src/constraints/disjunctive_strict.rs 98.19% <98.70%> (ø)
crates/huub/src/constraints/int_all_different.rs 94.53% <93.61%> (ø)
crates/huub/src/actions.rs 88.00% <80.95%> (+9.95%) ⬆️
crates/fzn-huub/src/trace.rs 44.85% <0.00%> (ø)
crates/huub/src/constraints/int_array_minimum.rs 95.41% <95.41%> (ø)
... and 20 more

@Dekker1 Dekker1 force-pushed the feat/constraints branch 4 times, most recently from 4b88793 to b3eb0bc Compare January 31, 2025 04:45
Copy link

codspeed-hq bot commented Jan 31, 2025

CodSpeed Performance Report

Merging #144 will degrade performances by 38.45%

Comparing Dekker1:feat/constraints (a275fd7) with develop (3ec9408)

Summary

⚡ 1 improvements
❌ 1 (👁 1) regressions
✅ 12 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
optimization[portal_10_9_10] 469.7 ms 419.7 ms +11.9%
👁 satisfaction[amaze3_2012_03_19] 773.5 ms 1,256.7 ms -38.45%

@Dekker1 Dekker1 merged commit a275fd7 into huub-solver:develop Jan 31, 2025
10 of 11 checks passed
@Dekker1 Dekker1 deleted the feat/constraints branch January 31, 2025 07:55
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.

1 participant