choco.kernel.solver.constraints.reified
Class INode

java.lang.Object
  extended by choco.kernel.solver.constraints.reified.INode
All Implemented Interfaces:
IPretty
Direct Known Subclasses:
AbsNode, AbstractBoolNode, ConstantLeaf, ConstraintLeaf, DistNode, DivNode, DoubleNode, MaxNode, MinNode, MinusNode, ModNode, MultNode, NegNode, PlusNode, PowNode, ScalarNode, SquareRootNode, VariableLeaf

public abstract class INode
extends Object
implements IPretty


Field Summary
protected static Logger LOGGER
           
protected  INode[] subtrees
          reference to branches below this node
 
Constructor Summary
INode(INode[] subt, NodeType type)
           
INode(NodeType type)
           
 
Method Summary
 int[] computeLinearExpr(int scope)
           
 int countNbVar()
           
 IntDomainVar extractResult(Solver s)
           
 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
 INode getSubtree(int i)
           
 NodeType getType()
           
 boolean hasOnlyVariablesLeaves()
           
 boolean isAConstant()
           
 boolean isALinearTerm()
           
 boolean isAVariable()
           
 boolean isBoolean()
           
 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, ...)
 void setIndexes(IntDomainVar[] vs)
          set the indexes of each variables in the leaves of the tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.IPretty
pretty
 

Field Detail

LOGGER

protected static final Logger LOGGER

subtrees

protected INode[] subtrees
reference to branches below this node

Constructor Detail

INode

public INode(NodeType type)

INode

public INode(INode[] subt,
             NodeType type)
Method Detail

getNbSubTrees

public int getNbSubTrees()

getSubtree

public INode getSubtree(int i)

getScope

public IntDomainVar[] getScope(Solver s)
Compute the set of solver variable involved in this predicat

Parameters:
s - container solver
Returns:
array of variable in the scope

getModelScope

public IntegerVariable[] getModelScope()
Compute the set of model variable involved in this predicat

Returns:

setIndexes

public void setIndexes(IntDomainVar[] vs)
set the indexes of each variables in the leaves of the tree

Parameters:
vs -

extractResult

public IntDomainVar extractResult(Solver s)
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

isDecompositionPossible

public boolean isDecompositionPossible()
check if this node can be decomposed

Returns:

isReified

public boolean isReified()
check if this expression is reified (involve or, and, not, ...)

Returns:

hasOnlyVariablesLeaves

public boolean hasOnlyVariablesLeaves()

countNbVar

public int countNbVar()

isAVariable

public boolean isAVariable()

isBoolean

public boolean isBoolean()

isCsteEqualTo

public boolean isCsteEqualTo(int a)

isAConstant

public boolean isAConstant()

isALinearTerm

public boolean isALinearTerm()

computeLinearExpr

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

getType

public NodeType getType()


Copyright © 2012. All Rights Reserved.