JaCoP.constraints
Class DisjointConditional

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

public class DisjointConditional
extends Diff

DisjointConditional constraint assures that any two rectangles from a vector of rectangles does not overlap in at least one direction. The execption from this rule is specified on the list of tuple [recti, rectj, C], where recti and rectj are integers representing given rectangles positions on the list of rectangles (starting from 1) and C is FDV 0..1. When C=1 then rectnagles must not overlap otherwise the overlaping is not checked.

Version:
2.0
Author:
Krzysztof Kuchcinski and Radoslaw Szymanek

Field Summary
 JaCoP.constraints.ExclusiveList exclusionList
          It specifies what rectangles can conditionally overlap.
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
DisjointConditional(java.util.ArrayList<? extends IntVar> o1, java.util.ArrayList<? extends IntVar> o2, java.util.ArrayList<? extends IntVar> l1, java.util.ArrayList<? extends IntVar> l2, java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices, java.util.ArrayList<? extends IntVar> exceptionCondition)
          It constructs a disjoint conditional constraint.
DisjointConditional(java.util.ArrayList<? extends IntVar> o1, java.util.ArrayList<? extends IntVar> o2, java.util.ArrayList<? extends IntVar> l1, java.util.ArrayList<? extends IntVar> l2, java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices, java.util.ArrayList<? extends IntVar> exceptionCondition, boolean profile)
          It constructs a disjoint conditional constraint.
DisjointConditional(java.util.ArrayList<java.util.ArrayList<? extends IntVar>> rectangles, java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices, java.util.ArrayList<? extends IntVar> exceptionCondition)
          It creates Disjoint conditional constraint.
DisjointConditional(java.util.ArrayList<java.util.ArrayList<? extends IntVar>> rectangles, java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices, java.util.ArrayList<? extends IntVar> exceptionCondition, boolean profile)
          It creates Disjoint conditional constraint.
DisjointConditional(IntVar[][] rectangles, java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices, java.util.ArrayList<? extends IntVar> exceptionCondition)
          It creates Disjoint conditional constraint.
DisjointConditional(IntVar[][] rectangles, java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices, java.util.ArrayList<? extends IntVar> exceptionCondition, boolean profile)
          It creates Disjoint conditional constraint.
DisjointConditional(IntVar[] o1, IntVar[] o2, IntVar[] l1, IntVar[] l2, java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices, java.util.ArrayList<? extends IntVar> exceptionCondition)
          It constructs a disjoint conditional constraint.
DisjointConditional(IntVar[] o1, IntVar[] o2, IntVar[] l1, IntVar[] l2, java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices, java.util.ArrayList<? extends IntVar> exceptionCondition, boolean profile)
          It constructs a disjoint conditional constraint.
DisjointConditional(Rectangle[] rectangles, JaCoP.constraints.ExclusiveList exclusionList, boolean doProfile)
          It specifies a diff constraint.
 
Method Summary
 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, id, 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

exclusionList

public JaCoP.constraints.ExclusiveList exclusionList
It specifies what rectangles can conditionally overlap.


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

DisjointConditional

public DisjointConditional(Rectangle[] rectangles,
                           JaCoP.constraints.ExclusiveList exclusionList,
                           boolean doProfile)
It specifies a diff constraint.

Parameters:
rectangles - list of rectangles which can not overlap in at least one dimension.
exclusionList - it is a list of exclusive items. Each item consists of two ints and a variable.
doProfile - should the constraint compute and use the profile functionality.

DisjointConditional

public DisjointConditional(java.util.ArrayList<java.util.ArrayList<? extends IntVar>> rectangles,
                           java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices,
                           java.util.ArrayList<? extends IntVar> exceptionCondition)
It creates Disjoint conditional constraint.

Parameters:
rectangles - the rectangles within a constraint.
exceptionIndices - a list of pairs of conditionally overlaping rectangles.
exceptionCondition - a variable specifying if a corresponding pair is nonoverlapping.

DisjointConditional

public DisjointConditional(java.util.ArrayList<java.util.ArrayList<? extends IntVar>> rectangles,
                           java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices,
                           java.util.ArrayList<? extends IntVar> exceptionCondition,
                           boolean profile)
