choco.cp.solver.constraints.reified.leaves
Class ConstraintLeaf

java.lang.Object
  extended by choco.kernel.solver.constraints.reified.INode
      extended by choco.cp.solver.constraints.reified.leaves.ConstraintLeaf
All Implemented Interfaces:
IPretty, BoolNode

public final class ConstraintLeaf
extends INode
implements BoolNode


Field Summary
protected  AbstractIntSConstraint c
           
protected  int[] idxtuple
           
protected  AbstractIntSConstraint oppositec
           
protected  int[] tup
           
 
Fields inherited from class choco.kernel.solver.constraints.reified.INode
LOGGER, subtrees
 
Constructor Summary
ConstraintLeaf(SConstraint c)
           
ConstraintLeaf(SConstraint c, SConstraint oppositec)
           
 
Method Summary
 boolean checkTuple(int[] tuple)
           
 int countNbVar()
           
 SConstraint extractConstraint(Solver s)
          Extracts the sub constraint without reifying it !
 IntDomainVar extractResult(Solver s)
           
 int getNbSubTrees()
           
 IntDomainVar[] getScope(Solver s)
          Compute the set of solver variable involved in this predicat
 boolean isDecompositionPossible()
          check if this node can be decomposed
 boolean isReified()
          check if this expression is reified (involve or, and, not, ...)
 String pretty()
          pretty printing of the object.
 void setIndexes(IntDomainVar[] vs)
          set the indexes of each variables in the leaves of the tree
 void setTuple(int[] tuple)
           
 
Methods inherited from class choco.kernel.solver.constraints.reified.INode
computeLinearExpr, getModelScope, getSubtree, getType, hasOnlyVariablesLeaves, isAConstant, isALinearTerm, isAVariable, isBoolean, isCsteEqualTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

c

protected AbstractIntSConstraint c

oppositec

protected AbstractIntSConstraint oppositec

idxtuple

protected int[] idxtuple

tup

protected int[] tup
Constructor Detail

ConstraintLeaf

public ConstraintLeaf(SConstraint c)

ConstraintLeaf

public ConstraintLeaf(SConstraint c,
                      SConstraint oppositec)
Method Detail

checkTuple

public boolean checkTuple(int[] tuple)
Specified by:
checkTuple in interface BoolNode

setTuple

public void setTuple(int[] tuple)

extractResult

public IntDomainVar extractResult(Solver s)
Overrides:
extractResult in class INode
Returns:
a variable that represents the true/false value of the tree belows this node if it is a reified node or its value if it is an arithmetic node

extractConstraint

public SConstraint extractConstraint(Solver s)
Description copied from interface: BoolNode
Extracts the sub constraint without reifying it !

Specified by:
extractConstraint in interface BoolNode
Returns:

isReified

public boolean isReified()
Description copied from class: INode
check if this expression is reified (involve or, and, not, ...)

Overrides:
isReified in class INode
Returns:

getNbSubTrees

public int getNbSubTrees()
Overrides:
getNbSubTrees in class INode

isDecompositionPossible

public boolean isDecompositionPossible()
Description copied from class: INode
check if this node can be decomposed

Overrides:
isDecompositionPossible in class INode
Returns:

getScope

public IntDomainVar[] getScope(Solver s)
Description copied from class: INode
Compute the set of solver variable involved in this predicat

Overrides:
getScope in class INode
Parameters:
s - container solver
Returns:
array of variable in the scope

setIndexes

public void setIndexes(IntDomainVar[] vs)
Description copied from class: INode
set the indexes of each variables in the leaves of the tree

Overrides:
setIndexes in class INode

pretty

public String pretty()
Description copied from interface: IPretty
pretty printing of the object. This String is not constant and may depend on the context.

Specified by:
pretty in interface IPretty
Returns:
a readable string representation of the object

countNbVar

public int countNbVar()
Overrides:
countNbVar in class INode


Copyright © 2012. All Rights Reserved.