com.opttek.optquest
Class COptQuestOptimization

java.lang.Object
  extended bycom.opttek.optquest.COptQuestOptimization

public class COptQuestOptimization
extends java.lang.Object

The COptQuestOptimization class searches for solutions to problems using a “black box” approach. It incorporates metaheuristics to guide its search algorithms toward better solutions. This approach remembers which solutions worked well and recombines them into new, better solutions. The simplest optimization problem contains decision variables, an objective function and the goal of the optimization (to either minimize or maximize the value of the objective function.) More complex optimization problems may contain constraints.


Field Summary
static int DEMOLICENSE
           
static int OCLP_COEFFOFSEMI1VAR
           
static int OCLP_COEFFOFSEMI2VAR
           
static int OCLP_COEFFOFVAR
           
static int OCLP_IRR
           
static int OCLP_MEAN
           
static int OCLP_MEDIAN
           
static int OCLP_NONE
           
static int OCLP_NPV
           
static int OCLP_PBP
           
static int OCLP_PERCENTILE
           
static int OCLP_PROBABILITY
           
static int OCLP_SEMI1STDDEV
           
static int OCLP_SEMI1VARIANCE
           
static int OCLP_SEMI2STDDEV
           
static int OCLP_SEMI2VARIANCE
           
static int OCLP_STDDEV
           
static int OCLP_VARIANCE
           
static int REPLTERM_MAXREPLICATIONS
           
static int REPLTERM_METCONFIDENCE
           
static int REPLTERM_NEEDMORE
           
static int REPLTERM_NOTNEARBEST
           
static int REPLTERM_REMOVEBYRAS
           
static int REPLTERM_STILLINRAS
           
static int TERM_AUTOSTOP
           
static int TERM_BESTFOUND
           
static int TERM_CALLBACK
           
static int TERM_EXCEPTION
           
static int TERM_LP
           
static int TERM_MAXITERATIONS
           
static int TERM_MAXTIME
           
static int TERM_NOTSTARTED
           
static int TERM_OPTIMALFOUND
           
static int TERM_RUNNING
           
static int TERM_USERSTOPPED
           
 
Constructor Summary
COptQuestOptimization()
          The default constructor.
COptQuestOptimization(COptQuestSearchParameters search)
           
COptQuestOptimization(int license)
          Constructor that accepts the license ID as input.
 
