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

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

public final class VariableLeaf
extends INode
implements ArithmNode


Field Summary
 int idx
           
 IntegerVariable ivar
           
 IntDomainVar var
           
 
Fields inherited from class choco.kernel.solver.constraints.reified.INode
LOGGER, subtrees
 
Constructor Summary
VariableLeaf(IntDomainVar var)
           
VariableLeaf(IntegerVariable ivar)
           
 
Method Summary
 int[] computeLinearExpr(int scope)
           
 int countNbVar()
           
 int eval(int[] tuple)
           
 IntDomainVar extractResult(Solver s)
           
 int getIdx()
           
 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 isAVariable()
           
 boolean isBoolean()
           
 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 setSolverVar(IntDomainVar v)
           
 
Methods inherited from class choco.kernel.solver.constraints.reified.INode
getSubtree, getType, hasOnlyVariablesLeaves, isCsteEqualTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idx

public int idx

var

public IntDomainVar var

ivar

public IntegerVariable ivar
Constructor Detail

VariableLeaf

public VariableLeaf(IntDomainVar var)

VariableLeaf

public VariableLeaf(IntegerVariable ivar)
Method Detail

getIdx

public int getIdx()

setSolverVar

public void setSolverVar(IntDomainVar v)

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

getNbSubTrees

public int getNbSubTrees()
Overrides:
getNbSubTrees in class INode

isAVariable

public boolean isAVariable()
Overrides:
isAVariable in class INode

isBoolean

public boolean isBoolean()
Overrides:
isBoolean in class INode

isAConstant

public boolean isAConstant()
Overrides:
isAConstant 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

isALinearTerm

public boolean isALinearTerm()
Overrides:
isALinearTerm 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.