Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnaceBleukx committed May 23, 2024
1 parent 9264918 commit 44c8935
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# also add exclusions to the 3 EXCLUDE_* below as needed
SOLVERNAMES = [name for name, solver in SolverLookup.base_solvers() if solver.supported()]
ALL_SOLS = False # test wheter all solutions returned by the solver satisfy the constraint

SOLVERNAMES = ["ortools"]
# Exclude some global constraints for solvers

NUM_GLOBAL = {
"AllEqual", "AllDifferent", "AllDifferentExcept0", "Cumulative", "GlobalCardinalityCount", "InDomain", "Inverse", "Table", "Circuit",
"Increasing", "IncreasingStrict", "Decreasing", "DecreasingStrict",
# also global functions
"Abs", "Element", "Minimum", "Maximum", "Count", "NValue", "NValueExcept"
"Abs", "Element", "Minimum", "Maximum", "Count", "NValue", "NValueExcept", "IfThenElseNum"
}

# Solvers not supporting arithmetic constraints
Expand Down Expand Up @@ -101,6 +101,8 @@ def numexprs(solver):
expr = cls(NUM_ARGS, POS_VAR)
elif name == "NValueExcept":
expr = cls(NUM_ARGS, 3)
elif name == "IfThenElseNum":
expr = cls(BOOL_VAR, NUM_ARGS[0], NUM_ARGS[1])
else:
expr = cls(NUM_ARGS)

Expand Down

0 comments on commit 44c8935

Please sign in to comment.