Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Base class of all search limits. More...
#include <constraint_solver.h>
Public Member Functions | |
SearchLimit (Solver *const s) | |
SearchLimit (const SearchLimit &)=delete | |
This type is neither copyable nor movable. | |
SearchLimit & | operator= (const SearchLimit &)=delete |
~SearchLimit () override | |
-------— Search Limits -------— | |
bool | crossed () const |
Returns true if the limit has been crossed. | |
bool | Check () |
virtual bool | CheckWithOffset (absl::Duration offset)=0 |
virtual void | Init ()=0 |
This method is called when the search limit is initialized. | |
virtual void | Copy (const SearchLimit *limit)=0 |
virtual SearchLimit * | MakeClone () const =0 |
Allocates a clone of the limit. | |
void | EnterSearch () override |
Internal methods. | |
void | BeginNextDecision (DecisionBuilder *b) override |
Before calling DecisionBuilder::Next. | |
void | PeriodicCheck () override |
Periodic call to check limits in long running methods. | |
void | RefuteDecision (Decision *d) override |
Before refuting the decision. | |
std::string | DebugString () const override |
void | Install () override |
A search monitors adds itself on the active search. | |
Public Member Functions inherited from operations_research::SearchMonitor | |
SearchMonitor (Solver *const s) | |
SearchMonitor (const SearchMonitor &)=delete | |
This type is neither copyable nor movable. | |
SearchMonitor & | operator= (const SearchMonitor &)=delete |
~SearchMonitor () override | |
virtual void | RestartSearch () |
Restart the search. | |
virtual void | ExitSearch () |
End of the search. | |
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 | 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 int | ProgressPercent () |
virtual void | Accept (ModelVisitor *visitor) const |
Accepts the given model visitor. | |
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 () |
Additional Inherited Members | |
Static Public Attributes inherited from operations_research::SearchMonitor | |
static constexpr int | kNoProgress = -1 |
Protected Member Functions inherited from operations_research::SearchMonitor | |
void | ListenToEvent (Solver::MonitorEvent event) |
Base class of all search limits.
Definition at line 4613 of file constraint_solver.h.
|
inlineexplicit |
Definition at line 4615 of file constraint_solver.h.
|
delete |
This type is neither copyable nor movable.
|
override |
|
overridevirtual |
Before calling DecisionBuilder::Next.
Reimplemented from operations_research::SearchMonitor.
|
inline |
This method is called to check the status of the limit. A return value of true indicates that we have indeed crossed the limit. In that case, this method will not be called again and the remaining search will be discarded.
Definition at line 4631 of file constraint_solver.h.
|
pure virtual |
Same as Check() but adds the 'offset' value to the current time when time is considered in the limit.
Implemented in operations_research::ImprovementSearchLimit, and operations_research::RegularLimit.
|
pure virtual |
Copy a limit. Warning: leads to a direct (no check) downcasting of 'limit' so one needs to be sure both SearchLimits are of the same type.
Implemented in operations_research::ImprovementSearchLimit, and operations_research::RegularLimit.
|
inline |
Returns true if the limit has been crossed.
Definition at line 4625 of file constraint_solver.h.
|
inlineoverridevirtual |
Reimplemented from operations_research::BaseObject.
Definition at line 4651 of file constraint_solver.h.
|
overridevirtual |
Internal methods.
Reimplemented from operations_research::SearchMonitor.
|
pure virtual |
This method is called when the search limit is initialized.
Implemented in operations_research::ImprovementSearchLimit, and operations_research::RegularLimit.
|
overridevirtual |
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 from operations_research::SearchMonitor.
|
pure virtual |
Allocates a clone of the limit.
Implemented in operations_research::ImprovementSearchLimit, and operations_research::RegularLimit.
|
delete |
|
overridevirtual |
Periodic call to check limits in long running methods.
Reimplemented from operations_research::SearchMonitor.
|
overridevirtual |
Before refuting the decision.
Reimplemented from operations_research::SearchMonitor.