com.opttek.optquest
Class COptQuestObjectiveFunction

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

public class COptQuestObjectiveFunction
extends COptQuestObjective

The COptQuestObjectiveFunction class is used to define a linear objective of the form coeff1 * var1 + coeff2 * var2 + ... + coeffn * varN.


Constructor Summary
COptQuestObjectiveFunction()
          Default constructor
COptQuestObjectiveFunction(java.lang.String name)
          Constructor that assigns a name to the objective
 
Method Summary
 void AddVariable(COptQuestVariable variable, double coefficient)
          Adds a variable and its coefficient to the linear objective which has the form coeff1 * var1 + coeff2 + var2 + coeffn * varN.
 void EvaluateObjectiveValue(int pID, com.opttek.optquest.Solution sol)
           
 double GetCoefficientAt(int index)
          Returns the coefficient at the specified index.
 long GetNumberOfVariables()
          Returns the number of variable/coefficient pairs that were added to the linear objective.
 int GetNumCoefficients()
          Returns the number of variable/coefficient pairs that were added to the linear objective.
 COptQuestVariable GetVariableAt(int index)
          Returns the variable at the specified index.
 boolean IsLinear()
          Returns true.
 
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

COptQuestObjectiveFunction

public COptQuestObjectiveFunction(java.lang.String name)
Constructor that assigns a name to the objective

Parameters:
name - alphanumeric name

COptQuestObjectiveFunction

public COptQuestObjectiveFunction()
Default constructor

Method Detail

AddVariable

public void AddVariable(COptQuestVariable variable,
                        double coefficient)
Adds a variable and its coefficient to the linear objective which has the form coeff1 * var1 + coeff2 + var2 + coeffn * varN. This method is called once for each variable.

Parameters:
variable -
coefficient -

GetNumberOfVariables

public long GetNumberOfVariables()
Returns the number of variable/coefficient pairs that were added to the linear objective.

Returns:
number of variables added to the linear objective

GetVariableAt

public COptQuestVariable GetVariableAt(int index)
Returns the variable at the specified index.

Parameters:
index - value between 0 and the number of variables added to the linear objective
Returns:
the decision variable at the specified index

GetCoefficientAt

public double GetCoefficientAt(int index)
Returns the coefficient at the specified index.

Parameters:
index - value between 0 and the number of variables added to the linear objective
Returns:
the coefficient at the specified index

IsLinear

public boolean IsLinear()
Returns true. COptQuestObjectiveFunction objects define a linear objective.

Overrides:
IsLinear in class COptQuestObjective
Returns:

GetNumCoefficients

public int GetNumCoefficients()
Returns the number of variable/coefficient pairs that were added to the linear objective.

Returns:
- the number of coefficients added to the linear objective.

EvaluateObjectiveValue

public void EvaluateObjectiveValue(int pID,
                                   com.opttek.optquest.Solution sol)
                            throws COptQuestException
Throws:
COptQuestException