Class COptQuestOutputNDVariable


public class COptQuestOutputNDVariable extends COptQuestManifoldVariable
An output N-dimensional variable: an array of output variables with the shape dims. The elements are ordinary output variables.

Variable names: <name>@<i1>,<i2>,... for each element, with one 1-based index for each dimension. The last index changes fastest. With two or more dimensions, each name contains a comma, so write it in brackets in an expression: [<name>@1,2,3].

Your evaluator writes a value to each element before it submits the solution.

In most programs, you add this variable with OptQuestModel.AddOutputNDVariable and your evaluator sets its values with OptQuestSolution.SetValue(String, double) and the generated names. Construct this class only when you add the variable with COptQuestOptimization.AddVariable(COptQuestVariable).

See Also:
  • OptQuestModel.AddOutputNDVariable(String, int[])
  • Constructor Details

    • COptQuestOutputNDVariable

      public COptQuestOutputNDVariable(String name, int[] dims) throws COptQuestException
      Creates an output N-dimensional variable.
      Parameters:
      name - base name of the variable
      dims - size of each dimension; there must be at least one dimension, and each size must be at least 1
      Throws:
      COptQuestException - if dims is null or empty, or if a size is less than 1
  • Method Details

    • getInputVariables

      public List<COptQuestVariable> getInputVariables()
      Returns an empty list, because an output N-dimensional variable has no ordinary input variables.

      The values of an output N-dimensional variable are in the list that getOutputVariables() returns. Your evaluator writes them. That list has one variable <name>@<i1>,<i2>,... for each element.

      Returns:
      an empty list
    • getProjectedInputVariables

      public List<COptQuestUserControlledVariable> getProjectedInputVariables()
      Returns an empty list, because the values of an output N-dimensional variable are outputs.

      The values of an output N-dimensional variable are in the list that getOutputVariables() returns. Your evaluator writes them. That list has one variable <name>@<i1>,<i2>,... for each element.

      Returns:
      an empty list
    • getOutputVariables

      public List<COptQuestUserControlledVariable> getOutputVariables()
      Description copied from class: COptQuestManifoldVariable
      Returns the outputs of this manifold variable.

      For the output vector, output matrix and output N-dimensional variables, your evaluator writes these values before it submits the solution. For a policy sequence variable, the engine computes these values, and your evaluator must not write them. For all other manifold variables, the list is empty.

      Specified by:
      getOutputVariables in class COptQuestManifoldVariable
      Returns:
      fixed-size or immutable list of outputs; never null