Class COptQuestSequenceVariable
In every solution that the engine generates, the ranks are valid. In a full ranking, the
values are a permutation of 1 to n, where n is the number of components and 1 is the highest
priority. In a top-k ranking, the first topK components get the ranks 1 to topK,
and every other component gets the rank topK + 1.
Variable names: <name>@<component> for each component, in the order of
components. The value of each name is the integer rank of that component. The
constructors that take k name the components 1 to k.
When two components have the same rank in a suggested solution, the component that comes
first in components gets the better rank.
In most programs, you add this variable with
OptQuestModel.AddSequenceVariable
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
ConstructorsConstructorDescriptionCOptQuestSequenceVariable(String name, int k) Creates a full ranking ofkcomponents named 1 to k.COptQuestSequenceVariable(String name, int k, Integer topK) Creates a ranking ofkcomponents named 1 to k.COptQuestSequenceVariable(String name, String[] components) Creates a full ranking of the given components.COptQuestSequenceVariable(String name, String[] components, Integer topK) Creates a ranking of the given components. -
Method Summary
Modifier and TypeMethodDescriptionReturns an empty list, because a sequence variable has no ordinary input variables.Returns an empty list, because a sequence variable has no output variables.Returns the decision values of this manifold variable that are not ordinary decision variables.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
-
COptQuestSequenceVariable
Creates a full ranking ofkcomponents named 1 to k.- Parameters:
name- base name of the variablek- number of components; must be at least 1- Throws:
COptQuestException- ifkis less than 1
-
COptQuestSequenceVariable
Creates a ranking ofkcomponents named 1 to k.- Parameters:
name- base name of the variablek- number of components; must be at least 1topK- null for a full ranking, or the number of components to rank. A value ofkor more gives a full ranking, and a value less than 1 is used as 1. WithtopK= 1, the most important component gets rank 1, and every other component gets rank 2.- Throws:
COptQuestException- ifkis less than 1
-
COptQuestSequenceVariable
Creates a full ranking of the given components.- Parameters:
name- base name of the variablecomponents- names of the components; each must be unique and must not contain whitespace, a semicolon, a comma or@- Throws:
COptQuestException- ifcomponentsis null or empty, or holds a name that is not valid
-
COptQuestSequenceVariable
public COptQuestSequenceVariable(String name, String[] components, Integer topK) throws COptQuestException Creates a ranking of the given components.- Parameters:
name- base name of the variablecomponents- names of the components; each must be unique and must not contain whitespace, a semicolon, a comma or@topK- null for a full ranking, or the number of components to rank. A value of n or more gives a full ranking, and a value less than 1 is used as 1. WithtopK= 1, the most important component gets rank 1, and every other component gets rank 2.- Throws:
COptQuestException- ifcomponentsis null or empty, or holds a name that is not valid
-
-
Method Details
-
getInputVariables
Returns an empty list, because a sequence variable has no ordinary input variables.The values of a sequence variable are in the list that
getProjectedInputVariables()returns. That list has one variable<name>@<component>for each component.- Returns:
- an empty list
-
getOutputVariables
Returns an empty list, because a sequence variable has no output variables.The values of a sequence variable are in the list that
getProjectedInputVariables()returns. That list has one variable<name>@<component>for each component.- Returns:
- an empty list
-
getProjectedInputVariables
Description copied from class:COptQuestManifoldVariableReturns 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 onemix@<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.
- Specified by:
getProjectedInputVariablesin classCOptQuestManifoldVariable- Returns:
- fixed-size or immutable list of these variables; never
null
-