JaCoP.constraints
Class SoftAlldifferent
java.lang.Object
JaCoP.constraints.DecomposedConstraint
JaCoP.constraints.SoftAlldifferent
public class SoftAlldifferent
- extends DecomposedConstraint
This class provides soft-alldifferent constraint by decomposing it
either into a network flow constraint or a set of primitive constraints.
- Version:
- 3.1
- Author:
- Robin Steiger and Radoslaw Szymanek
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
decomposition
public java.util.ArrayList<Constraint> decomposition
xVars
public final IntVar[] xVars
costVar
public final IntVar costVar
violationMeasure
public final ViolationMeasure violationMeasure
SoftAlldifferent
public SoftAlldifferent(IntVar[] xVars,
IntVar costVar,
ViolationMeasure violationMeasure)
primitiveDecomposition
public java.util.ArrayList<Constraint> primitiveDecomposition(Store store)
decompose
public java.util.ArrayList<Constraint> decompose(Store store)
- Description copied from class:
DecomposedConstraint
- It returns an array list of constraint which are used to decompose this
constraint. It actually creates a decomposition (possibly also creating
variables), but it does not impose the constraint.
- Specified by:
decompose in class DecomposedConstraint
- Parameters:
store - the constraint store in which context the decomposition takes place.
- Returns:
- an array list of constraints used to decompose this constraint.
imposeDecomposition
public void imposeDecomposition(Store store)
- Description copied from class:
DecomposedConstraint
- It imposes the constraint in a given store.
- Specified by:
imposeDecomposition in class DecomposedConstraint
- Parameters:
store - the constraint store to which the constraint is imposed to.