com.opttek.optquest
Class COptQuestStringObjective

java.lang.Object
  extended bycom.opttek.optquest.COptQuestObjective
      extended bycom.opttek.optquest.COptQuestStringObjective

public class COptQuestStringObjective
extends COptQuestObjective

The COptQuestStringObjective class is used to define an objective function using a mathematical expression. The expression may be linear or non-linear. For example, the objective may be to minimize "2*Var1 + 3*Var2 + 1.5*Var3". "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 following mathematical functions are supported and can be used in the mathematical expression:


Constructor Summary
COptQuestStringObjective()
          Default constructor
COptQuestStringObjective(java.lang.String expression)
           
 
Method Summary
 boolean GetCheckLinear()
          Returns true if the objective equation should be checked for linearity.
 boolean IsLinear()
          Returns true if the expression is linear.
 void SetCheckLinear(boolean Value)
          If true, the objective should be checked for linearity.
 void SetEquation(java.lang.String equation)
          Sets the mathematical expression that defines the objective.
 
Methods inherited from class com.opttek.optquest.COptQuestObjective
GetBestFeasible, GetBestValue, GetCurrentFeasible, GetCurrentFeasible, GetCurrentValue, GetCurrentValue, GetNthBestFeasible, GetNthBestValue, IsMaximize, IsMinimize, SetCurrentValue, SetCurrentValue, SetMaximize, SetMinimize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

COptQuestStringObjective

public COptQuestStringObjective()
Default constructor


COptQuestStringObjective

public COptQuestStringObjective(java.lang.String expression)
Method Detail

IsLinear

public boolean IsLinear()
Returns true if the expression is linear. Returns false if it is not. This method should be called after the optmization has started or after calling COptQuestOptmization::ValidateEquation(). IsLinear() will return false if it is called before one of these methods.

Overrides:
IsLinear in class COptQuestObjective
Returns:
true if the constraints equation is linear. Returns false if it is not linear or it's state has not been checked.

SetEquation

public void SetEquation(java.lang.String equation)
                 throws COptQuestException
Sets the mathematical expression that defines the objective.

Parameters:
equation - - mathematical expression that defines the objective of the optimization
Throws:
COptQuestException

SetCheckLinear

public void SetCheckLinear(boolean Value)
If true, the objective should be checked for linearity. Linear objectives can be solved using the OptQuest linear program. The default value is true.

Parameters:
Value - - true if the mathematical expression should be checked for linearity. False if it should not be checked.

GetCheckLinear

public boolean GetCheckLinear()
Returns true if the objective equation should be checked for linearity. Returns false if the linearity check has been turned off by calling SetCheckLinear(false)

Returns:
boolean indicating the whether linearity checking is turned on or off.