Method Summary
 void AddAdditionalReplicationsSolution(int iteration)
          Adds the solution identified by the iteration number to the set of solutions that will have additional replications run.
 void AddConstraint(COptQuestCompoundConstraint constraint)
          Adds the "Or" constraint defined by the input parameter to the optimization.
 void AddConstraint(COptQuestConstraint constraint)
          Adds the constraint defined by the input parameter to the optimization.
 void AddConstraint(COptQuestStringConstraint constraint)
          Adds the string constraint defined by the input parameter to the optimization.
 void AddDiscountRate(COptQuestVariable discountRate)
          Adds the discount rate variable to the optimization.
 void AddObjective(COptQuestObjective objective)
          Add the objective defined by the input parameter to the optimization problem.
 void AddObjectiveFunction(COptQuestObjectiveFunction objectiveFunction)
          Adds the linear objective function defined by the input parameter to the optimization.
 void AddPermutationGroup(COptQuestPermutationGroup group)
           
 void AddRankAndSelectionSolution(int iteration)
          Add the solution identified by the iteration number to the set of solutions that will be included in the rank and select process.
 void AddRequirement(COptQuestOrRequirement requirement)
          Adds the "Or" requirement defined by the input parameter to the optimization.
 void AddRequirement(COptQuestRequirement requirement)
          Adds the requirement defined by the input parameter to the optimization.
 void AddSelectionGroup(com.opttek.optquest.COptQuestSelectionGroup group)
          To be documented.
 void AddSuggestedSolution()
          This method signals the completion of a suggested solution definition.
 void AddVariable(COptQuestVariable variable)
          Adds the variable defined by the input parameter to the optimization.
 void ChangeVariableConstraint()
          Directs the OptQuest Engine to advance to the next bound in constraint strings that have variable bounds defined.
 void ConstraintEquation(java.lang.String equation)
          Deprecated. Replaced by AddConstraint(COptQuestStringConstraint) A COptQuestStringConstraint object is created from the input string and added to the optimization
 void ConstraintEquation(java.lang.String equation, boolean checkLinear)
          Deprecated. Replaced by AddConstraint(COptQuestStringConstraint) This method creates an instance of COptQuestStringConstraint and use the AddConstraint(COptQuestStringConstraint constraint) method to add the constraint to the optimization.
 void EfficientFrontier()
          Virtual method provided by the user when an optimization problem contains a COptQuestStringConstraint with variable bounds.
 void Evaluate()
          Virtual method provided by the user to evaluate a solution.
 void Evaluate(int pID)
          Virtual method provided by the user to evaluate a solution for parallel optimization.
 boolean EvaluateBestConstraint(COptQuestStringConstraint constraint)
          Returns true if the input COptQuestStringConstraint contains a valid expression and if the best solution satisfies the constraint expression.
 void EvaluateComplete(int pID)
          This method is called to indicate the evaluation of a parallel optimization is complete.
 boolean EvaluateCurrentConstraint(COptQuestStringConstraint constraint)
          Returns true if the input COptQuestStringConstraint contains a valid expression and if the current solution satisfies the constraint expression.
 boolean EvaluateNthBestConstraint(COptQuestStringConstraint constraint)
          Returns true if the input COptQuestStringConstraint contains a valid expression and if the nth best solution satisfies the constraint expression.
 boolean EvaluateSuggestedConstraint(COptQuestStringConstraint constraint)
          Returns true if the input COptQuestStringConstraint contains a valid expression and if the suggested solution satisfies the constraint expression.
 void finalize()
           
 boolean GetAggressiveSearch()
          Deprecated.  
 boolean GetAutoStop()
          Returns the value for automatic stopping.
 int GetBestIteration()
          Returns the iteration that resulted in the best solution thus far.
 double GetBestObjectiveValue()
          Returns the objective value for the best solution found thus far.
 int GetBestReplications()
          Returns the number of replications that were run for the best solution;
 double GetBestReplicationStandardDeviation()
          Returns the standard of deviation for the replications of the best solution.
 int GetBestReplicationTerminationReason()
          Returns the reason replications were terminated for the best solution.
 java.lang.String GetBestReplicationTerminationReasonString()
          Returns a text string which describes the reason replications were terminated for the best solution.
 double GetBestStatistic(int measure, int statistic, double statisticValue)
          Using the best solution, calculate the requested statistic on the specified measure
 boolean GetCheckDup()
          Returns the value for duplicate solution checking.
 boolean GetCrossOverSearch()
          Deprecated.  
 double GetCurrentObjectiveValue()
          Used to retrieve the value of the objective function for the current solution.
 double GetCurrentObjectiveValue(int pID)
          Used to retrieve the value of the objective function for the current solution when doing parallel optimization.
 double GetCurrentReplicationStandardDeviation()
          Returns the standard of deviation for the replications of the current solution.
 int GetCurrentReplicationTerminationReason()
          Returns the reason replications were terminated for the current solution.
 java.lang.String GetCurrentReplicationTerminationReasonString()
          Returns a text string which describes the reason replications were terminated for the current solution.
 double GetCurrentStatistic(int measure, int statistic, double statisticValue)
          Using the current solution, calculate the requested statistic on the specified measure
 int GetDataBaseSize()
          Returns the size of the internal database of solutions.
 int GetEvaluateException()
          Returns the value for COptQuestException.EXCEPT_EVALUATE.
 boolean GetGradientAnalysis()
           
 int GetIteration()
          Returns the current iteration counter
 int GetIteration(int pID)
          Returns the iteration for the solution associated with the parallel ID speceified by pID.
 boolean GetLever()
          Deprecated.  
 int GetMaximumIterations()
          Returns the number of iterations set by SetMaximumIteraions()
 int GetMaximumReplications()
          Returns the maximum number of replications set by the call to SetMaximumReplications().
 int GetMaximumTime()
          Returns the number of seconds set by the method SetMaximumTime()
 int GetMinimumReplications()
          Returns the minimum number of replications set by the call to SetMinimumReplications().
 int GetNthBestIteration()
          Returns the iteration number for the Nth best solution, where the Nth best solution is identified by the method SetNthBest(n);
 double GetNthBestObjectiveValue()
          Returns the objective value for the Nth best solution, identified by the method COptQuestOptimization::SetNthBest(n);
 int GetNthBestReplications()
          Returns the number of replications for the Nth best solution, where the Nth best solution is identified by the method SetNthBest(n);
 double GetNthBestReplicationStandardDeviation()
          Returns the standard of deviation for the replications of the Nth best solution, which is identified by the method SetNthBest(n);
 int GetNthBestReplicationTerminationReason()
          Returns the reason replications were terminated for the Nth best solution where the Nth best solution is identified by the SetNthBest() method.
 java.lang.String GetNthBestReplicationTerminationReasonString()
          Returns a text string which describes the reason replications were terminated for the Nth best solution, where the Nth best solution is identified by the method SetNthBest(n);
 double GetNthBestStatistic(int measure, int statistic, double statisticValue)
          Using the Nth best solution, calculate the requested statistic on the specified measure.
 int GetNumberofCompletedIterations()
          Returns the number of solutions that have been evaluated.
 int GetNumberOfSeconds()
          Returns the number of seconds set by the method SetMaximumTime()
 double GetObjPrecision()
          Returns the objective precision.
 int GetPortfolioMeasure()
          Deprecated. Replaced by COptQuestPortfolioObjective.GetPortfolioMeasure() Returns the portfolio measure set by COptQuestOptimization::GetPortfolioMeasure().
 int GetPortfolioStatistic()
          Deprecated. Replaced COptQuestPortfolioObjective.GetPortfolioStatistic() Returns the portfolio statistic set by the COptQuestOptimization::SetPortfolioStatistic() method.
 double GetPortfolioStatisticValue()
          Deprecated. Replace with COptQuestPortfolioObjective.GetPortfolioStatisticValue(). Returns the target value for statistics OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY
 boolean GetRegressionAnalysis()
           
 boolean GetRejectNonLinear()
          Returns the value for checking solutions for feasibility against non-linear constraints.
 int GetReplication()
          Returns the replication number for the current solution being evaluated.
 int GetReplication(int pID)
          Returns the number of replications run thus far for the solution associated with the parallel ID speceified by pID.
 int GetReplicationConfidenceLevel()
          Returns the confidence level set by the call to SetReplicationConfidence().
 double GetReplicationConfidencePercent()
          Return the confidence error percent set by the call to SetReplicationConfidence()
 int GetReplicationConfidenceType()
          Returns the confidence type set by the call to SetReplicationConfidence();
 double GetSolutionObjectiveValue(int iteration)
          Returns the objective value for the solution identified by the iteration.
 int GetSolutionReplicationTerminationReason(int iteration)
          Returns the reason replications were terminated for the solution at the iteration identified by the input parameter 1 = REPLTERM_MAXREPLICATIONS = maximum replications were run 2 = REPLTERM_METCONFIDENCE = the confidence interval was met 3 = REPLTERM_NOTNEARBEST = the objective value was not near the best objective 4 = REPLTERM_REMOVEBYRAS = removed by rank and selection
 java.lang.String GetSolutionReplicationTerminationReasonString(int iteration)
          Returns a text string which describes the reason replications were terminated for the solution identified by the input parameter.
 double GetSolutionStatistic(int iteration, int measure, int statistic, double statisticValue)
          Using the solution at the specified iteration, calculate the requested statistic on the specified measure
 int GetTaguchi()
          Deprecated.  
 int GetTerminationReason()
          Returns the reason the optimization terminated.
 java.lang.String GetTerminationReasonString()
          Returns the reason the optimization terminated as a string.
 boolean GetUserControlledStop()
          Returns true if the user will stop the optimization using the COptQuestOptimization::StopOptimization() method.
 boolean GetUserControlledVariableConstraint()
           
 boolean GetUseReplications()
           
 double GetVarPrecision()
          Returns the variable precision.
