Interface RealVar

    • Method Detail

      • getLB

        double getLB()
        Retrieves the lower bound of the variable
        Returns:
        the lower bound
      • getUB

        double getUB()
        Retrieves the upper bound of the variable
        Returns:
        the upper bound
      • updateLowerBound

        boolean updateLowerBound​(double value,
                                 ICause cause)
                          throws ContradictionException
        Updates the lower bound of the domain of this to value. The instruction comes from propagator.
        • If value is smaller than the lower bound of the domain, nothing is done and the return value is false,
        • if updating the lower bound to value leads to a dead-end (domain wipe-out), a ContradictionException is thrown,
        • otherwise, if updating the lower bound to value can be done safely, the event type is created (the original event can be promoted) and observers are notified and the return value is true
        Parameters:
        value - new lower bound (included)
        cause - updating releaser
        Returns:
        true if the lower bound has been updated, false otherwise
        Throws:
        ContradictionException - if the domain become empty due to this action
      • updateUpperBound

        boolean updateUpperBound​(double value,
                                 ICause cause)
                          throws ContradictionException
        Updates the upper bound of the domain of this to value. The instruction comes from propagator.
        • If value is greater than the upper bound of the domain, nothing is done and the return value is false,
        • if updating the upper bound to value leads to a dead-end (domain wipe-out), a ContradictionException is thrown,
        • otherwise, if updating the upper bound to value can be done safely, the event type is created (the original event can be promoted) and observers are notified and the return value is true
        Parameters:
        value - new upper bound (included)
        cause - update releaser
        Returns:
        true if the upper bound has been updated, false otherwise
        Throws:
        ContradictionException - if the domain become empty due to this action
      • updateBounds

        boolean updateBounds​(double lowerbound,
                             double upperbound,
                             ICause cause)
                      throws ContradictionException
        Updates the bounds of the domain of this to value. The instruction comes from propagator.
        • If the interval defined by [lowerbound,upperbound] includes the domain of this, nothing is done and the return value is false,
        • if updating the domain leads to a dead-end (domain wipe-out), a ContradictionException is thrown,
        • otherwise, if updating the domain be done safely, the event type is created (the original event can be promoted) and observers are notified and the return value is true
        Parameters:
        lowerbound - new lower bound (included)
        upperbound - new upper bound (included)
        cause - update releaser
        Returns:
        true if the upper bound has been updated, false otherwise
        Throws:
        ContradictionException - if the domain become empty due to this action
      • getPrecision

        double getPrecision()
      • realVar

        default RealVar realVar​(double p)
        Specified by:
        realVar in interface CArExpression
        Parameters:
        p - precision of the variable to return
        Returns:
        the arithmetic expression as an RealVar. If necessary, it creates intermediary variable and posts intermediary constraints