Class COptQuestVariable

java.lang.Object
com.opttek.optquest.COptQuestVariable
Direct Known Subclasses:
COptQuestContinuousVariable, COptQuestDiscreteVariable, COptQuestPermutationVariable, COptQuestUserControlledVariable

public abstract class COptQuestVariable extends Object
COptQuestVariable is a pure virtual class that defines a decision variable.
  • Constructor Details

    • COptQuestVariable

      public COptQuestVariable(String name)
      Constructor that assigns a name to the variable.
      Parameters:
      name - alphanumeric name. Note: the name can contain blanks or special characters. If the variable name is used in a COptQuestStringConstraint equation, the name should be enclosed in square brackets [] in the COptQuestStringConstraint string equation.
    • COptQuestVariable

      public COptQuestVariable()
      Default constructor
    • COptQuestVariable

      public COptQuestVariable(String name, double lowerBound, double upperBound)
      Constructor that assigns a name to the variable and sets the lower bound and upper bound.
      Parameters:
      name - alphanumeric name. Note: the name can contain blanks or special characters. If the variable name is used in a COptQuestStringConstraint equation, the name should be enclosed in square brackets [] in the COptQuestStringConstraint string equation.
      lowerBound - a value between -pow(2,31) and +pow(2,31)-1
      upperBound - a value between -pow(2,31) and +pow(2,31)-1
    • COptQuestVariable

      public COptQuestVariable(double lowerBound, double upperBound)
      Constructor that sets the lower bound and upper bound.
      Parameters:
      lowerBound - a value between -pow(2,31) and +pow(2,31)-1
      upperBound - a value between -pow(2,31) and +pow(2,31)-1
  • Method Details

    • GetLowerBound

      public double GetLowerBound()
      Get the lower bound
      Returns:
      lower bound
    • SetLowerBound

      public void SetLowerBound(double lowerBound) throws COptQuestException
      Sets the lower bound of the decision variable
      Parameters:
      lowerBound - a value between -pow(2,31) and +pow(2,31)-1
      Throws:
      COptQuestException - if invalid bounds provided
    • GetUpperBound

      public double GetUpperBound()
      Get the upper bound
      Returns:
      upper bound
    • SetUpperBound

      public void SetUpperBound(double upperBound) throws COptQuestException
      Sets the upper bound of the decision variable
      Parameters:
      upperBound - a value between -pow(2,31) and +pow(2,31)-1
      Throws:
      COptQuestException - if invalid bounds provided
    • SetExclusiveRange

      public void SetExclusiveRange(double low, double high) throws COptQuestException
      Defines a range of values that will be excluded as possible solutions. Any value > low and < high will be excluded. Multiple ranges can be defined on one variable.
      Parameters:
      low - - any value > low will be excluded
      high - - any value < high will be excluded
      Throws:
      COptQuestException - if invalid range provided
    • getVarRange

      public double getVarRange()
    • getID

      public int getID()
      Returns the index into the Solution.m_VarValue array that corresponds to this variable.
      Returns:
      the index
    • SetName

      public void SetName(String name)
      Assigns a name to the variable. Names must be alphanumeric and cannot be a function name recognized by the COptQuestEquationSolver.
      Parameters:
      name - = name of the variable.
    • GetDOEUpperBound

      public double GetDOEUpperBound()
      Get the DOE upper bound
      Returns:
      upper bound
    • GetDOELowerBound

      public double GetDOELowerBound()
      Get the DOE lower bound
      Returns:
      lower bound
    • GetSuggestedValue

      public double GetSuggestedValue()
      Get the suggested value
      Returns:
      suggested value
    • GetName

      public String GetName()
      Get the name
      Returns:
      name
    • GetStepSize

      public double GetStepSize()
      Get the step size
      Returns:
      step size
    • GetNumberOfExclusiveRanges

      public int GetNumberOfExclusiveRanges()
      Returns the number of exclusive ranges defined for this variable. Each call to COptQuestVariable.SetExclusiveRange() defines one range.
      Returns:
      - the number of exclusive ranges defined for this variable.
    • GetExclusiveLowerBoundAt

      public double GetExclusiveLowerBoundAt(int index)
      Returns the lower bound of the exclusive range identified by the index
      Parameters:
      index - 0 based index
      Returns:
      lower bound of the exclusive range identified by the index
    • GetExclusiveUpperBoundAt

      public double GetExclusiveUpperBoundAt(int index)
      Returns the upper bound of the exclusive range identified by the index
      Parameters:
      index - 0 based index
      Returns:
      upper bound of the exclusive range identified by the index
    • isZeroOne

      public boolean isZeroOne()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object