static java.lang.String GetVersion()
          Returns the version number of the OptQuest Engine.
 boolean IsAdditionalReplicationsMode()
           
 boolean IsBestFeasible()
          Returns true if the best solution satisifies all constraints and requirements.
 boolean IsCurrentFeasible()
          Returns true if the current solution satisifies all constraints and requirements.
 boolean IsLastReplication()
          Return true if we have run the last replication for the current solution.
 boolean IsLinearEquation(java.lang.String equation)
          Returns true if the input expression is a linear constraint expression.
 boolean IsLinearObjectiveEquation(java.lang.String equation)
          Returns true if the input objective expression is a linear expression.
 boolean IsMaximize()
          Deprecated. Replaced with COptQuestObjective.IsMaximize(). Returns true if the goal of the optmization is to maximize.
 boolean IsMinimize()
          Deprecated. Replaced with COptQuestObjective.IsMinimize(). Returns true if the goal of the optmization is to minimize.
 boolean IsNthBestFeasible()
          Returns true if the nth best solution satisifies all constraints and requirements.
static boolean IsPureJava()
           
 boolean IsRankAndSelectionMode()
           
 boolean IsSolutionMetConfidence(int iteration)
          If the solution specifed by the input parameter met confidence level checks, return true.
 void LogSetup(java.lang.String logFilePath)
          LogSetup() logs calls to the COptQuestOptimization class in an xml formatted file.
 void LogSolutions(java.lang.String logFilePath)
          LogSolutions() logs all solutions in a csv formatted file.
 void MonitorStatus()
          Allows you to monitor the progress of an optimization.
 void ObjectiveEquation(java.lang.String equation)
          Deprecated. Define a COptQuestStringObjective and add it using COptQuestOptimization::AddObjective().
 void ObjectiveEquation(java.lang.String equation, boolean checkLinear)
          Deprecated. Define a COptQuestStringObjective and add it using COptQuestOptimization::AddObjective().
 void Optimize()
          Method that optimizes the problem.
 void OptimizeAdditional()
          This method allows the user to continue an optimization after it has stopped.
 void RankAndSelect()
          The RankAndSelect() method continues the Optimize() method that has just completed by using the Rank and Selection Algorithm.
 void RejectSolution()
          Called by the user to reject the current solution.
 void SaveSolutions(java.lang.String filename)
          Stores the current state of the optimization in an XML file.
 void SearchRestart()
          The search for solutions is restarted.
 void SetAdditionalIterations(int MoreIterations)
          Sets the number of additional iterations to be run after an optimization has stopped.
 void SetAdditionalReplications(int MoreReplications)
          Sets the number of additional replications to be run on the top n solutions.
 void SetAdditionalReplicationsSolutions(int Value)
          Identifies the top n solutions that will have additional replications run.
 void SetAggressiveSearch(boolean Value)
          Deprecated.  
 void SetAutoStop(boolean stop)
          Sets the auto stop option.
 void SetAutoStopFrequency(int freq)
          Sets the auto stop frequency.
 void SetCheckDup(boolean checkDup)
          Controls duplicate solution checking.
 void SetCrossOverSearch(boolean Value)
          Deprecated.  
 void SetCurrentObjectiveValue(double objective)
          Deprecated. Replaced by COptQuestObjective::SetCurrentValue() method. Sets the objective value for the current solution.
 void SetCurrentObjectiveValue(int pID, double objective)
          Deprecated. Replaced by COptQuestObjective::SetCurrentValue() Sets the objective value for the current solution in a parallel optimization.
 void SetDataBaseSize(int size)
          Sets the number of solutions to be kept in the internal database of solutions.
 void SetEvaluate(int NumberOfParallelEvaluate)
          The input parameter identifies the number of parallel evaluations that will be performed by the user.
 void SetGradientAnalysis(boolean Value)
           
 void SetLever(boolean Value)
          Deprecated.  
 void SetLicenseID(int license)
          Used to set the license ID.
 void SetMaximize()
          Deprecated. Replaced with COptQuestObjective.SetMaximize(). Sets the goal of the optimization to maximize the objective value.
 void SetMaximumIterations(int NumberOfIterations)
          Sets the number of iterations the optimization should perform before stopping.
 void SetMaximumReplications(int maximum)
          Sets the maximum number of replications to be run when running general replication.
 void SetMaximumTime(int NumberOfSeconds)
          Sets the number of seconds the optimization should run before stopping.
 void SetMinimize()
          Deprecated. Replaced with COptQuestObjective.SetMinimize(). Sets the goal of the optimization to minimize the objective value.
 void SetMinimumReplications(int minimum)
          Sets the minimum number of replications to be run when running general replication.
 void SetNeuralNetAnalysis(boolean Value)
           
 void SetNodeMax(int maximum)
           
 void SetNodeMin(int minimum)
           
 void SetNodeMultiplier(double multiplier)
           
 void SetNthBest(int n)
          Called by the user to identify the Nth best soluiton.
 void SetObjPrecision(double precision)
          The objective precision value is used to compare the objective value of solutions and determine if one solution is superior to another.
 void SetPortfolioMeasure(int measure)
          Deprecated. Replaced by COptQuestPortfolioObjective.SetPortfolioMeasure() Defines the measure for the portfolio objective.
 void SetPortfolioStatistic(int statistic, double statisticValue)
          Deprecated. Replaced by COptQuestPortfolioObjective.SetPortfolioStatistic() Defines the statistic for the portfolio objective. If the statistic is OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY require the statisticValue to be set. This value is ignored for all other statistics.
 void SetRandomSeed(int seed)
          Allows the random seed to be modified.
 void SetRankAndSelectionCorrectProbability(double prob)
          Sets the probability used by the rank and select algorithm.
 void SetRankAndSelectionIndifferenceZone(double zone)
          Sets the indifference zone use by the rank and select algorithm.
 void SetRankAndSelectionSolutions(int Value)
          Identifies the top n solutions that will be evaluated in the rank and select algorithm.
 void SetRegressionAnalysis(boolean Value)
           
 void SetRejectNonLinear(boolean Value)
          Directs the OptQuest Engine to reject solutions that violate non-linear constraints without calling the Evaluate() method.
 void SetReplicationConfidence(int type, int level, double errPercent)
          Sets the values used for replication confidence testing.
 void SetRetrainingInterval(int interval)
           
 void SetStartingIteration(int iteration)
           
 void SetTaguchi(int Value)
          Deprecated.  
 void SetUseNeuralNetworkFilter(boolean useNN)
          Turns the neural network on or off.
 void SetUseNeuralNetworkGenerator(boolean useNN)
           
 void SetUsePortfolioAlgorithms(boolean Value)
          If the input parameter is true, the OptQuest Engine will use portfolio algorithms to find a good starting solution for portfolio optimizations.
 void SetUserControlledStop(boolean stop)
          Indicates the user will stop the optimization by calling the COptQuestOptimization::StopOptimization() method.
 void SetUserControlledVariableConstraint(boolean Value)
          This method is used when the optimization contains a constraint with variable bounds.
 void SetUseReplications(boolean Value)
           
 void SetVarPrecision(double precision)
          The variable precision value is used to compare the values for decision variables and determine duplicate solutions.
 double SolveBestEquation(java.lang.String str)
          Solves the expression in the input parameter using the best solution and returns the value of the expression.
 double SolveBestLHS(COptQuestStringConstraint constraint, int clause)
          Returns the value of the left hand side of the COptQuestStringConstraint, using the best solution.
 double SolveBestRHS(COptQuestStringConstraint constraint, int clause)
          Returns the value of the right hand side of the COptQuestStringConstraint, using the best solution.
 double SolveCurrentEquation(java.lang.String str)
          Solves the expression in the input parameter using the current solution and returns the value of the expression.
 double SolveCurrentLHS(COptQuestStringConstraint constraint, int clause)
          Returns the value of the left hand side of the COptQuestStringConstraint, using the current solution.
 double SolveCurrentRHS(COptQuestStringConstraint constraint, int clause)
          Returns the value of the right hand side of the COptQuestStringConstraint, using the current solution.
 double SolveNthBestEquation(java.lang.String str)
          Solves the expression in the input parameter using the nth best solution and returns the value of the expression.
 double SolveNthBestLHS(COptQuestStringConstraint constraint, int clause)
          Returns the value of the left hand side of the COptQuestStringConstraint, using the Nth best solution.
 double SolveNthBestRHS(COptQuestStringConstraint constraint, int clause)
          Returns the value of the right hand side of the COptQuestStringConstraint, using the Nth best solution.
 double SolveSuggestedEquation(java.lang.String str)
          Solves the expression in the input parameter using a suggested solution and returns the value of the expression.
 double SolveSuggestedLHS(COptQuestStringConstraint constraint, int clause)
          Returns the value of the left hand side of the COptQuestStringConstraint, using the suggested solution.
 double SolveSuggestedRHS(COptQuestStringConstraint constraint, int clause)
          Returns the value of the right hand side of the COptQuestStringConstraint, using the suggested solution.
 void StopOptimization()
          Stops the currently running optimization.
 void UseSolutions(java.lang.String filename)
          Retrieves previously stored solutions that were written to file by the the SaveSolutions() procedure.
 void ValidateEquation(COptQuestStringConstraint constraint)
          Validates the string expression of the input constraint and throws an exception if there are errors.
 void ValidateEquation(java.lang.String equation)
          Validates the input string expression and throws an exception if there are errors.
 void ValidateObjectiveEquation(COptQuestStringObjective objective)
          Validates the string expression of the input objective and throws an exception if there are errors.
 void ValidateObjectiveEquation(java.lang.String equation)
          Validates the objective string expression and throws and exception if there is an error in the string expression.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TERM_NOTSTARTED

