0

I'm using the choco solver to solve my constraint problem. Is it possible in Choco to increment an IntVar after a condition like model.ifThen?

DeiDei
  • 10,205
  • 6
  • 55
  • 80
  • `x = x + 1` is a normal construct in programming but it is not a valid constraint. You can do something like `y = if condition then x+1 else x` – Erwin Kalvelagen May 31 '18 at 19:50
  • Does this increment my variable ? model.arithm(gisement_courant, "=", gisement_courant.getValue() +1) – Mathieu TSH Jun 07 '18 at 09:46

1 Answers1

0

In constraint programming, you NEVER increment a variable. It is a declarative (not imperative) paradigm where instead of describing how to compute a solutions (operations on values), you just post constraint that must be satisfied. x=x+1 is a nonsense in constraint programming, leading to "no solution".