Class EqView

    • Constructor Detail

      • EqView

        public EqView​(IntVar var,
                      int cste)
        A boolean view based on var such that var = cste
        Parameters:
        var - an integer variable
        cste - an int
    • Method Detail

      • getBooleanValue

        public ESat getBooleanValue()
      • instantiateTo

        public boolean instantiateTo​(int value,
                                     ICause cause)
                              throws ContradictionException
        Description copied from interface: IntVar
        Instantiates the domain of this to value. The instruction comes from propagator.
        • If the domain of this is already instantiated to value, nothing is done and the return value is false,
        • If the domain of this is already instantiated to another value, then a ContradictionException is thrown,
        • Otherwise, the domain of this is restricted to value and the observers are notified and the return value is true.
        Specified by:
        instantiateTo in interface IntVar
        Overrides:
        instantiateTo in class IntView<IntVar>
        Parameters:
        value - instantiation value (int)
        cause - instantiation releaser
        Returns:
        true if the instantiation is done, false otherwise
        Throws:
        ContradictionException - if the domain become empty due to this action
      • getDomainSize

        public int getDomainSize()
        Description copied from interface: IntVar
        Returns the size of this domain, that is the number of elements in this domain.
        Specified by:
        getDomainSize in interface IntVar
        Overrides:
        getDomainSize in class IntView<IntVar>
        Returns:
        size of the domain
      • isInstantiated

        public boolean isInstantiated()
        Description copied from interface: Variable
        Indicates whether this is instantiated (see implemtations to know what instantiation means).
        Specified by:
        isInstantiated in interface Variable
        Overrides:
        isInstantiated in class IntView<IntVar>
        Returns:
        true if this is instantiated
      • contains

        public boolean contains​(int value)
        Description copied from interface: IntVar
        Checks if a value v belongs to the domain of this
        Parameters:
        value - int
        Returns:
        true if the value belongs to the domain of this, false otherwise.
      • isInstantiatedTo

        public boolean isInstantiatedTo​(int value)
        Description copied from interface: IntVar
        Checks wether this is instantiated to val
        Parameters:
        value - int
        Returns:
        true if this is instantiated to val, false otherwise
      • getLB

        public int getLB()
        Description copied from interface: IntVar
        Retrieves the lower bound of the variable
        Returns:
        the lower bound
      • getUB

        public int getUB()
        Description copied from interface: IntVar
        Retrieves the upper bound of the variable
        Returns:
        the upper bound
      • nextValue

        public int nextValue​(int v)
        Description copied from interface: IntVar
        Returns the first value just after v in this which is in the domain. If no such value exists, returns Integer.MAX_VALUE;

        To iterate over the values in a IntVar, use the following loop:

         int ub = iv.getUB();
         for (int i = iv.getLB(); i <= ub; i = iv.nextValue(i)) {
             // operate on value i here
         }
        Parameters:
        v - the value to start checking (exclusive)
        Returns:
        the next value in the domain
      • nextValueOut

        public int nextValueOut​(int v)
        Description copied from interface: IntVar
        Returns the first value just after v in this which is out of the domain. If v is less than or equal to IntVar.getLB()-2, returns v + 1, if v is greater than or equal to IntVar.getUB(), returns v + 1.
        Parameters:
        v - the value to start checking (exclusive)
        Returns:
        the next value out of the domain
      • previousValue

        public int previousValue​(int v)
        Description copied from interface: IntVar
        Returns the previous value just before v in this. If no such value exists, returns Integer.MIN_VALUE;

        To iterate over the values in a IntVar, use the following loop:

         int lb = iv.getLB();
         for (int i = iv.getUB(); i >= lb; i = iv.previousValue(i)) {
             // operate on value i here
         }
        Parameters:
        v - the value to start checking (exclusive)
        Returns:
        the previous value in the domain
      • previousValueOut

        public int previousValueOut​(int v)
        Description copied from interface: IntVar
        Returns the first value just before v in this which is out of the domain. If v is greater than or equal to IntVar.getUB()+2, returns v - 1, if v is less than or equal to IntVar.getLB(), returns v - 1.
        Parameters:
        v - the value to start checking (exclusive)
        Returns:
        the previous value out of the domain
      • justifyEvent

        public void justifyEvent​(IntEventType mask,
                                 int one,
                                 int two,
                                 int three)
        Description copied from interface: IView
        This methods is related to explanations, it binds an event occurring on the observed variable to the view.
        Parameters:
        mask - type of modification
        one - an int
        two - an int
        three - an int
      • explain

        public void explain​(ExplanationForSignedClause explanation,
                            ValueSortedMap<IntVar> front,
                            Implications ig,
                            int p)
        Description copied from interface: ICause
        Clausal explanation for this cause.

        This method must filled explanations with inferred literals. These literals are inferred from the analysis of (a subset of) conflicting nodes stored in front, the implication graph ig and the current node in conflict, not yet contained in front.

        Optionally, this method can update front by looking for a predecessor of any node that seems more relevant than the declared one.

        Parameters:
        explanation - explanation to compute
        front - ordered map of (variable,node> in the conflict frontier of the implication graph.
        ig - an implication graph
        p - the pivot node out of front