public static final int TERM_NOTSTARTED
See Also:
Constant Field Values

TERM_RUNNING

public static final int TERM_RUNNING
See Also:
Constant Field Values

TERM_CALLBACK

public static final int TERM_CALLBACK
See Also:
Constant Field Values

TERM_LP

public static final int TERM_LP
See Also:
Constant Field Values

TERM_AUTOSTOP

public static final int TERM_AUTOSTOP
See Also:
Constant Field Values

TERM_OPTIMALFOUND

public static final int TERM_OPTIMALFOUND
See Also:
Constant Field Values

TERM_MAXITERATIONS

public static final int TERM_MAXITERATIONS
See Also:
Constant Field Values

TERM_MAXTIME

public static final int TERM_MAXTIME
See Also:
Constant Field Values

TERM_USERSTOPPED

public static final int TERM_USERSTOPPED
See Also:
Constant Field Values

TERM_BESTFOUND

public static final int TERM_BESTFOUND
See Also:
Constant Field Values

TERM_EXCEPTION

public static final int TERM_EXCEPTION
See Also:
Constant Field Values

REPLTERM_NEEDMORE

public static final int REPLTERM_NEEDMORE
See Also:
Constant Field Values

REPLTERM_MAXREPLICATIONS

public static final int REPLTERM_MAXREPLICATIONS
See Also:
Constant Field Values

