Skip to content

Commit

Permalink
Update globalconstraints.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimosts committed May 10, 2024
1 parent a6f0e7e commit 59e9fec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpmpy/expressions/globalconstraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,13 +633,13 @@ def decompose(self):
defining = bvar == ((X <= Y) &
((X < Y) | bvar[1:]))
constraining = [bvar[0]]
#constraining += [bvar[-1] == 0] #for strict case
#defining += [bvar[-1] == 0] #for strict case
return constraining, defining

def value(self):
from .python_builtins import any, all
X, Y = self.args
return argval((X[0] < Y[0]) | any((X[i] < Y[i]) & all(X[j] <= Y[j] for j in range(i-1)) for i in range(len(X))))
return argval(any((X[i] < Y[i]) & all(X[j] <= Y[j] for j in range(i-1)) for i in range(len(X))))


class DirectConstraint(Expression):
Expand Down

0 comments on commit 59e9fec

Please sign in to comment.