Class COptQuestVectorVariable


public class COptQuestVectorVariable extends COptQuestManifoldVariable
A vector variable: n continuous variables. The elements are ordinary input variables.

Variable names: <name>@1 to <name>@n, one for each element.

The value of each element is a continuous value from min to max.

In most programs, you add this variable with OptQuestModel.AddVectorVariable and read its values with OptQuestSolution.GetValue(String) and the generated names. Construct this class only when you add the variable with COptQuestOptimization.AddVariable(COptQuestVariable).

See Also:
  • OptQuestModel.AddVectorVariable(String, int, double, double)
  • Constructor Details

    • COptQuestVectorVariable

      public COptQuestVectorVariable(String name, int n, double min, double max) throws COptQuestException
      Creates a vector variable.
      Parameters:
      name - base name of the variable
      n - number of elements; must be at least 1
      min - lower bound of each element
      max - upper bound of each element
      Throws:
      COptQuestException - if n is less than 1
  • Method Details

    • getProjectedInputVariables

      public List<COptQuestUserControlledVariable> getProjectedInputVariables()
      Returns an empty list, because the values of a vector variable are ordinary inputs.

      The values are in the list that getInputVariables() returns. That list has the variables <name>@1 to <name>@n, one for each element.

      Returns:
      an empty list
    • getOutputVariables

      public List<COptQuestUserControlledVariable> getOutputVariables()
      Returns an empty list, because a vector variable has no output variables.

      The values of a vector variable are ordinary inputs, so they are in the list that getInputVariables() returns. That list has the variables <name>@1 to <name>@n, one for each element.

      Returns:
      an empty list
    • getInputVariables

      public List<COptQuestVariable> getInputVariables()
      Description copied from class: COptQuestManifoldVariable
      Returns the ordinary decision variables of this manifold variable.

      The engine chooses these values directly. Your evaluator reads them as inputs. The item selection and budgeted selection types use this list, and so do the vector, matrix and N-dimensional types of continuous, integer, discrete and binary variables. For every other type, the list is empty.

      Specified by:
      getInputVariables in class COptQuestManifoldVariable
      Returns:
      fixed-size or immutable list of input variables; never null