Interface IOptQuestMonitor


public interface IOptQuestMonitor
Defines a callback that the engine calls in a managed run after each solution or replication has completed evaluation. Use the callback to update a user interface or to stop the run early.

With replications, the engine calls the monitor once for each replication. In the monitor, OptQuestSolution.GetValue(String) on an output or an objective returns the combined value of the replications that are complete so far. To stop on the combined value of all the replications of a trial solution, test OptQuestSolution.IsComplete() before you compare the value, for example return !sol.IsComplete() || profit < 1000;.

GetValue declares COptQuestException, so a monitor that reads values catches that exception, as an evaluator does (see IOptQuestEvaluator).

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Receives a solution that has completed evaluation.
  • Method Details

    • Monitor

      boolean Monitor(OptQuestSolution sol)
      Receives a solution that has completed evaluation. When the engine calls Monitor(), it has evaluated all string objectives and string constraints. For single objective models, OptQuest has determined if the solution is a best solution. For multi objective models, OptQuest has determined if the solution is on the frontier.
      Parameters:
      sol - - A solution that has completed evaluation.
      Returns:
      Returns true to continue optimization, false to stop generating new solutions. After false, the optimization stops when all solutions that are out for evaluation have been returned. If you are running with replications, the optimization stops when all replications have been evaluated.