KDisjunction

class KDisjunction : public KConstraint

This class creates a Binary disjunction on two constraints C1 or C2

Example :

// C1     C2       C1 \/ C2
// ------------------------
// false  false    false
// false  true     true
// true   false    true
// true   true     true

KIntVar START(...);
...
problem.post(START + 10 < 4 || START + 10 >= 4);
// or
problem.post(KDisjunction(START + 10 < 4,START + 10 >= 4));

See

KConstraint

Since

2016.1

Public Functions

KDisjunction(const KConstraint &c1, const KConstraint &c2)

Primary constructor

Parameters
  • c1 – the first constraint of the disjunction c1 or c2

  • c2 – the second constraint of the disjunction c1 or c2

KDisjunction(const KDisjunction &toCopy)

Copy constructor.

bool knownStatus(void)

Return the known status

Known status is true if status of disjunction is proven at current point of the branch and bound, false if unknown.

void setStatus(int branchNumber, bool status)

Fix status of one part of the disjunction

Parameters
  • branchNumber – 0 for c1, 1 for c2

  • status – true if corresponding constraint must be true