Class COptQuestDAGVariable
In every solution that the engine generates, the edges form no cycle. Any DAG over the nodes can occur, including the graph with no edges.
Variable names: <name>@<nodeFrom>,<nodeTo> for every ordered pair of nodes,
including a node paired with itself: the full n by n adjacency matrix, row by row in the order of
nodeNames. The value of each name is 1 if the edge from nodeFrom to
nodeTo is present and 0 if it is not. The diagonal is always 0. Each name contains a
comma, so write it in brackets in an expression: [<name>@A,B].
In a suggested solution, a value greater than 0.5 is an edge. The engine keeps a suggested DAG as it is. If the suggested edges form a cycle, the engine removes edges until no cycle remains.
In most programs, you add this variable with
OptQuestModel.AddDAGVariable 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
ConstructorsConstructorDescriptionCOptQuestDAGVariable(String name, String[] nodeNames) Creates a DAG variable over the given nodes.COptQuestDAGVariable(String name, String[] nodeNames, String startNode, String endNode, boolean connected, Map<String, List<String>> predecessors) Creates a DAG variable over the given nodes, with an optional start node, an optional end node, the connected option and optional precedences. -
Method Summary
Modifier and TypeMethodDescriptionReturns an empty list, because a DAG variable has no ordinary input variables.Returns an empty list, because a DAG 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
-
COptQuestDAGVariable
Creates a DAG variable over the given nodes.- Parameters:
name- base name of the variablenodeNames- names of the nodes; there must be at least one, and each must be unique and must not contain whitespace, a semicolon, a comma or@- Throws:
COptQuestException- ifnodeNamesis null or empty, or holds a name that is not valid
-
COptQuestDAGVariable
public COptQuestDAGVariable(String name, String[] nodeNames, String startNode, String endNode, boolean connected, Map<String, List<String>> predecessors) throws COptQuestExceptionCreates a DAG variable over the given nodes, with an optional start node, an optional end node, the connected option and optional precedences.- Parameters:
name- base name of the variablenodeNames- names of the nodes; there must be at least one, and each must be unique and must not contain whitespace, a semicolon, a comma or@startNode- the node that has no incoming edge and comes first, or null or emptyendNode- the node that has no outgoing edge and comes last, or null or emptyconnected- true to make every node reachable from the start node and able to reach the end node; it needs a start node, an end node or bothpredecessors- map from a node to the nodes that must come before it, or null. No directed path runs from a node to one of its predecessors. Names that are not nodes are ignored.- Throws:
COptQuestException- ifnodeNamesis null or empty, holds a name that is not valid, if the start or end node is not one of the nodes, if the start node and the end node are the same node, ifconnectedis true with no start node and no end node, if the start node has a predecessor, if the end node is a predecessor, if a node lists itself as a predecessor, or if the precedences form a cycle
-
-
Method Details
-
getInputVariables
Returns an empty list, because a DAG variable has no ordinary input variables.The values of a DAG variable are in the list that
getProjectedInputVariables()returns. That list has one variable<name>@<nodeFrom>,<nodeTo>for every ordered pair of nodes.- Returns:
- an empty list
-
getOutputVariables
Returns an empty list, because a DAG variable has no output variables.The values of a DAG variable are in the list that
getProjectedInputVariables()returns. That list has one variable<name>@<nodeFrom>,<nodeTo>for every ordered pair of nodes.- 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
-