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

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

public final class ConstantLeaf
extends INode
implements ArithmNode


Field Summary
 int cste
           
 
Fields inherited from class choco.kernel.solver.constraints.reified.INode
LOGGER, subtrees
 
Constructor Summary
ConstantLeaf(int cste)
           
 
Method Summary
 int[] computeLinearExpr(int scope)
           
 int countNbVar()
           
 int eval(int[] tuple)
           
 IntDomainVar extractResult(Solver s)
           
 int getConstant()
           
 IntegerVariable[] getModelScope()
          Compute the set of model variable involved in this predicat
 int getNbSubTrees()
           
 IntDomainVar[] getScope(Solver s)
          Compute the set of solver variable involved in this predicat
 boolean isAConstant()
           
 boolean isALinearTerm()
           
 boolean isCsteEqualTo(int a)
           
 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
 
Methods inherited from class choco.kernel.solver.constraints.reified.INode
getSubtree, getType, hasOnlyVariablesLeaves, isAVariable, isBoolean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cste

public int cste
Constructor Detail

ConstantLeaf

public ConstantLeaf(int cste)
Method Detail

eval

public int eval(int[] tuple)
Specified by:
eval in interface ArithmNode

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

getScope

public final 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

getModelScope

public IntegerVariable[] getModelScope()
Description copied from class: INode
Compute the set of model variable involved in this predicat

Overrides:
getModelScope in class INode
Returns:

isDecompositionPossible

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

Overrides:
isDecompositionPossible in class INode
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:

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

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

getConstant

public int getConstant()

isCsteEqualTo

public boolean isCsteEqualTo(int a)
Overrides:
isCsteEqualTo in class INode

isAConstant

public boolean isAConstant()
Overrides:
isAConstant in class INode

isALinearTerm

public boolean isALinearTerm()
Overrides:
isALinearTerm in class INode

countNbVar

public int countNbVar()
Overrides:
countNbVar in class INode

getNbSubTrees

public int getNbSubTrees()
Overrides:
getNbSubTrees in class INode

computeLinearExpr

public int[] computeLinearExpr(int scope)
Overrides:
computeLinearExpr in class INode
Returns:
the set of coefficients encoding a linear equation


Copyright © 2012. All Rights Reserved.