Package com.opttek.optquest
Class COptQuestUserControlledVariable
java.lang.Object
com.opttek.optquest.COptQuestVariable
com.opttek.optquest.COptQuestUserControlledVariable
The COptQuestUserControlledVariable class allows you to define a variable where
you set the value of the variable. Unlike a COptQuestVariable whose possible
value is determined by the OptQuest Engine, you provide the values for
COptQuestUserControlledVariable objects.
COptQuestUserControlledVariable objects can be used in the mathematical expression of COptQuestStringConstraint objects or a COptQuestStringObjective object. For example, you may define a COptQuestUserControlledVariable that represents a risk calculation and use the risk value in a COptQuestStringConstraint that says risk must be less than or equal to n. In the
COptQuestUserControlledVariable objects can be used in the mathematical expression of COptQuestStringConstraint objects or a COptQuestStringObjective object. For example, you may define a COptQuestUserControlledVariable that represents a risk calculation and use the risk value in a COptQuestStringConstraint that says risk must be less than or equal to n. In the
Evaluate(COptQuestSolution)
method, you would compute the risk value and use the
SetVariableValue(COptQuestVariable, double)
method to set the risk value in the solution.
The OptQuestEngine would use this value when checking the
constraint for feasibility.-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorConstructor that assigns a name to the variable. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the statistic defined by the SetReplicationStatistic() method.doubleReturns the statistic value defined by the SetStatistic() method.voidSetExclusiveRange(double low, double high) Not valid for COptQuestUserControlledVariablesvoidSetLowerBound(double lowerBound) Not valid for COptQuestUserControlledVariablesvoidSetReplicationStatistic(int statistic, double statisticValue) Defines the statistic for the replications of a user controlled variable.voidSetUpperBound(double upperBound) Not valid for COptQuestUserControlledVariablesMethods 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
-
COptQuestUserControlledVariable
Constructor that assigns a name to the variable.- Parameters:
name- alphanumeric name. Note: the name can contain blanks or special characters. If the variable name is used in a COptQuestConstraintString equation, and it contains non-alphanumeric characters, the name should be enclosed in square brackets []
-
COptQuestUserControlledVariable
public COptQuestUserControlledVariable()Default constructor
-
-
Method Details
-
SetLowerBound
Not valid for COptQuestUserControlledVariables- Overrides:
SetLowerBoundin classCOptQuestVariable- Parameters:
lowerBound- a value between -pow(2,31) and +pow(2,31)-1- Throws:
COptQuestException- if invalid bounds provided
-
SetUpperBound
Not valid for COptQuestUserControlledVariables- Overrides:
SetUpperBoundin classCOptQuestVariable- Parameters:
upperBound- a value between -pow(2,31) and +pow(2,31)-1- Throws:
COptQuestException- if invalid bounds provided
-
SetExclusiveRange
Not valid for COptQuestUserControlledVariables- Overrides:
SetExclusiveRangein classCOptQuestVariable- Parameters:
low- - any value > low will be excludedhigh- - any value < high will be excluded- Throws:
COptQuestException- if invalid range provided
-
SetReplicationStatistic
Defines the statistic for the replications of a user controlled variable. The OCLP_PERCENTILE statistic requires the statisticValue to be set. The statistic value is ignored for all other statistics.- Parameters:
statistic- - integer defining the statistic to be used- OCLP_MEAN = 1
- OCLP_MEDIAN = 2
- OCLP_PERCENTILE = 3
- OCLP_STDDEV = 4
- OCLP_VARIANCE = 6
- OCLP_COEFFOFVAR = 8
- OCLP_MIN = 14
- OCLP_MAX = 15
- OCLP_SUM = 16
statisticValue- - target value if using OCLP_PERCENTILE- Throws:
COptQuestException- if the statistic or statistic value are invalid.
-
GetReplicationStatistic
public int GetReplicationStatistic()Returns the statistic defined by the SetReplicationStatistic() method.- Returns:
- statistic
- OCLP_MEAN = 1
- OCLP_MEDIAN = 2
- OCLP_PERCENTILE = 3
- OCLP_STDDEV = 4
- OCLP_VARIANCE = 6
- OCLP_COEFFOFVAR = 8
- OCLP_MIN = 14
- OCLP_MAX = 15
- OCLP_SUM = 16
-
GetReplicationStatisticValue
public double GetReplicationStatisticValue()Returns the statistic value defined by the SetStatistic() method. The statistic OCLP_PERCENTILE requires the statisticValue to be set.- Returns:
- the target value for OCLP_PERCENTILE. Returns 0 for all other statistics.
-