JaCoP.constraints
Class Disjoint

java.lang.Object
  extended by JaCoP.constraints.DecomposedConstraint
      extended by JaCoP.constraints.Constraint
          extended by JaCoP.constraints.Diff
              extended by JaCoP.constraints.Disjoint

public class Disjoint
extends Diff

Disjoint constraint assures that any two rectangles from a vector of rectangles does not overlap in at least one direction.

Author:
Krzysztof Kuchcinski and Radoslaw Szymanek

Field Summary
static java.lang.String[] xmlAttributes
          It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.
 
Fields inherited from class JaCoP.constraints.Diff
doProfile, rectangles
 
Fields inherited from class JaCoP.constraints.Constraint
atomicExecution, consistencyPruningEvents, earlyTerminationOK, id, increaseWeight, numberArgs, numberId
 
Fields inherited from class JaCoP.constraints.DecomposedConstraint
queueIndex
 
Constructor Summary
Disjoint(java.util.ArrayList<? extends java.util.ArrayList<? extends IntVar>> rectangles)
          It creates a diff2 constraint.
Disjoint(java.util.ArrayList<? extends java.util.ArrayList<? extends IntVar>> rectangles, boolean profile)
          It creates a diff2 constraint.
Disjoint(java.util.ArrayList<? extends IntVar> o1, java.util.ArrayList<? extends IntVar> o2, java.util.ArrayList<? extends IntVar> l1, java.util.ArrayList<? extends IntVar> l2)
          It creates a diff2 constraint.
Disjoint(java.util.ArrayList<IntVar> o1, java.util.ArrayList<IntVar> o2, java.util.ArrayList<IntVar> l1, java.util.ArrayList<IntVar> l2, boolean profile)
          It creates a diff2 constraint.
Disjoint(IntVar[][] rectangles, boolean profile)
          It creates a diff2 constraint.
Disjoint(IntVar[] o1, IntVar[] o2, IntVar[] l1, IntVar[] l2)
          It creates a diff2 constraint.
Disjoint(IntVar[] o1, IntVar[] o2, IntVar[] l1, IntVar[] l2, boolean profile)
          It creates a diff2 constraint.
Disjoint(Rectangle[] rectangles, boolean doProfile)
           
Disjoint(Store store, IntVar[][] rectangles)
          It creates a diff2 constraint.
 
Method Summary
 java.lang.String id()
          It gives the id string of a constraint.
 void impose(Store store)
          It imposes the constraint in a given store.
 boolean satisfied()
          It checks if the constraint is satisfied.
 java.lang.String toString()
          It produces a string representation of a constraint state.
 
Methods inherited from class JaCoP.constraints.Diff
arguments, consistency, getConsistencyPruningEvent, increaseWeight, queueVariable, removeConstraint, removeLevel
 
Methods inherited from class JaCoP.constraints.Constraint
cleanAfterFailure, decompose, getGuideConstraint, getGuideValue, getGuideVariable, impose, imposeDecomposition, numberArgs, removeLevelLate, requiresMonotonicity, setConsistencyPruningEvent, supplyGuideFeedback
 
Methods inherited from class JaCoP.constraints.DecomposedConstraint
auxiliaryVariables, imposeDecomposition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xmlAttributes

public static java.lang.String[] xmlAttributes
It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.

Constructor Detail

Disjoint

public Disjoint(Rectangle[] rectangles,
                boolean doProfile)
Parameters:
rectangles - a list of rectangles.
doProfile - should profile be computed and used.

Disjoint

public Disjoint(java.util.ArrayList<IntVar> o1,
                java.util.ArrayList<IntVar> o2,
                java.util.ArrayList<IntVar> l1,
                java.util.ArrayList<IntVar> l2,
                boolean profile)
It creates a diff2 constraint.

Parameters:
o1 - list of variables denoting the origin in the first dimension.
o2 - list of variables denoting the origin in the second dimension.
l1 - list of variables denoting the length in the first dimension.
l2 - list of variables denoting the length in the second dimension.
profile - specifies if the profile should be computed.

Disjoint

public Disjoint(java.util.ArrayList<? extends java.util.ArrayList<? extends IntVar>> rectangles)
It creates a diff2 constraint.

Parameters:
rectangles - list of rectangles with origins and lengths in both dimensions.

Disjoint

public Disjoint(java.util.ArrayList<? extends java.util.ArrayList<? extends IntVar>> rectangles,
                boolean profile)
It creates a diff2 constraint.

Parameters:
rectangles - list of rectangles with origins and lengths in both dimensions.
profile - specifies if the profile is computed and used.

Disjoint

public Disjoint(java.util.ArrayList<? extends IntVar> o1,
                java.util.ArrayList<? extends IntVar> o2,
                java.util.ArrayList<? extends IntVar> l1,
                java.util.ArrayList<? extends IntVar> l2)
It creates a diff2 constraint.

Parameters:
o1 - list of variables denoting the origin in the first dimension.
o2 - list of variables denoting the origin in the second dimension.
l1 - list of variables denoting the length in the first dimension.
l2 - list of variables denoting the length in the second dimension.

Disjoint

public Disjoint(IntVar[] o1,
                IntVar[] o2,
                IntVar[] l1,
                IntVar[] l2)
It creates a diff2 constraint.

Parameters:
o1 - list of variables denoting the origin in the first dimension.
o2 - list of variables denoting the origin in the second dimension.
l1 - list of variables denoting the length in the first dimension.
l2 - list of variables denoting the length in the second dimension.

Disjoint

public Disjoint(IntVar[] o1,
                IntVar[] o2,
                IntVar[] l1,
                IntVar[] l2,
                boolean profile)
It creates a diff2 constraint.

Parameters:
o1 - list of variables denoting the origin in the first dimension.
o2 - list of variables denoting the origin in the second dimension.
l1 - list of variables denoting the length in the first dimension.
l2 - list of variables denoting the length in the second dimension.
profile - specifies if the profile should be computed.

Disjoint

public Disjoint(Store store,
                IntVar[][] rectangles)
It creates a diff2 constraint.

Parameters:
store - constraint store in which the constraint is created.
rectangles - list of rectangles with origins and lengths in both dimensions.

Disjoint

public Disjoint(IntVar[][] rectangles,
                boolean profile)
It creates a diff2 constraint.

Parameters:
rectangles - list of rectangles with origins and lengths in both dimensions.
profile - specifies if the profile is computed and used.
Method Detail

impose

public void impose(Store store)
Description copied from class: Constraint
It imposes the constraint in a given store.

Overrides:
impose in class Diff
Parameters:
store - the constraint store to which the constraint is imposed to.

satisfied

public boolean satisfied()
Description copied from class: Constraint
It checks if the constraint is satisfied. If this function is incorrectly implemented a constraint may not be satisfied in a solution.

Overrides:
satisfied in class Diff
Returns:
true if the constraint is for certain satisfied, false otherwise.

id

public java.lang.String id()
Description copied from class: Constraint
It gives the id string of a constraint.

Overrides:
id in class Diff
Returns:
string id of the constraint.

toString

public java.lang.String toString()
Description copied from class: Constraint
It produces a string representation of a constraint state.

Overrides:
toString in class Diff