Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
A search monitor is a simple set of callbacks to monitor all search events. More...
#include <constraint_solver.h>
Public Member Functions | |
SearchMonitor (Solver *const s) | |
SearchMonitor (const SearchMonitor &)=delete | |
This type is neither copyable nor movable. | |
SearchMonitor & | operator= (const SearchMonitor &)=delete |
~SearchMonitor () override | |
virtual void | EnterSearch () |
Beginning of the search. | |
virtual void | RestartSearch () |
Restart the search. | |
virtual void | ExitSearch () |
End of the search. | |
virtual void | BeginNextDecision (DecisionBuilder *b) |
Before calling DecisionBuilder::Next. | |
virtual void | EndNextDecision (DecisionBuilder *b, Decision *d) |
After calling DecisionBuilder::Next, along with the returned decision. | |
virtual void | ApplyDecision (Decision *d) |
Before applying the decision. | |
virtual void | RefuteDecision (Decision *d) |
Before refuting the decision. | |
virtual void | AfterDecision (Decision *d, bool apply) |
virtual void | BeginFail () |
Just when the failure occurs. | |
virtual void | EndFail () |
After completing the backtrack. | |
virtual void | BeginInitialPropagation () |
Before the initial propagation. | |
virtual void | EndInitialPropagation () |
After the initial propagation. | |
virtual bool | AcceptSolution () |
virtual bool | AtSolution () |
virtual void | NoMoreSolutions () |
When the search tree is finished. | |
virtual bool | LocalOptimum () |
virtual bool | AcceptDelta (Assignment *delta, Assignment *deltadelta) |
virtual void | AcceptNeighbor () |
After accepting a neighbor during local search. | |
virtual void | AcceptUncheckedNeighbor () |
After accepting an unchecked neighbor during local search. | |
virtual bool | IsUncheckedSolutionLimitReached () |
virtual void | PeriodicCheck () |
Periodic call to check limits in long running methods. | |
virtual int | ProgressPercent () |
virtual void | Accept (ModelVisitor *visitor) const |
Accepts the given model visitor. | |
virtual void | Install () |
A search monitors adds itself on the active search. | |
Solver * | solver () const |
Public Member Functions inherited from operations_research::BaseObject | |
BaseObject () | |
BaseObject (const BaseObject &)=delete | |
This type is neither copyable nor movable. | |
BaseObject & | operator= (const BaseObject &)=delete |
virtual | ~BaseObject () |
virtual std::string | DebugString () const |
Static Public Attributes | |
static constexpr int | kNoProgress = -1 |
Protected Member Functions | |
void | ListenToEvent (Solver::MonitorEvent event) |
A search monitor is a simple set of callbacks to monitor all search events.
Definition at line 3901 of file constraint_solver.h.
|
inlineexplicit |
Definition at line 3905 of file constraint_solver.h.
|
delete |
This type is neither copyable nor movable.
|
inlineoverride |
Definition at line 3912 of file constraint_solver.h.
|
virtual |
Accepts the given model visitor.
Reimplemented in operations_research::ObjectiveMonitor, and operations_research::RegularLimit.
Definition at line 2904 of file constraint_solver.cc.
|
virtual |
Reimplemented in operations_research::ObjectiveMonitor.
Definition at line 2897 of file constraint_solver.cc.
|
virtual |
After accepting a neighbor during local search.
Definition at line 2901 of file constraint_solver.cc.
|
virtual |
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.
Reimplemented in operations_research::OptimizeVar.
Definition at line 2893 of file constraint_solver.cc.
|
virtual |
After accepting an unchecked neighbor during local search.
Reimplemented in operations_research::SearchLog.
Definition at line 2902 of file constraint_solver.cc.
|
virtual |
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.
Definition at line 2887 of file constraint_solver.cc.
|
virtual |
Before applying the decision.
Reimplemented in operations_research::SearchLog.
Definition at line 2885 of file constraint_solver.cc.
|
virtual |
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.
Reimplemented in operations_research::ImprovementSearchLimit, operations_research::ObjectiveMonitor, operations_research::OptimizeVar, and operations_research::SearchLog.
Definition at line 2894 of file constraint_solver.cc.
|
virtual |
Just when the failure occurs.
Reimplemented in operations_research::DemonProfiler, and operations_research::SearchLog.
Definition at line 2889 of file constraint_solver.cc.
|
virtual |
Before the initial propagation.
Reimplemented in operations_research::SearchLog.
Definition at line 2891 of file constraint_solver.cc.
|
virtual |
Before calling DecisionBuilder::Next.
Reimplemented in operations_research::OptimizeVar, and operations_research::SearchLimit.
Definition at line 2883 of file constraint_solver.cc.
|
virtual |
After completing the backtrack.
Definition at line 2890 of file constraint_solver.cc.
|
virtual |
After the initial propagation.
Reimplemented in operations_research::SearchLog.
Definition at line 2892 of file constraint_solver.cc.
|
virtual |
After calling DecisionBuilder::Next, along with the returned decision.
Reimplemented in operations_research::SymmetryManager.
Definition at line 2884 of file constraint_solver.cc.
|
virtual |
Beginning of the search.
-------— Search Monitor -------—
Reimplemented in operations_research::ObjectiveMonitor, operations_research::SearchLimit, operations_research::SearchLog, and operations_research::SolutionCollector.
Definition at line 2880 of file constraint_solver.cc.
|
virtual |
End of the search.
Reimplemented in operations_research::LocalSearchProfiler, operations_research::RegularLimit, and operations_research::SearchLog.
Definition at line 2882 of file constraint_solver.cc.
|
virtual |
A search monitors adds itself on the active search.
Registers itself on the solver such that it gets notified of the search and propagation events. Override to incrementally install listeners for specific events.
Reimplemented in operations_research::DemonProfiler, operations_research::ImprovementSearchLimit, operations_research::LocalSearchMonitor, operations_research::LocalSearchMonitorPrimary, operations_research::LocalSearchProfiler, operations_research::PropagationMonitor, operations_research::RegularLimit, operations_research::SearchLimit, operations_research::SolutionCollector, and operations_research::Trace.
Definition at line 2907 of file constraint_solver.cc.
|
inlinevirtual |
Returns true if the limit of solutions has been reached including unchecked solutions.
Reimplemented in operations_research::RegularLimit.
Definition at line 3979 of file constraint_solver.h.
|
protected |
Definition at line 2914 of file constraint_solver.cc.
|
virtual |
When a local optimum is reached. If 'true' is returned, the last solution is discarded and the search proceeds with the next one.
Definition at line 2896 of file constraint_solver.cc.
|
virtual |
When the search tree is finished.
Reimplemented in operations_research::SearchLog.
Definition at line 2895 of file constraint_solver.cc.
|
delete |
|
virtual |
Periodic call to check limits in long running methods.
Reimplemented in operations_research::SearchLimit.
Definition at line 2903 of file constraint_solver.cc.
|
inlinevirtual |
Returns a percentage representing the propress of the search before reaching limits.
Reimplemented in operations_research::RegularLimit.
Definition at line 3986 of file constraint_solver.h.
|
virtual |
Before refuting the decision.
Reimplemented in operations_research::OptimizeVar, operations_research::SearchLimit, operations_research::SearchLog, and operations_research::SymmetryManager.
Definition at line 2886 of file constraint_solver.cc.
|
virtual |
Restart the search.
Reimplemented in operations_research::DemonProfiler, and operations_research::LocalSearchProfiler.
Definition at line 2881 of file constraint_solver.cc.
|
inline |
Definition at line 3996 of file constraint_solver.h.
|
staticconstexpr |
Definition at line 3903 of file constraint_solver.h.