Class COptQuestPolicySequenceVariable
In every solution that the engine generates, the item scores come from one set of feature weights applied to the feature matrix. Sort the items by descending score to get the ranked list: a higher score means a higher priority. This is the opposite of a sequence variable, where 1 is the highest priority.
Variable names:
<name>@<itemName>for each item, an input: the priority score of that item.<name>@<featureName>for each feature, an output: the coefficient of that feature, which is the change in score for one unit of the feature. Multiply each raw feature value of an item by its coefficient and add the products to score a new item. That sum can differ from the reported score by a constant that is the same for every item, so it gives the same order.<name>@<featureName>@contributionfor each feature, an output: the signed share of that feature in the rule, in [-1, 1]. The absolute values of all the contributions sum to 1.<name>@<featureName>@confidencefor each feature, an output: a confidence in [0, 1] for the weight of that feature. A feature whose values are all equal gets 0.<name>@<itemName>@confidencefor each item, an output: a confidence in [0, 1] that the item is in the right place relative to its neighbors in the order. With one item, the value is 1.
The engine computes every value of a policy sequence variable. The item scores are inputs. The coefficients, the contributions and the confidences are outputs. Your evaluator can read these outputs, and must not write them. Item names and feature names are in one set of names, so every item name and feature name must be different from all the others.
Give the feature values in their own units. You do not need to scale them. In a suggested solution, the engine reads only the item scores, and it can change them. For an evaluated or required solution, the engine computes the coefficient, contribution and confidence outputs from the policy that best fits the supplied item scores. It does not change the scores.
Each item name and feature name must not contain whitespace, a semicolon, a comma or @.
In most programs, you add this variable with
OptQuestModel.AddPolicySequenceVariable
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
ConstructorsConstructorDescriptionCOptQuestPolicySequenceVariable(String name, double[][] featureMatrix, String[] itemNames, String[] featureNames) Creates a policy sequence variable. -
Method Summary
Modifier and TypeMethodDescriptionReturns an empty list, because a policy sequence variable has no ordinary input variables.Returns the outputs of this manifold variable.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
-
COptQuestPolicySequenceVariable
public COptQuestPolicySequenceVariable(String name, double[][] featureMatrix, String[] itemNames, String[] featureNames) throws COptQuestException Creates a policy sequence variable.- Parameters:
name- base name of the variablefeatureMatrix- feature values, one row for each item and one column for each featureitemNames- names of the items, one for each row offeatureMatrixfeatureNames- names of the features, one for each column offeatureMatrix- Throws:
COptQuestException- iffeatureMatrixis empty, if the number of item names is not the number of rows, if the number of feature names is not the number of columns, or if an item name or feature name is not valid or is used more than once
-
-
Method Details
-
getInputVariables
Returns an empty list, because a policy sequence variable has no ordinary input variables.The item scores of a policy sequence variable are in the list that
getProjectedInputVariables()returns. Its coefficient, contribution and confidence values are in the list thatgetOutputVariables()returns.- 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
-
getOutputVariables
Description copied from class:COptQuestManifoldVariableReturns 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:
getOutputVariablesin classCOptQuestManifoldVariable- Returns:
- fixed-size or immutable list of outputs; never
null
-