operations_research::SearchLog Class Reference

Detailed Description

The base class of all search logs that periodically outputs information when the search is running.

Definition at line 1787 of file constraint_solveri.h.

Public Member Functions

 SearchLog (Solver *const s, OptimizeVar *const obj, IntVar *const var, double scaling_factor, std::function< std::string()> display_callback, int period)
 
 ~SearchLog () override
 
void EnterSearch () override
 Beginning of the search. More...
 
void ExitSearch () override
 End of the search. More...
 
bool AtSolution () override
 This method is called when a valid solution is found. More...
 
void BeginFail () override
 Just when the failure occurs. More...
 
void NoMoreSolutions () override
 When the search tree is finished. More...
 
void AcceptUncheckedNeighbor () override
 After accepting an unchecked neighbor during local search. More...
 
void ApplyDecision (Decision *const decision) override
 Before applying the decision. More...
 
void RefuteDecision (Decision *const decision) override
 Before refuting the decision. More...
 
void OutputDecision ()
 
void Maintain ()
 
void BeginInitialPropagation () override
 Before the initial propagation. More...
 
void EndInitialPropagation () override
 After the initial propagation. More...
 
std::string DebugString () const override
 
virtual void RestartSearch ()
 Restart the search. More...
 
virtual void BeginNextDecision (DecisionBuilder *const b)
 Before calling DecisionBuilder::Next. More...
 
virtual void EndNextDecision (DecisionBuilder *const b, Decision *const d)
 After calling DecisionBuilder::Next, along with the returned decision. More...
 
virtual void AfterDecision (Decision *const d, bool apply)
 Just after refuting or applying the decision, apply is true after Apply. More...
 
virtual void EndFail ()
 After completing the backtrack. More...
 
virtual bool AcceptSolution ()
 This method is called when a solution is found. More...
 
virtual bool LocalOptimum ()
 When a local optimum is reached. More...
 
virtual bool AcceptDelta (Assignment *delta, Assignment *deltadelta)
 
virtual void AcceptNeighbor ()
 After accepting a neighbor during local search. More...
 
virtual bool IsUncheckedSolutionLimitReached ()
 Returns true if the limit of solutions has been reached including unchecked solutions. More...
 
Solversolver () const
 
virtual void PeriodicCheck ()
 Periodic call to check limits in long running methods. More...
 
virtual int ProgressPercent ()
 Returns a percentage representing the propress of the search before reaching limits. More...
 
virtual void Accept (ModelVisitor *const visitor) const
 Accepts the given model visitor. More...
 
virtual void Install ()
 Registers itself on the solver such that it gets notified of the search and propagation events. More...
 

Static Public Attributes

static const int kNoProgress = -1
 

Protected Member Functions

virtual void OutputLine (const std::string &line)
 

Constructor & Destructor Documentation

◆ SearchLog()

operations_research::SearchLog::SearchLog ( Solver *const  s,
OptimizeVar *const  obj,
IntVar *const  var,
double  scaling_factor,
std::function< std::string()>  display_callback,
int  period 
)

◆ ~SearchLog()

operations_research::SearchLog::~SearchLog ( )
override

Member Function Documentation

◆ Accept()

virtual void operations_research::SearchMonitor::Accept ( ModelVisitor *const  visitor) const
virtualinherited

Accepts the given model visitor.

Reimplemented in operations_research::RegularLimit, and operations_research::OptimizeVar.

◆ AcceptDelta()

virtual bool operations_research::SearchMonitor::AcceptDelta ( Assignment delta,
Assignment deltadelta 
)
virtualinherited

◆ AcceptNeighbor()

virtual void operations_research::SearchMonitor::AcceptNeighbor ( )
virtualinherited

After accepting a neighbor during local search.

◆ AcceptSolution()

virtual bool operations_research::SearchMonitor::AcceptSolution ( )
virtualinherited

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.

◆ AcceptUncheckedNeighbor()

void operations_research::SearchLog::AcceptUncheckedNeighbor ( )
overridevirtual

After accepting an unchecked neighbor during local search.

Reimplemented from operations_research::SearchMonitor.

◆ AfterDecision()

virtual void operations_research::SearchMonitor::AfterDecision ( Decision *const  d,
bool  apply 
)
virtualinherited

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.

◆ ApplyDecision()

