- All Known Implementing Classes:
CPNodeVarViewFlip
public interface CPNodeVar
-
Method Summary
Modifier and TypeMethodDescriptionintfillInsert(int[] dest) Fills an array with the insertions of the node.intfillPred(int[] dest) Copies the predecessors into an array.intCopies the predecessors matching a status into an array.intfillSucc(int[] dest) Copies the successors matching a status into an array.intCopies the successors matching a status into an array.Returns the sequence variable to which this variable is related to.Returns the solver in which this variable was created.booleanTells if the node is matching a status.Gives a boolean variable telling if the node is requiredintnInsert()Returns the number of insertions of the node.intnode()Returns the node related to this variable.intnPred()Returns the number of predecessors.intnSucc()Returns the number of successors.voidAsks thatCPConstraint.propagate()is called whenever the node is excluded.voidAsks thatCPConstraint.propagate()is called whenever the node is inserted.voidAsks thatCPConstraint.propagate()is called whenever an insertion for the node is removed.voidAsks thatCPConstraint.propagate()is called whenever the node is required.voidAsks that the closure is called whenever the node is excluded.voidAsks that the closure is called whenever the node is inserted.voidAsks that the closure is called whenever the an insertion for the node has been removedvoidAsks that the closure is called the node is required.
-
Method Details
-
getSolver
CPSolver getSolver()Returns the solver in which this variable was created.- Returns:
- the solver in which this variable was created.
-
getSeqVar
CPSeqVar getSeqVar()Returns the sequence variable to which this variable is related to.- Returns:
- the sequence variable in which this variable was created.
-
node
int node()Returns the node related to this variable.- Returns:
- node related to this
-
isNode
Tells if the node is matching a status.- Parameters:
status- status that must be matched by the node.- Returns:
- true if the node is matching the status.
-
isRequired
CPBoolVar isRequired()Gives a boolean variable telling if the node is required- Returns:
- boolean variable telling if the node is required
-
fillPred
Copies the predecessors matching a status into an array.- Parameters:
dest- an array large enough.status- status that must be matched by the predecessors.- Returns:
- n, the number of predecessors matching the status and
dest[0,...,n-1]contains the predecessors in an arbitrary order.
-
fillPred
int fillPred(int[] dest) Copies the predecessors into an array.- Parameters:
dest- an array large enoughdest.length >= nPred().- Returns:
- the number of predecessors and
dest[0,...,nPred()-1]contains the predecessors in an arbitrary order.
-
nPred
int nPred()Returns the number of predecessors.- Returns:
- the number of predecessors.
-
fillSucc
Copies the successors matching a status into an array.- Parameters:
dest- an array large enough.status- status that must be matched by the nodes.- Returns:
- n, the number of successors matching the status and
dest[0,...,n-1]contains the successors in an arbitrary order.
-
fillSucc
int fillSucc(int[] dest) Copies the successors matching a status into an array.- Parameters:
dest- an array large enoughdest.length >= nSucc().- Returns:
- the number of successors matching the status and
dest[0,...,nSucc()-1]contains the successors in an arbitrary order.
-
nSucc
int nSucc()Returns the number of successors.- Returns:
- the number of successors.
-
fillInsert
int fillInsert(int[] dest) Fills an array with the insertions of the node. Equivalent tofillPred(node, dest, MEMBER).- Parameters:
dest- an array large enoughdest.length >= nInsert().- Returns:
- the number of insertions and
dest[0,...,nInsert()-1]contains the insertions in an arbitrary order.
-
nInsert
int nInsert()Returns the number of insertions of the node.- Returns:
- the number of insertions of the node.
-
whenInsert
Asks that the closure is called whenever the node is inserted.- Parameters:
f- the closure.
-
whenExclude
Asks that the closure is called whenever the node is excluded.- Parameters:
f- the closure.
-
whenRequire
Asks that the closure is called the node is required.- Parameters:
f- the closure.
-
whenInsertRemoved
Asks that the closure is called whenever the an insertion for the node has been removed- Parameters:
f- the closure
-
propagateOnInsert
Asks thatCPConstraint.propagate()is called whenever the node is inserted. We say that an insert event occurs.- Parameters:
c- the constraint for which theCPConstraint.propagate()method should be called on insert events of this variable.
-
propagateOnExclude
Asks thatCPConstraint.propagate()is called whenever the node is excluded. We say that an exclude event occurs.- Parameters:
c- the constraint for which theCPConstraint.propagate()method should be called on exclude events of this variable.
-
propagateOnRequire
Asks thatCPConstraint.propagate()is called whenever the node is required. We say that an require event occurs.- Parameters:
c- the constraint for which theCPConstraint.propagate()method should be called on require events of this variable.
-
propagateOnInsertRemoved
Asks thatCPConstraint.propagate()is called whenever an insertion for the node is removed. We say that an removeInsert event occurs.- Parameters:
c- the constraint for which theCPConstraint.propagate()method should be called on removeInsert events of this variable.
-