Class COptQuestRegionVariable
In every solution that the engine generates, the point is inside the polygon or on its boundary. The polygon can be non-convex. A point is inside by the even-odd rule, so a polygon whose edges cross itself is also accepted.
Variable names: <name>@x and <name>@y, the coordinates of the
point, in the units of the polygon.
Give the vertices in either order, clockwise or counterclockwise. You do not need to repeat the first vertex at the end.
In most programs, you add this variable with
OptQuestModel.AddRegionVariable
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
ConstructorsConstructorDescriptionCOptQuestRegionVariable(String name, double[][] polygon) Creates a region variable. -
Method Summary
Modifier and TypeMethodDescriptionReturns an empty list, because a region variable has no ordinary input variables.Returns an empty list, because a region 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
-
COptQuestRegionVariable
Creates a region variable.- Parameters:
name- base name of the variablepolygon- the vertices, one row {x, y} for each vertex; there must be at least three- Throws:
COptQuestException- ifpolygonis null, has fewer than three vertices or has a vertex with fewer than two coordinates, or if the polygon has no area
-
-
Method Details
-
getInputVariables
Returns an empty list, because a region variable has no ordinary input variables.The values of a region variable are in the list that
getProjectedInputVariables()returns. That list has two variables,<name>@xand<name>@y.- Returns:
- an empty list
-
getOutputVariables
Returns an empty list, because a region variable has no output variables.The values of a region variable are in the list that
getProjectedInputVariables()returns. That list has two variables,<name>@xand<name>@y.- 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
-