JaCoP.constraints
Class DecomposedConstraint

java.lang.Object
  extended by JaCoP.constraints.DecomposedConstraint
Direct Known Subclasses:
Arithmetic, Constraint, Lex, Sequence, SoftAlldifferent, SoftGCC, Stretch

public abstract class DecomposedConstraint
extends java.lang.Object

Standard unified interface/abstract class for constraints, which can only be decomposed. Defines how to construct a constraint out of other constraints.

Version:
3.1
Author:
Radoslaw Szymanek and Krzysztof Kuchcinski

Field Summary
 int queueIndex
          It specifies the queue (index), which is used to record that constraint needs to be re-evaluated.
 
Constructor Summary
DecomposedConstraint()
           
 
Method Summary
 java.util.ArrayList<Var> auxiliaryVariables()
           
abstract  java.util.ArrayList<Constraint> decompose(Store store)
          It returns an array list of constraint which are used to decompose this constraint.
abstract  void imposeDecomposition(Store store)
          It imposes the constraint in a given store.
 void imposeDecomposition(Store store, int queueIndex)
          It imposes the constraint and adjusts the queue index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queueIndex

public int queueIndex
It specifies the queue (index), which is used to record that constraint needs to be re-evaluated.

Constructor Detail

DecomposedConstraint

public DecomposedConstraint()
Method Detail

imposeDecomposition

public abstract void imposeDecomposition(Store store)
It imposes the constraint in a given store.

Parameters:
store - the constraint store to which the constraint is imposed to.

imposeDecomposition

public void imposeDecomposition(Store store,
                                int queueIndex)
It imposes the constraint and adjusts the queue index.

Parameters:
store - the constraint store to which the constraint is imposed to.
queueIndex - the index of the queue in the store it is assigned to.

decompose

public abstract java.util.ArrayList<Constraint> decompose(Store store)
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.

Parameters:
store - the constraint store in which context the decomposition takes place.
Returns:
an array list of constraints used to decompose this constraint.

auxiliaryVariables

public java.util.ArrayList<Var> auxiliaryVariables()
Returns:
null if no auxiliary variables were created, otherwise a list with variables.