KDistanceLowerThanXyc

class KDistanceLowerThanXyc : public KConstraint

This class creates a abs(X-Y) <= C constraint

Example :

KIntVar X(...);
KIntVar Y(...);
// ...
problem.post(KDistanceLowerThanXyc(X,Y,3)); // |X-Y| <= 3

See

KConstraint

Since

2016.1

Public Functions

KDistanceLowerThanXyc(const KIntVar &v1, const KIntVar &v2, int c)

Primary constructor of abs(v1-v2) <= C

Parameters
  • v1 – the v1 variable

  • v2 – the v2 variable

  • c – the constant

KDistanceLowerThanXyc(const KDistanceLowerThanXyc &toCopy)

Copy Constructor.