It creates Disjoint conditional constraint.

Parameters:
rectangles - the rectangles within a constraint.
exceptionIndices - it specifies a list of pairs, where each pair specifies two rectangles which conditionally overlap.
exceptionCondition - a variable specifying if a corresponding pair is nonoverlapping.
profile - it specifies if the profiles are used and computed within the constraint.

DisjointConditional

public DisjointConditional(java.util.ArrayList<? extends IntVar> o1,
                           java.util.ArrayList<? extends IntVar> o2,
                           java.util.ArrayList<? extends IntVar> l1,
                           java.util.ArrayList<? extends IntVar> l2,
                           java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices,
                           java.util.ArrayList<? extends IntVar> exceptionCondition)
It constructs a disjoint conditional constraint.

Parameters:
o1 - variables specifying the origin in the first dimension.
o2 - variables specifying the origin in the second dimension.
l1 - variables specifying the length in the first dimension.
l2 - variables specifying the length in the second dimension.
exceptionIndices - it specifies a list of pairs, where each pair specifies two rectangles which conditionally overlap.
exceptionCondition - a variable specifying if a corresponding pair is nonoverlapping.

DisjointConditional

public DisjointConditional(java.util.ArrayList<? extends IntVar> o1,
                           java.util.ArrayList<? extends IntVar> o2,
                           java.util.ArrayList<? extends IntVar> l1,
                           java.util.ArrayList<? extends IntVar> l2,
                           java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices,
                           java.util.ArrayList<? extends IntVar> exceptionCondition,
                           boolean profile)
It constructs a disjoint conditional constraint.

Parameters:
o1 - variables specifying the origin in the first dimension.
o2 - variables specifying the origin in the second dimension.
l1 - variables specifying the length in the first dimension.
l2 - variables specifying the length in the second dimension.
exceptionIndices - it specifies a list of pairs, where each pair specifies two rectangles which conditionally overlap.
exceptionCondition - a variable specifying if a corresponding pair is nonoverlapping.
profile - it specifies if the profiles are being computed and used within a constraint.

DisjointConditional

public DisjointConditional(IntVar[] o1,
                           IntVar[] o2,
                           IntVar[] l1,
                           IntVar[] l2,
                           java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices,
                           java.util.ArrayList<? extends IntVar> exceptionCondition)
It constructs a disjoint conditional constraint.

Parameters:
o1 - variables specifying the origin in the first dimension.
o2 - variables specifying the origin in the second dimension.
l1 - variables specifying the length in the first dimension.
l2 - variables specifying the length in the second dimension.
exceptionIndices - it specifies a list of pairs, where each pair specifies two rectangles which conditionally overlap.
exceptionCondition - a variable specifying if a corresponding pair is nonoverlapping.

DisjointConditional

public DisjointConditional(IntVar[] o1,
                           IntVar[] o2,
                           IntVar[] l1,
                           IntVar[] l2,
                           java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices,
                           java.util.ArrayList<? extends IntVar> exceptionCondition,
                           boolean profile)
It constructs a disjoint conditional constraint.

Parameters:
o1 - variables specifying the origin in the first dimension.
o2 - variables specifying the origin in the second dimension.
l1 - variables specifying the length in the first dimension.
l2 - variables specifying the length in the second dimension.
exceptionIndices -
exceptionCondition -
profile - it specifies if the profiles are being used and computed within that constraint.

DisjointConditional

public DisjointConditional(IntVar[][] rectangles,
                           java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices,
                           java.util.ArrayList<? extends IntVar> exceptionCondition)
It creates Disjoint conditional constraint.

Parameters:
rectangles - the rectangles within a constraint.
exceptionIndices -
exceptionCondition -

DisjointConditional

public DisjointConditional(IntVar[][] rectangles,
                           java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> exceptionIndices,
                           java.util.ArrayList<? extends IntVar> exceptionCondition,
                           boolean profile)
It creates Disjoint conditional constraint.

Parameters:
rectangles - the rectangles within a constraint.
exceptionIndices -
exceptionCondition -
profile - it specifies if the profiles are being computed and used within that constraint.
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.

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