Class Variable

    • Field Detail

      • myInteger

        private boolean myInteger
      • myUnbounded

        private transient boolean myUnbounded
      • myValue

        private java.math.BigDecimal myValue
    • Constructor Detail

      • Variable

        Variable​(java.lang.String name,
                 int index)
      • Variable

        Variable​(Variable variableToCopy)
    • Method Detail

      • compareTo

        public int compareTo​(Variable obj)
      • getLowerSlack

        public java.math.BigDecimal getLowerSlack()
      • getUpperSlack

        public java.math.BigDecimal getUpperSlack()
      • getValue

        public java.math.BigDecimal getValue()
      • isBinary

        public boolean isBinary()
        Variable can only be 0 or 1.
      • isInteger

        public boolean isInteger()
        Description copied from class: ModelEntity
        Is this entity (all involved variables) integer?
        Specified by:
        isInteger in class ModelEntity<Variable>
        Returns:
        true if this is an integer variable, otherwise false
      • isNegative

        public boolean isNegative()
        The range includes something < 0.0
      • isPositive

        public boolean isPositive()
        The range includes something > 0.0
      • isValueSet

        public boolean isValueSet()
      • lower

        public Variable lower​(java.lang.Comparable<?> lower)
        Description copied from class: ModelEntity
        Extremely large (absolute value) values are treated as "no limit" (null) and extremely small values are treated as exactly 0.0, unless the input number type is BigDecimal. BigDecimal values are always used as they are.
        Overrides:
        lower in class ModelEntity<Variable>
      • quantifyContribution

        public java.math.BigDecimal quantifyContribution()
      • setInteger

        public void setInteger​(boolean integer)
      • setValue

        public void setValue​(java.lang.Comparable<?> value)
      • upper

        public Variable upper​(java.lang.Comparable<?> upper)
        Description copied from class: ModelEntity
        Extremely large (absolute value) values are treated as "no limit" (null) and extremely small values are treated as exactly 0.0, unless the input number type is BigDecimal. BigDecimal values are always used as they are.
        Overrides:
        upper in class ModelEntity<Variable>
      • value

        public Variable value​(java.math.BigDecimal value)
      • assertFixedValue

        private void assertFixedValue()
      • copy

        Variable copy()
        Internal copy that includes the index
      • doIntegerRounding

        void doIntegerRounding()
        Description copied from class: ModelEntity
        If necessary this method should first determine if this ModelEntity is "integer" or not.

        If it is, then verify if all variable factors are integers or if there exists a simple scalar that will make it so. If so, the lower/upper limits are "integer rounded".

        Specified by:
        doIntegerRounding in class ModelEntity<Variable>
      • isFixed

        boolean isFixed()
      • isUnbounded

        boolean isUnbounded()
      • setFixed

        void setFixed​(java.math.BigDecimal value)
      • setUnbounded

        void setUnbounded​(boolean uncorrelated)
      • validate

        boolean validate​(java.math.BigDecimal value,
                         NumberContext context,
                         BasicLogger appender,
                         boolean relaxed)