void operations_research::SearchLog::ApplyDecision ( Decision *const  d)
overridevirtual

Before applying the decision.

Reimplemented from operations_research::SearchMonitor.

◆ AtSolution()

bool operations_research::SearchLog::AtSolution ( )
overridevirtual

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 from operations_research::SearchMonitor.

◆ BeginFail()

void operations_research::SearchLog::BeginFail ( )
overridevirtual

Just when the failure occurs.

Reimplemented from operations_research::SearchMonitor.

◆ BeginInitialPropagation()

void operations_research::SearchLog::BeginInitialPropagation ( )
overridevirtual

Before the initial propagation.

Reimplemented from operations_research::SearchMonitor.

◆ BeginNextDecision()

virtual void operations_research::SearchMonitor::BeginNextDecision ( DecisionBuilder *const  b)
virtualinherited

◆ DebugString()

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

Reimplemented from operations_research::BaseObject.

◆ EndFail()

virtual void operations_research::SearchMonitor::EndFail ( )
virtualinherited

After completing the backtrack.

◆ EndInitialPropagation()

void operations_research::SearchLog::EndInitialPropagation ( )
overridevirtual

After the initial propagation.

Reimplemented from operations_research::SearchMonitor.

◆ EndNextDecision()

virtual void operations_research::SearchMonitor::EndNextDecision ( DecisionBuilder *const  b,
Decision *const  d 
)
virtualinherited

After calling DecisionBuilder::Next, along with the returned decision.

◆ EnterSearch()

void operations_research::SearchLog::EnterSearch ( )
overridevirtual

Beginning of the search.

Reimplemented from operations_research::SearchMonitor.

◆ ExitSearch()

void operations_research::SearchLog::ExitSearch ( )
overridevirtual

End of the search.

Reimplemented from operations_research::SearchMonitor.

◆ Install()

virtual void operations_research::SearchMonitor::Install ( )
virtualinherited

Registers itself on the solver such that it gets notified of the search and propagation events.

Reimplemented in operations_research::LocalSearchMonitor, and operations_research::PropagationMonitor.

◆ IsUncheckedSolutionLimitReached()

virtual bool operations_research::SearchMonitor::IsUncheckedSolutionLimitReached ( )
inlinevirtualinherited

Returns true if the limit of solutions has been reached including unchecked solutions.

Reimplemented in operations_research::RegularLimit.

Definition at line 3643 of file constraint_solver.h.

◆ LocalOptimum()

virtual bool operations_research::SearchMonitor::LocalOptimum ( )
virtualinherited

When a local optimum is reached.

If 'true' is returned, the last solution is discarded and the search proceeds with the next one.

◆ Maintain()

void operations_research::SearchLog::Maintain ( )

◆ NoMoreSolutions()

void operations_research::SearchLog::NoMoreSolutions ( )
overridevirtual

When the search tree is finished.

Reimplemented from operations_research::SearchMonitor.

◆ OutputDecision()

void operations_research::SearchLog::OutputDecision ( )

◆ OutputLine()

virtual void operations_research::SearchLog::OutputLine ( const std::string &  line)
protectedvirtual

◆ PeriodicCheck()

virtual void operations_research::SearchMonitor::PeriodicCheck ( )
virtualinherited

Periodic call to check limits in long running methods.

Reimplemented in operations_research::SearchLimit.

◆ ProgressPercent()

virtual int operations_research::SearchMonitor::ProgressPercent ( )
inlinevirtualinherited

Returns a percentage representing the propress of the search before reaching limits.

Reimplemented in operations_research::RegularLimit.

Definition at line 3652 of file constraint_solver.h.

◆ RefuteDecision()

void operations_research::SearchLog::RefuteDecision ( Decision *const  d)
overridevirtual

Before refuting the decision.

Reimplemented from operations_research::SearchMonitor.

◆ RestartSearch()

virtual void operations_research::SearchMonitor::RestartSearch ( )
virtualinherited

Restart the search.

◆ solver()

Solver* operations_research::SearchMonitor::solver ( ) const
inlineinherited

Definition at line 3645 of file constraint_solver.h.

Member Data Documentation

◆ kNoProgress

const int operations_research::SearchMonitor::kNoProgress = -1
staticinherited

Definition at line 3574 of file constraint_solver.h.


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