REPLTERM_METCONFIDENCE

public static final int REPLTERM_METCONFIDENCE
See Also:
Constant Field Values

REPLTERM_NOTNEARBEST

public static final int REPLTERM_NOTNEARBEST
See Also:
Constant Field Values

REPLTERM_REMOVEBYRAS

public static final int REPLTERM_REMOVEBYRAS
See Also:
Constant Field Values

REPLTERM_STILLINRAS

public static final int REPLTERM_STILLINRAS
See Also:
Constant Field Values

DEMOLICENSE

public static final int DEMOLICENSE
See Also:
Constant Field Values

OCLP_NONE

public static final int OCLP_NONE
See Also:
Constant Field Values

OCLP_MEAN

public static final int OCLP_MEAN
See Also:
Constant Field Values

OCLP_MEDIAN

public static final int OCLP_MEDIAN
See Also:
Constant Field Values

OCLP_PERCENTILE

public static final int OCLP_PERCENTILE
See Also:
Constant Field Values

OCLP_STDDEV

public static final int OCLP_STDDEV
See Also:
Constant Field Values

OCLP_SEMI1STDDEV

public static final int OCLP_SEMI1STDDEV
See Also:
Constant Field Values

OCLP_VARIANCE

public static final int OCLP_VARIANCE
See Also:
Constant Field Values

