Class COptQuestManifoldVariable

Direct Known Subclasses:
COptQuestAngleVariable, COptQuestAssignmentVariable, COptQuestBinaryMatrixVariable, COptQuestBinaryNDVariable, COptQuestBinaryVectorVariable, COptQuestBSplineCorrectionMatrixVariable, COptQuestBSplineCorrectionVectorVariable, COptQuestBSplineMatrixVariable, COptQuestBSplineVectorVariable, COptQuestBudgetedSelectionVariable, COptQuestChoiceVariable, COptQuestDAGVariable, COptQuestDiscreteMatrixVariable, COptQuestDiscreteNDVariable, COptQuestDiscreteVectorVariable, COptQuestFourierCorrectionMatrixVariable, COptQuestFourierCorrectionVectorVariable, COptQuestFourierMatrixVariable, COptQuestFourierVectorVariable, COptQuestIncrementalLowRankCorrectionMatrixVariable, COptQuestIncrementalTimeSeriesCorrectionVectorVariable, COptQuestIntegerMatrixVariable, COptQuestIntegerNDVariable, COptQuestIntegerVectorVariable, COptQuestItemSelectionVariable, COptQuestLowRankCorrectionMatrixVariable, COptQuestLowRankMatrixVariable, COptQuestMatrixVariable, COptQuestMixtureVariable, COptQuestMultiChoiceVariable, COptQuestMultiStageSequenceVariable, COptQuestNDVariable, COptQuestOutputNDVariable, COptQuestPartitionVariable, COptQuestPathVariable, COptQuestPolicySequenceVariable, COptQuestRegionVariable, COptQuestSequenceVariable, COptQuestSphericalAngleVariable, COptQuestSphericalRegionVariable, COptQuestSplineCorrectionMatrixVariable, COptQuestSplineCorrectionVectorVariable, COptQuestSplineMatrixVariable, COptQuestSplineVectorVariable, COptQuestTimeSeriesCorrectionVectorVariable, COptQuestTimeSeriesVectorVariable, COptQuestTopologicalSequenceVariable, COptQuestTreeVariable, COptQuestUserControlledMatrixVariable, COptQuestUserControlledVectorVariable, COptQuestVectorVariable

public abstract class COptQuestManifoldVariable extends COptQuestUserControlledVariable
Base class for the manifold variables.

A manifold variable is a decision variable whose values must stay inside a structured set, for example an angle on an arc, a ranking of a list of items, or a matrix of limited rank. In every solution that the engine generates, and in every suggested solution, the values of a manifold variable are inside its set. The engine uses the values of an evaluated solution or a required solution as given.

The engine gives the values of a manifold variable generated names of the form <name>@<suffix>, where <name> is the base name. The description of each type gives its generated names and the meaning of each value.

Each generated name is in one of three lists:

  • getInputVariables(): ordinary decision variables. The engine chooses these values directly, and 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.
  • getProjectedInputVariables(): the decision values of the other types, for example angle@theta or mix@compA, and the item scores of a policy sequence variable. Your evaluator reads these values as inputs. Most manifold types use only this list.
  • getOutputVariables(): for the output vector, output matrix and output N-dimensional types, the values that your evaluator writes. For a policy sequence variable, the coefficient, contribution and confidence values, which the engine computes. Your evaluator does not write the values of a policy sequence variable.

A list that a type does not use is empty. No method returns null. OptQuestSolution.GetInputNames() returns the names in the first two lists, and OptQuestSolution.GetOutputNames() returns the names in the third list.

A constraint that uses a name from getProjectedInputVariables(), for example mix@compA <= 0.3, is checked after the evaluation, like a constraint on an output. Your evaluator can receive values that break the constraint, and the solution is then infeasible. The same applies to a constraint that uses a random variable. A constraint on the values of an item selection variable or a budgeted selection variable is checked before the evaluation, like a constraint on any other ordinary input.

Some manifold variable types add constraints to the model. getConstraints() returns them.

In most programs, you do not construct a manifold class. You add the variable with the matching Add...Variable method of OptQuestModel, for example OptQuestModel.AddSequenceVariable(String, String[], Integer), and you read its values with OptQuestSolution.GetValue(String) and the generated names. For the output vector, output matrix and output N-dimensional types, your evaluator sets the values with OptQuestSolution.SetValue(String, double). Construct a manifold class only when you add the variable with COptQuestOptimization.AddVariable(COptQuestVariable).

  • Method Details

    • getInputVariables

      public abstract List<COptQuestVariable> getInputVariables()
      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.

      Returns:
      fixed-size or immutable list of input variables; never null
    • getProjectedInputVariables

      public abstract List<COptQuestUserControlledVariable> getProjectedInputVariables()
      Returns the decision values of this manifold variable that are not ordinary decision variables.

      For example, an angle variable returns angle@theta, and a mixture variable returns one mix@<component> name for each component. In every solution that the engine generates, and in every suggested solution, these values are inside the set of the variable. Your evaluator reads them as inputs: OptQuestSolution.GetInputNames() returns them.

      A constraint that uses one of these names is checked after the evaluation, like a constraint on an output. Your evaluator can receive values that break the constraint, and the solution is then infeasible.

      Returns:
      fixed-size or immutable list of these variables; never null
    • getOutputVariables

      public abstract List<COptQuestUserControlledVariable> getOutputVariables()
      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.

      Returns:
      fixed-size or immutable list of outputs; never null
    • getConstraints

      public List<COptQuestStringConstraint> getConstraints()
      Returns the constraints that this manifold variable adds to the model.

      The engine adds these constraints to the model when the variable is added. Most manifold variable types add no constraints and return an empty list.

      Returns:
      list of constraints; never null