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
ConstructorsConstructorDescriptionDefault 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 TypeMethodDescriptionbooleandoubleGet the DOE lower bounddoubleGet the DOE upper bounddoubleGetExclusiveLowerBoundAt(int index) Returns the lower bound of the exclusive range identified by the indexdoubleGetExclusiveUpperBoundAt(int index) Returns the upper bound of the exclusive range identified by the indexintgetID()Returns the index into the Solution.m_VarValue array that corresponds to this variable.doubleGet the lower boundGetName()Get the nameintReturns the number of exclusive ranges defined for this variable.doubleGet the step sizedoubleGet the suggested valuedoubleGet the upper bounddoubleinthashCode()booleanvoidSetExclusiveRange(double low, double high) Defines a range of values that will be excluded as possible solutions.voidSetLowerBound(double lowerBound) Sets the lower bound of the decision variablevoidAssigns a name to the variable.voidSetUpperBound(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
-