|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.opttek.optquest.COptQuestStringConstraint
The COptQuestStringConstraint class is used to define linear and non-linear
constraints using a mathematical expression. For example,
"2*Var1 + 3*Var2 + 1.5*Var3 <= 100" could be used to define a budget constraint.
"Var1", "Var2" and "Var3" must be names that were assigned to COptQuestVariable
objects. If a variable name contains non-alphanumeric characters such as blanks,
the names should be enclosed in square brackets in the equation string.
For example, "2*[Var 1] + 3*[Var 2] + 1.5*[Var 3] <= 100"
The constraint expression can define an efficient frontier by specifying a
comma separated list of right hand side values. For example,
"2*Var1 + 3*Var2 + 1.5*Var3 <= 100,200,300"
The following mathematical functions are supported and can be used in the
mathematical expression:
| Constructor Summary | |
COptQuestStringConstraint()
Default constructor |
|
COptQuestStringConstraint(java.lang.String equation)
Constructor that accepts the string expression that defines the constraint. |
|
COptQuestStringConstraint(java.lang.String name,
java.lang.String equation)
Constructor that assigns a name to the constraint and the string expression that defines the constraint. |
|
| Method Summary | |
boolean |
GetCheckLinear()
Returns true if the constraint equation should be checked for linearity. |
java.lang.String |
GetEquation()
Returns the mathematical expression of the constraint. |
java.lang.String |
GetLHSString(int clause)
Returns the left hand side string expression associated with the clause indicated by the input parameter. |
java.lang.String |
GetName()
Returns the constraint name. |
int |
GetNumberOfClauses()
Returns the number of clauses in the string equation. |
java.lang.String |
GetOperatorString(int clause)
Returns the operator as a string expression for the clause indicated by the input parameter. |
java.lang.String |
GetRHSString(int clause)
Returns the right hand side string expression associated with the clause indicated by the input parameter. |
boolean |
IsAndClauses()
|
boolean |
IsLinear()
Returns true if the expression is linear. |
boolean |
IsOrClauses()
|
boolean |
IsVariable()
Returns true if the constraint equation defines variable bounds. |
void |
SetCheckLinear(boolean checkLinear)
If true, the constraint should be checked for linearity. |
void |
SetEquation(java.lang.String equation)
Sets the mathematical expression that defines the constraint. |
void |
SetName(java.lang.String name)
Assigns an alphanumeric name to the constraint. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public COptQuestStringConstraint(java.lang.String name,
java.lang.String equation)
name - - alphanumeric nameequation - - linear or non-linear expression defining the constraintpublic COptQuestStringConstraint(java.lang.String equation)
equation - - linear or non-linear expression defining the constraintpublic COptQuestStringConstraint()
| Method Detail |
public void SetName(java.lang.String name)
name - - alphanumeric string namepublic java.lang.String GetName()
public void SetEquation(java.lang.String equation)
equation - - mathematical expressionpublic java.lang.String GetEquation()
public void SetCheckLinear(boolean checkLinear)
checkLinear - - true if the mathematical expression should be checked for
linearity. False if it should not be checked.public boolean GetCheckLinear()
public boolean IsLinear()
public boolean IsVariable()
public int GetNumberOfClauses()
public boolean IsAndClauses()
public boolean IsOrClauses()
public java.lang.String GetRHSString(int clause)
throws COptQuestException
clause - 1 based index of the clause.
COptQuestException
public java.lang.String GetLHSString(int clause)
throws COptQuestException
clause - 1 based index of the clause.
COptQuestException
public java.lang.String GetOperatorString(int clause)
throws COptQuestException
clause - 1 based index of the clause.
COptQuestException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||