Class SearchMonitor

java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.SearchMonitor
Direct Known Subclasses:
LocalSearchMonitor, OptimizeVar, PropagationMonitor, SearchLimit, SearchLog, SolutionCollector

public class SearchMonitor
extends BaseObject
A search monitor is a simple set of callbacks to monitor all search events
  • Field Details

    • kNoProgress

      public static final int kNoProgress
  • Constructor Details

    • SearchMonitor

      protected SearchMonitor​(long cPtr, boolean cMemoryOwn)
    • SearchMonitor

      public SearchMonitor​(Solver s)
  • Method Details

    • getCPtr

      protected static long getCPtr​(SearchMonitor obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class BaseObject
    • delete

      public void delete()
      Overrides:
      delete in class BaseObject
    • swigDirectorDisconnect

      protected void swigDirectorDisconnect()
    • swigReleaseOwnership

      public void swigReleaseOwnership()
    • swigTakeOwnership

      public void swigTakeOwnership()
    • enterSearch

      public void enterSearch()
      Beginning of the search.
    • restartSearch

      public void restartSearch()
      Restart the search.
    • exitSearch

      public void exitSearch()
      End of the search.
    • beginNextDecision

      public void beginNextDecision​(DecisionBuilder b)
      Before calling DecisionBuilder::Next.
    • endNextDecision

      public void endNextDecision​(DecisionBuilder b, Decision d)
      After calling DecisionBuilder::Next, along with the returned decision.
    • applyDecision

      public void applyDecision​(Decision d)
      Before applying the decision.
    • refuteDecision

      public void refuteDecision​(Decision d)
      Before refuting the decision.
    • afterDecision

      public void afterDecision​(Decision d, boolean apply)
      Just after refuting or applying the decision, apply is true after Apply.
      This is called only if the Apply() or Refute() methods have not failed.
    • beginFail

      public void beginFail()
      Just when the failure occurs.
    • endFail

      public void endFail()
      After completing the backtrack.
    • beginInitialPropagation

      public void beginInitialPropagation()
      Before the initial propagation.
    • endInitialPropagation

      public void endInitialPropagation()
      After the initial propagation.
    • acceptSolution

      public boolean acceptSolution()
      This method is called when a solution is found. It asserts whether the
      solution is valid. A value of false indicates that the solution
      should be discarded.
    • atSolution

      public boolean atSolution()
      This method is called when a valid solution is found. If the
      return value is true, then search will resume after. If the result
      is false, then search will stop there.
    • noMoreSolutions

      public void noMoreSolutions()
      When the search tree is finished.
    • localOptimum

      public boolean localOptimum()
      When a local optimum is reached. If 'true' is returned, the last solution
      is discarded and the search proceeds with the next one.
    • acceptDelta

      public boolean acceptDelta​(Assignment delta, Assignment deltadelta)
    • acceptNeighbor

      public void acceptNeighbor()
      After accepting a neighbor during local search.
    • AcceptUncheckedNeighbor

      public void AcceptUncheckedNeighbor()
      After accepting an unchecked neighbor during local search.
    • IsUncheckedSolutionLimitReached

      public boolean IsUncheckedSolutionLimitReached()
      Returns true if the limit of solutions has been reached including
      unchecked solutions.
    • solver

      public Solver solver()
    • periodicCheck

      public void periodicCheck()
      Periodic call to check limits in long running methods.
    • progressPercent

      public int progressPercent()
      Returns a percentage representing the propress of the search before
      reaching limits.
    • accept

      public void accept​(ModelVisitor visitor)
      Accepts the given model visitor.
    • install

      public void install()
      Registers itself on the solver such that it gets notified of the search
      and propagation events.