Class COptQuestTopologicalSequenceVariable
In every solution that the engine generates, the order meets every precedence: a predecessor always has a smaller rank than the task that depends on it.
Variable names: <name>@<task> for each task, in the order of tasks. The
value of each name is the integer rank of that task in the order, where 1 is first and n is last.
The ranks are a permutation of 1 to n.
In a suggested solution, the engine keeps an order that meets every precedence, and it
gives equal ranks different values in the order of tasks. If the order does not meet a
precedence, the engine changes it: at each step, of the tasks that can go next, the task
with the smallest suggested rank goes next.
In most programs, you add this variable with
OptQuestModel.AddTopologicalSequenceVariable
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an empty list, because a topological sequence variable has no ordinary input variables.Returns an empty list, because a topological 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
-
COptQuestTopologicalSequenceVariable
public COptQuestTopologicalSequenceVariable(String name, String[] tasks, Map<String, List<String>> predecessors) throws COptQuestExceptionCreates a topological sequence variable.The constructor checks that no task lists itself as a predecessor and that the precedences form no cycle. It ignores names in
predecessorsthat are not intasks.- Parameters:
name- base name of the variabletasks- names of the tasks; there must be at least one, and each must be unique and must not contain whitespace, a semicolon, a comma or@predecessors- for each task that has predecessors, the tasks that must come before it; null for no precedences- Throws:
COptQuestException- iftasksis null or empty or holds a name that is not valid, if a task lists itself as a predecessor, or if the precedences form a cycle
-
-
Method Details
-
getInputVariables
Returns an empty list, because a topological sequence variable has no ordinary input variables.The values of a topological sequence variable are in the list that
getProjectedInputVariables()returns. That list has one variable<name>@<task>for each task.- Returns:
- an empty list
-
getOutputVariables
Returns an empty list, because a topological sequence variable has no output variables.The values of a topological sequence variable are in the list that
getProjectedInputVariables()returns. That list has one variable<name>@<task>for each task.- 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
-