OCLP_SEMI1VARIANCE

public static final int OCLP_SEMI1VARIANCE
See Also:
Constant Field Values

OCLP_COEFFOFVAR

public static final int OCLP_COEFFOFVAR
See Also:
Constant Field Values

OCLP_COEFFOFSEMI1VAR

public static final int OCLP_COEFFOFSEMI1VAR
See Also:
Constant Field Values

OCLP_PROBABILITY

public static final int OCLP_PROBABILITY
See Also:
Constant Field Values

OCLP_SEMI2STDDEV

public static final int OCLP_SEMI2STDDEV
See Also:
Constant Field Values

OCLP_SEMI2VARIANCE

public static final int OCLP_SEMI2VARIANCE
See Also:
Constant Field Values

OCLP_COEFFOFSEMI2VAR

public static final int OCLP_COEFFOFSEMI2VAR
See Also:
Constant Field Values

OCLP_NPV

public static final int OCLP_NPV
See Also:
Constant Field Values

OCLP_IRR

public static final int OCLP_IRR
See Also:
Constant Field Values

OCLP_PBP

public static final int OCLP_PBP
See Also:
Constant Field Values
Constructor Detail

COptQuestOptimization

public COptQuestOptimization()
The default constructor. The license ID must be set by the SetLicenseID() method.


COptQuestOptimization

public COptQuestOptimization(int license)
Constructor that accepts the license ID as input.

Parameters:
license - - the license ID assigned by OptTek Systems, Inc.

COptQuestOptimization

public COptQuestOptimization(COptQuestSearchParameters search)
Method Detail

finalize

public void finalize()

GetVersion

public static java.lang.String GetVersion()
Returns the version number of the OptQuest Engine.

Returns:
the version number as a string.

SetUseNeuralNetworkFilter

public void SetUseNeuralNetworkFilter(boolean useNN)
Turns the neural network on or off. The neural network is used to generate new solutions.

Parameters:
useNN - - true if the neural network should be turned on. False if it should be turned off.

SetUseNeuralNetworkGenerator

public void SetUseNeuralNetworkGenerator(boolean useNN)

