Class Implications

  • Direct Known Subclasses:
    LazyImplications

    public abstract class Implications
    extends Object
    A abstract class that maintains an implication graph, built from events generated thanks to the propagation.

    Project: choco-solver.

    Since:
    25/01/2017.
    Author:
    Charles Prud'homme
    • Constructor Detail

      • Implications

        public Implications()
    • Method Detail

      • init

        public abstract void init​(Model model)
        Initialize this class
        Parameters:
        model - if needed, a reference to the model that uses this class
      • reset

        public abstract void reset()
        Reset the model, set at its creation state, before calling init(Model).
      • pushEvent

        public abstract void pushEvent​(IntVar var,
                                       ICause cause,
                                       IntEventType mask,
                                       int one,
                                       int two,
                                       int three)
        Push an event
        Parameters:
        var - modified variable
        cause - cause of the modification
        mask - modification mask
        one - an int
        two - an int
        three - an int
      • size

        public abstract int size()
        Returns:
        the number of nodes in the implication graph.
      • collectNodesFromConflict

        public abstract void collectNodesFromConflict​(ContradictionException conflict,
                                                      ValueSortedMap<IntVar> front)
        Fill set with indices of nodes that throws the conflict
        Parameters:
        conflict - the failure, in the form of a ContradictionException
        front - (initially empty) map of (node, variable) in conflict
      • predecessorsOf

        public abstract void predecessorsOf​(int p,
                                            ValueSortedMap<IntVar> front)
        Retrieve the nodes that are predecessors of node p in this and put them into set.
        Parameters:
        p - index of the node whom predecessors have to be found
        front - map of (node, variable) in conflict
      • findPredecessor

        public abstract void findPredecessor​(ValueSortedMap<IntVar> front,
                                             IntVar vi,
                                             int p)
        Find the direct predecessor of a node, declared on variable vi, starting from node at position p.
        Parameters:
        front - the set to update
        vi - the variable to look the predecessor for
        p - the rightmost position of the node (below means outdated node).
      • getCauseAt

        public abstract ICause getCauseAt​(int idx)
        Get the ICause declared in node idx
        Parameters:
        idx - position of the node to query
        Returns:
        the cause declared in node idx
      • getEventMaskAt

        public abstract int getEventMaskAt​(int idx)
        Get the mask of event declared in node idx. The mask can be a bitwise operation over mask of IntEventType.
        Parameters:
        idx - position of the node to query
        Returns:
        the event declared in node idx
      • getIntVarAt

        public abstract IntVar getIntVarAt​(int idx)
        Get the IntVar declared in node idx
        Parameters:
        idx - position of the node to query
        Returns:
        the intvar declared in node idx
      • getValueAt

        public abstract int getValueAt​(int idx)
        Get the value declared in node idx
        Parameters:
        idx - position of the node to query
        Returns:
        the value declared in node idx
      • getDecisionLevelAt

        public abstract int getDecisionLevelAt​(int idx)
        Get the decision level declared in node idx
        Parameters:
        idx - position of the node to query
        Returns:
        the decision level declared in node idx
      • getDomainAt

        public abstract IntIterableRangeSet getDomainAt​(int idx)
        Get the IntIterableRangeSet that represents domain declared in node idx
        Parameters:
        idx - position of the node to query
        Returns:
        the domain declared in node idx
      • getPredecessorOf

        public abstract int getPredecessorOf​(int idx)
        Get the position of precedent entry of the one declared in node idx
        Parameters:
        idx - position of the node to query
        Returns:
        its ancestor
      • getRootDomain

        public abstract IntIterableRangeSet getRootDomain​(IntVar var)
        Get the IntIterableRangeSet that represents domain of this variables as declared in the model
        Parameters:
        var - variable to query
        Returns:
        the domain declared in node idx
      • copyComplementSet

        public abstract void copyComplementSet​(IntVar var,
                                               IntIterableRangeSet set,
                                               IntIterableRangeSet dest)
        Copy in dest the complement of set wrt to root domain of var
        Parameters:
        var - variable to query
      • undoLastEvent

        public abstract void undoLastEvent()
        Undo the last event stored, use only when dealing with views.
      • tagDecisionLevel

        public abstract void tagDecisionLevel()