Module org.maxicp

Class CPNodeVarViewFlip

java.lang.Object
org.maxicp.cp.engine.core.CPNodeVarViewFlip
All Implemented Interfaces:
CPNodeVar

public class CPNodeVarViewFlip extends Object implements CPNodeVar
  • Constructor Details

    • CPNodeVarViewFlip

      public CPNodeVarViewFlip(CPNodeVar nodeVar)
  • Method Details

    • getSolver

      public CPSolver getSolver()
      Description copied from interface: CPNodeVar
      Returns the solver in which this variable was created.
      Specified by:
      getSolver in interface CPNodeVar
      Returns:
      the solver in which this variable was created.
    • getSeqVar

      public CPSeqVar getSeqVar()
      Description copied from interface: CPNodeVar
      Returns the sequence variable to which this variable is related to.
      Specified by:
      getSeqVar in interface CPNodeVar
      Returns:
      the sequence variable in which this variable was created.
    • node

      public int node()
      Description copied from interface: CPNodeVar
      Returns the node related to this variable.
      Specified by:
      node in interface CPNodeVar
      Returns:
      node related to this
    • isNode

      public boolean isNode(SeqStatus status)
      Description copied from interface: CPNodeVar
      Tells if the node is matching a status.
      Specified by:
      isNode in interface CPNodeVar
      Parameters:
      status - status that must be matched by the node.
      Returns:
      true if the node is matching the status.
    • isRequired

      public CPBoolVar isRequired()
      Description copied from interface: CPNodeVar
      Gives a boolean variable telling if the node is required
      Specified by:
      isRequired in interface CPNodeVar
      Returns:
      boolean variable telling if the node is required
    • fillPred

      public int fillPred(int[] dest, SeqStatus status)
      Description copied from interface: CPNodeVar
      Copies the predecessors matching a status into an array.
      Specified by:
      fillPred in interface CPNodeVar
      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

      public int fillPred(int[] dest)
      Description copied from interface: CPNodeVar
      Copies the predecessors into an array.
      Specified by:
      fillPred in interface CPNodeVar
      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

      public int nPred()
      Description copied from interface: CPNodeVar
      Returns the number of predecessors.
      Specified by:
      nPred in interface CPNodeVar
      Returns:
      the number of predecessors.
    • fillSucc

      public int fillSucc(int[] dest, SeqStatus status)
      Description copied from interface: CPNodeVar
      Copies the successors matching a status into an array.
      Specified by:
      fillSucc in interface CPNodeVar
      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

      public int fillSucc(int[] dest)
      Description copied from interface: CPNodeVar
      Copies the successors matching a status into an array.
      Specified by:
      fillSucc in interface CPNodeVar
      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

      public int nSucc()
      Description copied from interface: CPNodeVar
      Returns the number of successors.
      Specified by:
      nSucc in interface CPNodeVar
      Returns:
      the number of successors.
    • fillInsert

      public int fillInsert(int[] dest)
      Description copied from interface: CPNodeVar
      Fills an array with the insertions of the node. Equivalent to fillPred(node, dest, MEMBER).
      Specified by:
      fillInsert in interface CPNodeVar
      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

      public int nInsert()
      Description copied from interface: CPNodeVar
      Returns the number of insertions of the node.
      Specified by:
      nInsert in interface CPNodeVar
      Returns:
      the number of insertions of the node.
    • whenInsert

      public void whenInsert(Runnable f)
      Description copied from interface: CPNodeVar
      Asks that the closure is called whenever the node is inserted.
      Specified by:
      whenInsert in interface CPNodeVar
      Parameters:
      f - the closure.
    • whenExclude

      public void whenExclude(Runnable f)
      Description copied from interface: CPNodeVar
      Asks that the closure is called whenever the node is excluded.
      Specified by:
      whenExclude in interface CPNodeVar
      Parameters:
      f - the closure.
    • whenRequire

      public void whenRequire(Runnable f)
      Description copied from interface: CPNodeVar
      Asks that the closure is called the node is required.
      Specified by:
      whenRequire in interface CPNodeVar
      Parameters:
      f - the closure.
    • whenInsertRemoved

      public void whenInsertRemoved(Runnable f)
      Description copied from interface: CPNodeVar
      Asks that the closure is called whenever the an insertion for the node has been removed
      Specified by:
      whenInsertRemoved in interface CPNodeVar
      Parameters:
      f - the closure
    • propagateOnInsert

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

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

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

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