GetNumberofCompletedIterations

public int GetNumberofCompletedIterations()
Returns the number of solutions that have been evaluated. This method is most useful for parallel optimizations where the current iteration counter isn't meaningful because there's more than one solution being evaluated.

Returns:
the number of iterations that have completed

Evaluate

public void Evaluate()
Virtual method provided by the user to evaluate a solution. The Evaluate() method is called at each optimization iteration to calculate the value of the objective function, requirements and user controlled variables (COptQuestUserControlledVariable.) To get the current solution, call COptQuestVariable::GetCurrentValue() for each variable added to the optimization. Call COptQuestObjective::SetCurrentValue() to set the calculated value of the objective function. Call COptQuestUserControlledVariable::SetCurrentValue() to set the value for each user controlled variable added to the optimization. Call COptQuestRequirement::SetCurrentValue() to set the calculated value for each COptQuestRequirement added to the optimization. Note: Use the MonitorStatus() method to plot the progress of the best solution. The best solution is updated after the Evaluate() method has completed.


EfficientFrontier

public void EfficientFrontier()
Virtual method provided by the user when an optimization problem contains a COptQuestStringConstraint with variable bounds. (2*Var1 + 3*Var2 + 1.5*Var3 <= 100,200,300) This method is called when the evaluations for a bound are complete. In the above example, EfficientFrontier() would be called 3 times. This method allows the user to retrieve the best solution for the bound and plot an Efficient Frontier graph.


Evaluate

public void Evaluate(int pID)
              throws COptQuestException
Virtual method provided by the user to evaluate a solution for parallel optimization. The parameter pID indicates which parallel process to evaluate. The pID is used to retrieve the values for the decision variables and to set the values for the objective and requirements.

Parameters:
pID - - ID of the evaluation that has completed. The pID is a number between 1 and the value given to the COptQuestOptimization::SetEvaluate() method.
Throws:
COptQuestException

MonitorStatus

public void MonitorStatus()
Allows you to monitor the progress of an optimization. The MonitorStatus() method is called at the end of each optimization iteration. It is called after the Evaluate() method has completed evaluation of the solution. When MonitorStatus() is called, the solution has been checked for feasibility and the best solution has been identified.


EvaluateComplete

public void EvaluateComplete(int pID)
                      throws COptQuestException
This method is called to indicate the evaluation of a parallel optimization is complete. The input parameter is the ID from the COptQuestOptimization::Evaluate(int pID)method.

Parameters:
pID - - ID of the evaluation that has completed. The pID is a number between 1 and the value given to the SetEvaluate() method. It was the input parameter of the Evalaute() method.
Throws:
COptQuestException

GetCurrentObjectiveValue

public double GetCurrentObjectiveValue()
                                throws COptQuestException
Used to retrieve the value of the objective function for the current solution.

Returns:
the current value of the objective function.
Throws:
COptQuestException

GetCurrentObjectiveValue

public double GetCurrentObjectiveValue(int pID)
                                throws COptQuestException
Used to retrieve the value of the objective function for the current solution when doing parallel optimization. The parameter pID is the parallel ID.

Parameters:
pID - - parallel ID.
Returns:
the value of the objective function associated with the parallel ID.
Throws:
COptQuestException

SetCurrentObjectiveValue

public void SetCurrentObjectiveValue(double objective)
                              throws COptQuestException
Deprecated. Replaced by COptQuestObjective::SetCurrentValue() method. Sets the objective value for the current solution.

Parameters:
objective - - the calculated value of the objective.
Throws:
COptQuestException

SetCurrentObjectiveValue

public void SetCurrentObjectiveValue(int pID,
                                     double objective)
                              throws COptQuestException
Deprecated. Replaced by COptQuestObjective::SetCurrentValue() Sets the objective value for the current solution in a parallel optimization.

Parameters:
pID -
objective -
Throws:
COptQuestException

GetBestObjectiveValue

public double GetBestObjectiveValue()
Returns the objective value for the best solution found thus far.

Returns:
objective value of the best solution.

GetNthBestObjectiveValue

public double GetNthBestObjectiveValue()
                                throws COptQuestException
Returns the objective value for the Nth best solution, identified by the method COptQuestOptimization::SetNthBest(n);

Returns:
the objective value of the Nth best solution. Returns 0 if the solution doesn't exist.
Throws:
COptQuestException

GetBestStatistic

public double GetBestStatistic(int measure,
                               int statistic,
                               double statisticValue)
                        throws COptQuestException
Using the best solution, calculate the requested statistic on the specified measure

