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

Adding choco #413

Merged
merged 119 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
40657cd
Creating branch and first tries
Dimosts Jun 5, 2023
f5ba83a
Merge branch 'master' into adding-choco
Dimosts Sep 1, 2023
bcf9070
Merge branch 'master' into adding-choco
Dimosts Sep 13, 2023
cef11d9
add choco as choice
Dimosts Sep 13, 2023
9416336
Update choco.py
Dimosts Sep 13, 2023
562b193
canonical_comparison transformation
Dimosts Sep 13, 2023
c7a7c5a
new transformation used in linearize
Dimosts Sep 13, 2023
6f3ccbf
solve and most in post_constraint
Dimosts Sep 13, 2023
13595a4
first version of post_constraint()
Dimosts Sep 13, 2023
3f36fd7
all supported global constraints
Dimosts Sep 14, 2023
e07940a
objective + solve()
Dimosts Sep 14, 2023
c6f1ded
Update __init__.py
Dimosts Sep 14, 2023
994c86f
Update utils.py
Dimosts Sep 14, 2023
32dcfa4
corrections
Dimosts Sep 14, 2023
fb89d1b
Merge branch 'master' into adding-choco
Dimosts Sep 14, 2023
5190498
Merge branch 'master' into adding-choco
Dimosts Sep 14, 2023
e93072e
correct input to Choco
Dimosts Sep 14, 2023
2037165
solveall() + time_limit exception
Dimosts Sep 15, 2023
74f744b
remove unsupported
Dimosts Sep 15, 2023
ecf379b
remove of only_bv_implies + add indomain + remove unneeded stuff
Dimosts Sep 15, 2023
8d34f71
fix finding optimal solution
Dimosts Sep 15, 2023
c10c6ed
tests for choco
Dimosts Sep 15, 2023
fc99aa3
cover all cases in tests
Dimosts Sep 15, 2023
727fb2c
forgotten skip
Dimosts Sep 15, 2023
a188ba3
remove unneeded checks + cover modulo extreme case
Dimosts Sep 15, 2023
15d5cd2
only_bv_reifies
Dimosts Sep 18, 2023
e7c29f5
reification + implications + correct transformations + cover cases fo…
Dimosts Sep 18, 2023
c94ec61
remove part from only_bv_implies
Dimosts Sep 18, 2023
a67ffc8
remove only_bv_implies test due to changes
Dimosts Sep 18, 2023
c589e1b
pychoco has a bug on finding all optimal solutions
Dimosts Sep 18, 2023
0bb056c
choco wants int and not np.int64
Dimosts Sep 18, 2023
63f2b23
correct solveAll count
Dimosts Sep 18, 2023
278c001
only_bv_reifies
Dimosts Sep 19, 2023
dee6f24
canonical comparison transformation
Dimosts Sep 19, 2023
4c88925
Merge branch 'canonical-and-reify-rewrite' into adding-choco
Dimosts Sep 19, 2023
24318fd
choco 1 0 instead of True False
Dimosts Sep 19, 2023
83a3971
only_implies
Dimosts Sep 19, 2023
ef92cbf
Merge branch 'canonical-and-reify-rewrite' into adding-choco
Dimosts Sep 19, 2023
3ef220d
minor
Dimosts Sep 19, 2023
fa33b57
minor
Dimosts Sep 19, 2023
6d09cde
minor
Dimosts Sep 19, 2023
7e71f0e
choco docs
Dimosts Sep 19, 2023
7c06bf0
style
Dimosts Sep 19, 2023
6d54a1e
test_only_implies
Dimosts Sep 19, 2023
88d782f
change order of transformations
Dimosts Sep 19, 2023
a4b73fe
bring vars to left side in all cases
Dimosts Sep 21, 2023
cffb964
handling True and False cases
Dimosts Sep 21, 2023
2911932
Merge branch 'canonical-and-reify-rewrite' into adding-choco
Dimosts Sep 21, 2023
98d29f4
translate int to bool for bool variables
Dimosts Sep 21, 2023
d22040c
minor
Dimosts Sep 21, 2023
8f4c4b3
fix count()
Dimosts Sep 21, 2023
bb259ed
np.array().tolist()
Dimosts Sep 21, 2023
82b3cbf
polishing
Dimosts Sep 21, 2023
0459db7
avoid flatten_objective
Dimosts Sep 21, 2023
05fd0da
cover case of list of vars in demand for cumulative
Dimosts Sep 21, 2023
351615d
to_var() + covering cases in input for constraints
Dimosts Sep 21, 2023
a0121fe
take all cases into account
Dimosts Sep 22, 2023
3c74253
change order of transform
Dimosts Sep 22, 2023
5112111
cover case for sub
Dimosts Sep 22, 2023
e80f8b0
time limit + finding all optimal solutions
Dimosts Sep 22, 2023
d53dcb6
Move -IV (operator) correctly to lhs
Dimosts Sep 24, 2023
4f72f47
Merge branch 'canonical-and-reify-rewrite' into adding-choco
Dimosts Sep 24, 2023
9c49237
dealing with 'sub'
Dimosts Sep 24, 2023
e2a7835
dealing with sub
Dimosts Sep 24, 2023
ab72835
Merge branch 'canonical-and-reify-rewrite' into adding-choco
Dimosts Sep 24, 2023
e432e27
Merge branch 'master' into adding-choco
Wout4 Oct 2, 2023
fc4c917
canonical_comparison after flatten
Dimosts Oct 2, 2023
5125901
Merge branch 'master' into adding-choco
Dimosts Oct 6, 2023
6929757
Merge branch 'master' into adding-choco
Dimosts Oct 6, 2023
20fa465
Merge branch 'master' into adding-choco
Wout4 Oct 11, 2023
380e640
use is_boolexpr is stead of .is_bool
Wout4 Oct 11, 2023
62ca607
cover all cases in min, max, abs
Dimosts Oct 12, 2023
66b8e8e
fix count
Dimosts Oct 12, 2023
12bd3ad
div and mod
Dimosts Oct 12, 2023
a47eb9c
cover all cases for element
Dimosts Oct 12, 2023
df2277a
Choco Exceptions
Dimosts Oct 12, 2023
ffe5361
checks in to_var and to_vars
Dimosts Oct 16, 2023
818dab2
Merge branch 'master' into adding-choco
Dimosts Oct 16, 2023
3692768
replicate code to to_var and to_vars
Dimosts Oct 17, 2023
01edb3a
Bounds and ints are int32 - checks
Dimosts Oct 17, 2023
577f819
ChocoTypeException
Dimosts Oct 17, 2023
2ef3f91
use of is_int()
Dimosts Oct 18, 2023
4a1cee9
convert numbers to int
Dimosts Oct 18, 2023
27ab55d
Merge branch 'master' into adding-choco
Dimosts Oct 24, 2023
c8ce758
Merge remote-tracking branch 'origin/master' into adding-choco
IgnaceBleukx Dec 11, 2023
4e06b60
some from feedback
Dimosts Dec 15, 2023
7e7468d
Merge branch 'master' into adding-choco
Dimosts Dec 15, 2023
9f6aacb
ensure only_numexpr also works in reified
IgnaceBleukx Jan 4, 2024
346a259
ensure bv -> bv is not added twice
IgnaceBleukx Jan 4, 2024
a1a5865
update posting interface
IgnaceBleukx Jan 4, 2024
41e5b59
resolve merge conflicts
IgnaceBleukx Jan 4, 2024
0d3d4fc
Merge remote-tracking branch 'origin/master' into adding-choco
IgnaceBleukx Jan 4, 2024
610ec6f
update with new interface
IgnaceBleukx Jan 8, 2024
5eff77e
Merge remote-tracking branch 'origin/master' into adding-choco
IgnaceBleukx Jan 22, 2024
8847edf
add n_values constraint
IgnaceBleukx Jan 22, 2024
6d80a36
bounds are always int
IgnaceBleukx Mar 19, 2024
ce10f9d
duration can be either var or int
IgnaceBleukx Mar 19, 2024
d4f4f95
add Inverse to tests
IgnaceBleukx Mar 19, 2024
d48c8de
cleanup objective posting
IgnaceBleukx Mar 19, 2024
a5b7a63
forgot import
IgnaceBleukx Mar 19, 2024
0c4de5c
proper translation of status
IgnaceBleukx Mar 19, 2024
bd4e0db
ensure always int when making constant_var
IgnaceBleukx Mar 19, 2024
e89a32b
rename and cleanup to_var
IgnaceBleukx Mar 19, 2024
4c812bf
added clarification why constraint can be None
IgnaceBleukx Mar 19, 2024
1aaddbb
restructure and cleanup _get_constraint function
IgnaceBleukx Mar 19, 2024
a60534d
exclude inverse from choco tests
IgnaceBleukx Mar 19, 2024
2848fb5
Merge branch 'master' into adding-choco
Dimosts Mar 25, 2024
fbc6988
avoid creating too many vars
IgnaceBleukx Mar 25, 2024
100f0b9
Merge branch 'adding-choco' of github.com:CPMpy/cpmpy into adding-choco
IgnaceBleukx Mar 25, 2024
00be5a5
minor fixes
IgnaceBleukx Mar 25, 2024
68acd3b
exclude inverse from Bool solvers
IgnaceBleukx Mar 25, 2024
193a46e
change inverse tes
IgnaceBleukx Mar 25, 2024
46c9049
typo
IgnaceBleukx Mar 25, 2024
3784fc6
fix mistake in implied cons
IgnaceBleukx Mar 25, 2024
9516d1c
fix choco tests
Dimosts Mar 25, 2024
5db0759
Update test_constraints.py
Dimosts Mar 25, 2024
eec5fcc
remove inverse test - separate PR
Dimosts Mar 25, 2024
62a9bea
remove inverse tests part 2
Dimosts Mar 25, 2024
df2d16f
add choco to github tests
Wout4 Mar 25, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
pip install z3-solver
pip install exact
pip install pysdd
pip install pychoco
sudo snap install minizinc --classic
pip install minizinc
- name: Test with pytest
Expand Down
6 changes: 6 additions & 0 deletions cpmpy/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ class MinizincNameException(CPMpyException):
class MinizincBoundsException(CPMpyException):
pass

class ChocoTypeException(CPMpyException):
pass

class ChocoBoundsException(CPMpyException):
pass

class NotSupportedError(CPMpyException):
pass

Expand Down
4 changes: 4 additions & 0 deletions cpmpy/solvers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
pysdd
z3
exact
choco
utils
===============
Expand All @@ -33,6 +34,7 @@
CPM_pysdd
CPM_z3
CPM_exact
CPM_choco
=================
List of functions
Expand All @@ -51,3 +53,5 @@
from .pysdd import CPM_pysdd
from .z3 import CPM_z3
from .exact import CPM_exact
from .choco import CPM_choco

Loading
Loading