Class BoundsVar

java.lang.Object
org.jacop.floats.constraints.linear.BoundsVar
All Implemented Interfaces:
Stateful, MutableVar

class BoundsVar extends Object implements MutableVar
Defines a variable for Linear constraints to keep intermediate bounds values
Version:
4.9
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) int
     
    (package private) Store
     
    (package private) BoundsVarValue
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    BoundsVar(Store store, double min, double max)
     
    BoundsVar(Store store, double min, double max, double lb, double ub)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) int
     
    It returns the earlier value of variable comparing to the current one.
    void
    removeLevel(int removeLevel)
    This function is called in case of the backtrack, so a constraint can clear the queue of changed variables which is no longer valid.
    void
    It replace the current representation of the value with a new representation.
    (package private) int
     
    It returns string representation of Mutable variable.
    void
    update(double min, double max, double lb, double ub)
     
    void
    It updates the value of a mutable variable based on value given as a parameter, the stamp level of current value and stamp value of passed value.
    It returns current value of MutableVariable.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.jacop.api.Stateful

    isStateful
  • Field Details

  • Constructor Details

    • BoundsVar

      BoundsVar(Store store)
    • BoundsVar

      BoundsVar(Store store, double min, double max)
    • BoundsVar

      BoundsVar(Store store, double min, double max, double lb, double ub)
  • Method Details

    • index

      int index()
    • previous

      public MutableVarValue previous()
      Description copied from interface: MutableVar
      It returns the earlier value of variable comparing to the current one.
      Specified by:
      previous in interface MutableVar
      Returns:
      previous value of a mutable variable.
    • removeLevel

      public void removeLevel(int removeLevel)
      Description copied from interface: Stateful
      This function is called in case of the backtrack, so a constraint can clear the queue of changed variables which is no longer valid. This function is called *before* all timestamps, variables, mutablevariables have reverted to their previous value.
      Specified by:
      removeLevel in interface Stateful
      Parameters:
      removeLevel - the level which is being removed.
    • setCurrent

      public void setCurrent(MutableVarValue o)
      Description copied from interface: MutableVar
      It replace the current representation of the value with a new representation. It ignores the store level.
      Specified by:
      setCurrent in interface MutableVar
      Parameters:
      o - value to which a mutable variable is set.
    • stamp

      int stamp()
    • toString

      public String toString()
      Description copied from interface: MutableVar
      It returns string representation of Mutable variable.
      Specified by:
      toString in interface MutableVar
      Overrides:
      toString in class Object
    • update

      public void update(MutableVarValue val)
      Description copied from interface: MutableVar
      It updates the value of a mutable variable based on value given as a parameter, the stamp level of current value and stamp value of passed value.
      Specified by:
      update in interface MutableVar
      Parameters:
      val - it specifies the new value of a mutable variable.
    • update

      public void update(double min, double max, double lb, double ub)
    • value

      public MutableVarValue value()
      Description copied from interface: MutableVar
      It returns current value of MutableVariable.
      Specified by:
      value in interface MutableVar
      Returns:
      current value of the mutable variable.