FRAMES NO FRAMES

Class IlcSoftConstraint

Definition file: ilsolver/disjunct.h

An instance of the class IlcSoftConstraint can only be created using the member function IlcSoftConstraint IlcSoftCtHandler::createSoftConstraint(IlcConstraintI*).

The class IlcSoftCtHandler is used to manage the definition of a soft constraint. It contains information about the copied constraint, the copied variables and their relation to the original constraint and the original variables.

Method Summary
public IlcIntgetCopiedVarInProcess() const
public IlcSoftConstraintI *getImpl() const
public IlcIntVargetStatusVar()
public IlcBoolisFailed()
public voidwhenDomainReduction(IlcDemon demon)
public voidwhenFail(IlcDemon demon)
Inherited Methods from IlcConstraint
getImpl, getName, getObject, getParentDemon, getSolver, isFalse, isTrue, setName, setObject
Inherited Methods from IlcDemon
getConstraint, getImpl, getSolver, operator=
Method Detail

getCopiedVarInProcess

public IlcInt getCopiedVarInProcess() const

This function returns the index of the copied variable which is in process. Indices are described in the class IlcSoftCtHandler.


getImpl

public IlcSoftConstraintI * getImpl() const

This member function returns the implementation object of the invoking object. You can use this member function to check whether a constraint is empty.


getStatusVar

public IlcIntVar getStatusVar()

This function returns the status variable of the constraint.


isFailed

public IlcBool isFailed()

This function returns IlcTrue if the copied variable is violated, otherwise it returns IlcFalse.


whenDomainReduction

public void whenDomainReduction(IlcDemon demon)

This function is used to link a demon that will be executed each time a copied variable is modified. The current modified copied variable can be accessed using the member function IlcInt IlcSoftConstraint::getCopiedVarInProcess()const.


whenFail

public void whenFail(IlcDemon demon)

This function is used to link a demon to the event corresponding to the violation of the copied constraint.