Class COptQuestDesignVariable


public class COptQuestDesignVariable extends COptQuestDiscreteVariable
Design variables are used when value of the decision variable represents an alternative, and not a quantity. For example, the variable may take on the values red, green or blue. Design variables are useful in optimization problems where the decision variables consist of choosing the best alternative from a catalog, and a larger number may not imply the commitment of more resources. Therefore, choice #10 may not be a more costly or a better choice than choice #1. These variables are defined by a lower bound, an upper bound, and a step size that controls the number of choices available within the specified range.
  • Constructor Details

    • COptQuestDesignVariable

      public COptQuestDesignVariable(String name, double lowerBound, double upperBound, double step)
      Constructor that assigns a name to the variable and sets the name, lower bound, upper bound, and step size.
      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
      step - step size
    • COptQuestDesignVariable

      public COptQuestDesignVariable(double lowerBound, double upperBound, double step)
      Constructor that sets the lower bound, upper bound, and step size.
      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
      step - step size
    • COptQuestDesignVariable

      public COptQuestDesignVariable()
      Default constructor
  • Method Details

    • SetExclusiveRange

      public void SetExclusiveRange(double low, double high) throws COptQuestException
      Illegal method for design variables.
      Overrides:
      SetExclusiveRange in class COptQuestVariable
      Parameters:
      low - - any value > low will be excluded
      high - - any value < high will be excluded
      Throws:
      COptQuestException - if invalid range provided