com.opttek.optquest
Class COptQuestObjectiveFunction

java.lang.Object
  extended by com.opttek.optquest.COptQuestObjective
      extended by com.opttek.optquest.COptQuestObjectiveFunction

public class COptQuestObjectiveFunction
extends COptQuestObjective

The COptQuestObjectiveFunction class is used to define a linear objective. Linear objectives are in 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 ChangeVariableCoefficient(COptQuestVariable var, double coefficient)
           
 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, GetName, GetNthBestFeasible, GetNthBestValue, GetReplicationConfidenceLevel, GetReplicationConfidencePercent, GetReplicationConfidenceType, IsMaximize, IsMinimize, SetCurrentValue, SetCurrentValue, SetMaximize, SetMinimize, SetName, SetReplicationConfidence
 
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 -

ChangeVariableCoefficient

public void ChangeVariableCoefficient(COptQuestVariable var,
                                      double 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:
true if the objective is a linear function of the decision variables.

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.