Google OR-Tools: operations_research::RegularLimit Class Reference

Usual limit based on wall_time, number of explored branches and number of failures in the search tree

Definition at line 4786 of file constraint_solver.h.

#include <constraint_solver.h>

operations_research::SearchLimit operations_research::SearchMonitor operations_research::BaseObject

Public Member Functions

 RegularLimit (Solver *s, absl::Duration time, int64_t branches, int64_t failures, int64_t solutions, bool smart_time_check, bool cumulative)
 ~RegularLimit () override
void Copy (const SearchLimit *limit) override
SearchLimitMakeClone () const override
 Allocates a clone of the limit.
RegularLimitMakeIdenticalClone () const
bool CheckWithOffset (absl::Duration offset) override
void Init () override
 This method is called when the search limit is initialized.
void ExitSearch () override
 End of the search.
void UpdateLimits (absl::Duration time, int64_t branches, int64_t failures, int64_t solutions)
absl::Duration duration_limit () const
int64_t wall_time () const
int64_t branches () const
int64_t failures () const
int64_t solutions () const
bool IsUncheckedSolutionLimitReached () override
int ProgressPercent () override
std::string DebugString () const override
void Install () override
absl::Time AbsoluteSolverDeadline () const
void Accept (ModelVisitor *visitor) const override
 Accepts the given model visitor.
Public Member Functions inherited from operations_research::SearchLimit
 SearchLimit (Solver *const s)
 SearchLimit (const SearchLimit &)=delete
SearchLimitoperator= (const SearchLimit &)=delete
 ~SearchLimit () override
bool crossed () const
 Returns true if the limit has been crossed.
bool Check ()
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
Public Member Functions inherited from operations_research::SearchMonitor
 SearchMonitor (Solver *const s)
 SearchMonitor (const SearchMonitor &)=delete
SearchMonitoroperator= (const SearchMonitor &)=delete
 ~SearchMonitor () override
virtual void RestartSearch ()
 Restart 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 AtLocalOptimum ()
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.
Solversolver () const
Public Member Functions inherited from operations_research::BaseObject
 BaseObject ()
 BaseObject (const BaseObject &)=delete
BaseObjectoperator= (const BaseObject &)=delete
virtual ~BaseObject ()=default
operations_research::RegularLimit::RegularLimit ( Solver * s,
absl::Duration time,
int64_t branches,
int64_t failures,
int64_t solutions,
bool smart_time_check,
bool cumulative )

◆ ~RegularLimit()

operations_research::RegularLimit::~RegularLimit ( )
override

◆ AbsoluteSolverDeadline()

absl::Time operations_research::RegularLimit::AbsoluteSolverDeadline ( ) const
inline

◆ Accept()

void operations_research::RegularLimit::Accept ( ModelVisitor * visitor) const
overridevirtual

◆ branches()

int64_t operations_research::RegularLimit::branches ( ) const
inline

◆ CheckWithOffset()

bool operations_research::RegularLimit::CheckWithOffset ( absl::Duration offset)
overridevirtual

◆ Copy()

void operations_research::RegularLimit::Copy ( const SearchLimit * limit)
overridevirtual

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.

Implements operations_research::SearchLimit.

Definition at line 4613 of file search.cc.

◆ DebugString()

std::string operations_research::RegularLimit::DebugString ( ) const
overridevirtual

◆ duration_limit()

absl::Duration operations_research::RegularLimit::duration_limit ( ) const
inline

◆ ExitSearch()

void operations_research::RegularLimit::ExitSearch ( )
overridevirtual

◆ failures()

int64_t operations_research::RegularLimit::failures ( ) const
inline

◆ Init()

void operations_research::RegularLimit::Init ( )
overridevirtual

◆ Install()

void operations_research::RegularLimit::Install ( )
overridevirtual

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.

Definition at line 4605 of file search.cc.

◆ IsUncheckedSolutionLimitReached()

bool operations_research::RegularLimit::IsUncheckedSolutionLimitReached ( )
overridevirtual

◆ MakeClone()

SearchLimit * operations_research::RegularLimit::MakeClone ( ) const
overridevirtual

◆ MakeIdenticalClone()

RegularLimit * operations_research::RegularLimit::MakeIdenticalClone ( ) const

◆ ProgressPercent()

int operations_research::RegularLimit::ProgressPercent ( )
overridevirtual

◆ solutions()

int64_t operations_research::RegularLimit::solutions ( ) const
inline

◆ UpdateLimits()

void operations_research::RegularLimit::UpdateLimits ( absl::Duration time,
int64_t branches,
int64_t failures,
int64_t solutions )

◆ wall_time()

int64_t operations_research::RegularLimit::wall_time ( ) const
inline

The documentation for this class was generated from the following files: