Class COptQuestDiscreteMatrixVariable
m by n matrix of discrete variables. The
elements are ordinary input variables.
Variable names: <name>@<row>,<col> for each element, with 1-based row
and column numbers, row by row. Each name contains a comma, so write it in brackets in an
expression: [<name>@1,2].
Each element takes the values min, min + step, min +
2 × step, and so on. The largest value is the one nearest to max, so
it can differ from max when max - min is not a whole multiple
of step.
In most programs, you add this variable with
OptQuestModel.AddDiscreteMatrixVariable
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:
-
Constructor Summary
ConstructorsConstructorDescriptionCOptQuestDiscreteMatrixVariable(String name, int m, int n, double min, double max, double step) Creates a discrete matrix variable. -
Method Summary
Modifier and TypeMethodDescriptionReturns the ordinary decision variables of this manifold variable.Returns an empty list, because a discrete matrix variable has no output variables.Returns an empty list, because the values of a discrete matrix variable are ordinary inputs.Methods inherited from class com.opttek.optquest.COptQuestManifoldVariable
getConstraintsMethods inherited from class com.opttek.optquest.COptQuestUserControlledVariable
GetReplicationStatistic, GetReplicationStatisticValue, SetExclusiveRange, SetLowerBound, SetReplicationStatistic, SetUpperBoundMethods inherited from class com.opttek.optquest.COptQuestVariable
equals, GetDOELowerBound, GetDOEUpperBound, GetExclusiveLowerBoundAt, GetExclusiveUpperBoundAt, getID, GetLowerBound, GetName, GetNumberOfExclusiveRanges, GetStepSize, GetSuggestedValue, GetUpperBound, getVarRange, hashCode, isZeroOne, SetName
-
Constructor Details
-
COptQuestDiscreteMatrixVariable
public COptQuestDiscreteMatrixVariable(String name, int m, int n, double min, double max, double step) throws COptQuestException Creates a discrete matrix variable.- Parameters:
name- base name of the variablem- number of rows; must be at least 1n- number of columns; must be at least 1min- lower bound of each elementmax- upper bound of each elementstep- step between values; must be greater than 0- Throws:
COptQuestException- ifmornis less than 1
-
-
Method Details
-
getProjectedInputVariables
Returns an empty list, because the values of a discrete matrix variable are ordinary inputs.The values are in the list that
getInputVariables()returns. That list has one variable<name>@<row>,<col>for each element.- Returns:
- an empty list
-
getOutputVariables
Returns an empty list, because a discrete matrix variable has no output variables.The values of a discrete matrix variable are ordinary inputs, so they are in the list that
getInputVariables()returns. That list has one variable<name>@<row>,<col>for each element.- Returns:
- an empty list
-
getInputVariables
Description copied from class:COptQuestManifoldVariableReturns 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:
getInputVariablesin classCOptQuestManifoldVariable- Returns:
- fixed-size or immutable list of input variables; never
null
-