Module org.maxicp

Interface CPNodeVar

All Known Implementing Classes:
CPNodeVarViewFlip

public interface CPNodeVar
  • 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

      boolean isNode(SeqStatus status)
      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

      int fillPred(int[] dest, SeqStatus status)
      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 enough dest.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

      int fillSucc(int[] dest, SeqStatus status)
      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 enough dest.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 to fillPred(node, dest, MEMBER).
      Parameters:
      dest - an array large enough dest.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

      void whenInsert(Runnable f)
      Asks that the closure is called whenever the node is inserted.
      Parameters:
      f - the closure.
    • whenExclude

      void whenExclude(Runnable f)
      Asks that the closure is called whenever the node is excluded.
      Parameters:
      f - the closure.
    • whenRequire

      void whenRequire(Runnable f)
      Asks that the closure is called the node is required.
      Parameters:
      f - the closure.
    • whenInsertRemoved

      void whenInsertRemoved(Runnable f)
      Asks that the closure is called whenever the an insertion for the node has been removed
      Parameters:
      f - the closure
    • propagateOnInsert

      void propagateOnInsert(CPConstraint c)
      Asks that CPConstraint.propagate() is called whenever the node is inserted. We say that an insert event occurs.
      Parameters:
      c - the constraint for which the CPConstraint.propagate() method should be called on insert events of this variable.
    • propagateOnExclude

      void propagateOnExclude(CPConstraint c)
      Asks that CPConstraint.propagate() is called whenever the node is excluded. We say that an exclude event occurs.
      Parameters:
      c - the constraint for which the CPConstraint.propagate() method should be called on exclude events of this variable.
    • propagateOnRequire

      void propagateOnRequire(CPConstraint c)
      Asks that CPConstraint.propagate() is called whenever the node is required. We say that an require event occurs.
      Parameters:
      c - the constraint for which the CPConstraint.propagate() method should be called on require events of this variable.
    • propagateOnInsertRemoved

      void propagateOnInsertRemoved(CPConstraint c)
      Asks that CPConstraint.propagate() is called whenever an insertion for the node is removed. We say that an removeInsert event occurs.
      Parameters:
      c - the constraint for which the CPConstraint.propagate() method should be called on removeInsert events of this variable.