Package com.opttek.optquest
Class COptQuestVariable
java.lang.Object
com.opttek.optquest.COptQuestVariable
- Direct Known Subclasses:
COptQuestContinuousVariable
,COptQuestDiscreteVariable
,COptQuestPermutationVariable
,COptQuestUserControlledVariable
COptQuestVariable is a pure virtual class that defines a decision variable.
-
Constructor Summary
ConstructorDescriptionDefault constructorCOptQuestVariable
(double lowerBound, double upperBound) Constructor that sets the lower bound and upper bound.COptQuestVariable
(String name) Constructor that assigns a name to the variable.COptQuestVariable
(String name, double lowerBound, double upperBound) Constructor that assigns a name to the variable and sets the lower bound and upper bound. -
Method Summary
Modifier and TypeMethodDescriptionboolean
double
Get the DOE lower bounddouble
Get the DOE upper bounddouble
GetExclusiveLowerBoundAt
(int index) Returns the lower bound of the exclusive range identified by the indexdouble
GetExclusiveUpperBoundAt
(int index) Returns the upper bound of the exclusive range identified by the indexint
getID()
Returns the index into the Solution.m_VarValue array that corresponds to this variable.double
Get the lower boundGetName()
Get the nameint
Returns the number of exclusive ranges defined for this variable.double
Get the step sizedouble
Get the suggested valuedouble
Get the upper bounddouble
int
hashCode()
boolean
void
SetExclusiveRange
(double low, double high) Defines a range of values that will be excluded as possible solutions.void
SetLowerBound
(double lowerBound) Sets the lower bound of the decision variablevoid
Assigns a name to the variable.void
SetUpperBound
(double upperBound) Sets the upper bound of the decision variable
-
Constructor Details
-
COptQuestVariable
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 COptQuestStringConstraint equation, the name should be enclosed in square brackets [] in the COptQuestStringConstraint string equation.
-
COptQuestVariable
public COptQuestVariable()Default constructor -
COptQuestVariable
Constructor that assigns a name to the variable and sets the lower bound and upper bound.- Parameters:
name
- alphanumeric name. Note: the name can contain blanks or special characters. If the variable name is used in a COptQuestStringConstraint equation, the name should be enclosed in square brackets [] in the COptQuestStringConstraint string equation.lowerBound
- a value between -pow(2,31) and +pow(2,31)-1upperBound
- a value between -pow(2,31) and +pow(2,31)-1
-
COptQuestVariable
public COptQuestVariable(double lowerBound, double upperBound) Constructor that sets the lower bound and upper bound.- Parameters:
lowerBound
- a value between -pow(2,31) and +pow(2,31)-1upperBound
- a value between -pow(2,31) and +pow(2,31)-1
-
-
Method Details
-
GetLowerBound
public double GetLowerBound()Get the lower bound- Returns:
- lower bound
-
SetLowerBound
Sets the lower bound of the decision variable- Parameters:
lowerBound
- a value between -pow(2,31) and +pow(2,31)-1- Throws:
COptQuestException
- if invalid bounds provided
-
GetUpperBound
public double GetUpperBound()Get the upper bound- Returns:
- upper bound
-
SetUpperBound
Sets the upper bound of the decision variable- Parameters:
upperBound
- a value between -pow(2,31) and +pow(2,31)-1- Throws:
COptQuestException
- if invalid bounds provided
-
SetExclusiveRange
Defines a range of values that will be excluded as possible solutions. Any value > low and < high will be excluded. Multiple ranges can be defined on one variable.- Parameters:
low
- - any value > low will be excludedhigh
- - any value < high will be excluded- Throws:
COptQuestException
- if invalid range provided
-
getVarRange
public double getVarRange() -
getID
public int getID()Returns the index into the Solution.m_VarValue array that corresponds to this variable.- Returns:
- the index
-
SetName
Assigns a name to the variable. Names must be alphanumeric and cannot be a function name recognized by the COptQuestEquationSolver.- Parameters:
name
- = name of the variable.
-
GetDOEUpperBound
public double GetDOEUpperBound()Get the DOE upper bound- Returns:
- upper bound
-
GetDOELowerBound
public double GetDOELowerBound()Get the DOE lower bound- Returns:
- lower bound
-
GetSuggestedValue
public double GetSuggestedValue()Get the suggested value- Returns:
- suggested value
-
GetName
Get the name- Returns:
- name
-
GetStepSize
public double GetStepSize()Get the step size- Returns:
- step size
-
GetNumberOfExclusiveRanges
public int GetNumberOfExclusiveRanges()Returns the number of exclusive ranges defined for this variable. Each call to COptQuestVariable.SetExclusiveRange() defines one range.- Returns:
- - the number of exclusive ranges defined for this variable.
-
GetExclusiveLowerBoundAt
public double GetExclusiveLowerBoundAt(int index) Returns the lower bound of the exclusive range identified by the index- Parameters:
index
- 0 based index- Returns:
- lower bound of the exclusive range identified by the index
-
GetExclusiveUpperBoundAt
public double GetExclusiveUpperBoundAt(int index) Returns the upper bound of the exclusive range identified by the index- Parameters:
index
- 0 based index- Returns:
- upper bound of the exclusive range identified by the index
-
isZeroOne
public boolean isZeroOne() -
hashCode
public int hashCode() -
equals
-