class KOccurTerm : public KTerm

This class represent an expression of type occur(target,lvars) where target is the value for wich we want to restrict the number of occurence(s) in the lVars array of variables.

Example :

KProblem p(...);
KIntVar countVar(...);
KIntVarArray X(...);

KOccurTerm occurTerm(3,X);

// posting the constraint "the number of occurences of the value 3 in the
// X variable array must be less than the value of countVar
p.post(occurTerm <= countVar);
// or
p.post(occurTerm <= 5);


KConstraint KOccurrence



Public Functions


Default constructor.

KOccurTerm(const int target, const KIntVarArray &lvars)

Main constructor.

KOccurTerm(const KOccurTerm &toCopy, int pb)

Copy constructor for a specific instance.

inline int getTarget() const

return the target value

inline KIntVarArray *getLvars() const

return the array of variables in wich we want to restrict the number of occurences of the target value