Parameters:
measure -
  • OCLP_NPV = 1
  • OCLP_IRR = 2
  • OCLP_PBP = 3
statistic -
  • OCLP_MEAN = 1
  • OCLP_MEDIAN = 2
  • OCLP_PERCENTILE = 3
  • OCLP_STDDEV = 4
  • OCLP_SEMI1STDDEV = 5
  • OCLP_VARIANCE = 6
  • OCLP_SEMI1VARIANCE = 7
  • OCLP_COEFFOFVAR = 8
  • OCLP_COEFFOFSEMI1VAR = 9
  • OCLP_PROBABILITY = 10
  • OCLP_SEMI2STDDEV = 11
  • OCLP_SEMI2VARIANCE = 12
  • OCLP_COEFFOFSEMI2VAR = 13
statisticValue - target values for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV, OCLP_PROBABILITY
Returns:
the result of the calculation
Throws:
COptQuestException

GetNthBestStatistic

public double GetNthBestStatistic(int measure,
                                  int statistic,
                                  double statisticValue)
                           throws COptQuestException
Using the Nth best solution, calculate the requested statistic on the specified measure. The Nth best solution is identified by the SetNthBest() method.

Parameters:
measure -
  • OCLP_NPV = 1
  • OCLP_IRR = 2
  • OCLP_PBP = 3
statistic -
  • OCLP_MEAN = 1
  • OCLP_MEDIAN = 2
  • OCLP_PERCENTILE = 3
  • OCLP_STDDEV = 4
  • OCLP_SEMI1STDDEV = 5
  • OCLP_VARIANCE = 6
  • OCLP_SEMI1VARIANCE = 7
  • OCLP_COEFFOFVAR = 8
  • OCLP_COEFFOFSEMI1VAR = 9
  • OCLP_PROBABILITY = 10
  • OCLP_SEMI2STDDEV = 11
  • OCLP_SEMI2VARIANCE = 12
  • OCLP_COEFFOFSEMI2VAR = 13
statisticValue - target values for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV, OCLP_PROBABILITY
Returns:
the result of the calculation
Throws:
COptQuestException

GetCurrentStatistic

public double GetCurrentStatistic(int measure,
                                  int statistic,
                                  double statisticValue)
                           throws COptQuestException
Using the current solution, calculate the requested statistic on the specified measure

Parameters:
measure -
  • OCLP_NPV = 1
  • OCLP_IRR = 2
  • OCLP_PBP = 3
statistic -
  • OCLP_MEAN = 1
  • OCLP_MEDIAN = 2
  • OCLP_PERCENTILE = 3
  • OCLP_STDDEV = 4
  • OCLP_SEMI1STDDEV = 5
  • OCLP_VARIANCE = 6
  • OCLP_SEMI1VARIANCE = 7
  • OCLP_COEFFOFVAR = 8
  • OCLP_COEFFOFSEMI1VAR = 9
  • OCLP_PROBABILITY = 10
  • OCLP_SEMI2STDDEV = 11
  • OCLP_SEMI2VARIANCE = 12
  • OCLP_COEFFOFSEMI2VAR = 13
statisticValue - target values for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV, OCLP_PROBABILITY
Returns:
the result of the calculation
Throws:
COptQuestException

GetSolutionStatistic

public double GetSolutionStatistic(int iteration,
                                   int measure,
                                   int statistic,
                                   double statisticValue)
                            throws COptQuestException
Using the solution at the specified iteration, calculate the requested statistic on the specified measure

Parameters:
measure -
  • OCLP_NPV = 1
  • OCLP_IRR = 2
  • OCLP_PBP = 3
statistic - *
  • OCLP_MEAN = 1
  • OCLP_MEDIAN = 2
  • OCLP_PERCENTILE = 3
  • OCLP_STDDEV = 4
  • OCLP_SEMI1STDDEV = 5
  • OCLP_VARIANCE = 6
  • OCLP_SEMI1VARIANCE = 7
  • OCLP_COEFFOFVAR = 8
  • OCLP_COEFFOFSEMI1VAR = 9
  • OCLP_PROBABILITY = 10
  • OCLP_SEMI2STDDEV = 11
  • OCLP_SEMI2VARIANCE = 12
  • OCLP_COEFFOFSEMI2VAR = 13
statisticValue - target values for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV, OCLP_PROBABILITY
Returns:
the result of the calculation
Throws:
COptQuestException

GetSolutionObjectiveValue

public double GetSolutionObjectiveValue(int iteration)
                                 throws