Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::Search Class Reference

---------------— Search class --------------— More...

Public Member Functions

 Search (Solver *const s)
 Search (Solver *const s, int)
 ~Search ()
void EnterSearch ()
void RestartSearch ()
void ExitSearch ()
void BeginNextDecision (DecisionBuilder *db)
void EndNextDecision (DecisionBuilder *db, Decision *d)
void ApplyDecision (Decision *d)
void AfterDecision (Decision *d, bool apply)
void RefuteDecision (Decision *d)
void BeginFail ()
void EndFail ()
void BeginInitialPropagation ()
void EndInitialPropagation ()
bool AtSolution ()
bool AcceptSolution ()
void NoMoreSolutions ()
bool LocalOptimum ()
bool AcceptDelta (Assignment *delta, Assignment *deltadelta)
void AcceptNeighbor ()
void AcceptUncheckedNeighbor ()
bool IsUncheckedSolutionLimitReached ()
void PeriodicCheck ()
int ProgressPercent ()
void Accept (ModelVisitor *visitor) const
void AddEventListener (Solver::MonitorEvent event, SearchMonitor *monitor)
const std::vector< SearchMonitor * > & GetEventListeners (Solver::MonitorEvent event) const
void Clear ()
void IncrementSolutionCounter ()
int64_t solution_counter () const
void IncrementUncheckedSolutionCounter ()
int64_t unchecked_solution_counter () const
void set_decision_builder (DecisionBuilder *const db)
DecisionBuilderdecision_builder () const
void set_created_by_solve (bool c)
bool created_by_solve () const
Solver::DecisionModification ModifyDecision ()
void SetBranchSelector (Solver::BranchSelector bs)
void LeftMove ()
void RightMove ()
bool backtrack_at_the_end_of_the_search () const
void set_backtrack_at_the_end_of_the_search (bool restore)
int search_depth () const
void set_search_depth (int d)
int left_search_depth () const
void set_search_left_depth (int d)
void set_should_restart (bool s)
bool should_restart () const
void set_should_finish (bool s)
bool should_finish () const
void CheckFail ()
void set_search_context (absl::string_view search_context)
std::string search_context () const

Friends

class Solver

Detailed Description

---------------— Search class --------------—

Definition at line 971 of file constraint_solver.cc.

Constructor & Destructor Documentation

◆ Search() [1/2]

operations_research::Search::Search ( Solver *const s)
inlineexplicit

Definition at line 973 of file constraint_solver.cc.

◆ Search() [2/2]

operations_research::Search::Search ( Solver *const s,
int  )
inline

Constructor for a dummy search. The only difference between a dummy search and a regular one is that the search depth and left search depth is initialized to -1 instead of zero.

Definition at line 993 of file constraint_solver.cc.

◆ ~Search()

operations_research::Search::~Search ( )
inline

Definition at line 1010 of file constraint_solver.cc.

Member Function Documentation

◆ Accept()

void operations_research::Search::Accept ( ModelVisitor * visitor) const

Definition at line 1368 of file constraint_solver.cc.

◆ AcceptDelta()

bool operations_research::Search::AcceptDelta ( Assignment * delta,
Assignment * deltadelta )

Definition at line 1330 of file constraint_solver.cc.

◆ AcceptNeighbor()

void operations_research::Search::AcceptNeighbor ( )

Definition at line 1341 of file constraint_solver.cc.

◆ AcceptSolution()

bool operations_research::Search::AcceptSolution ( )

Even though we know the return value, we cannot return yet: this would break the contract we have with solution monitors. They all deserve a chance to look at the solution.

Definition at line 1289 of file constraint_solver.cc.

◆ AcceptUncheckedNeighbor()

void operations_research::Search::AcceptUncheckedNeighbor ( )

Definition at line 1343 of file constraint_solver.cc.

◆ AddEventListener()

void operations_research::Search::AddEventListener ( Solver::MonitorEvent event,
SearchMonitor * monitor )
inline

Definition at line 1035 of file constraint_solver.cc.

◆ AfterDecision()

void operations_research::Search::AfterDecision ( Decision * d,
bool apply )

Definition at line 1265 of file constraint_solver.cc.

◆ ApplyDecision()

void operations_research::Search::ApplyDecision ( Decision * d)

Definition at line 1259 of file constraint_solver.cc.

◆ AtSolution()

bool operations_research::Search::AtSolution ( )

Even though we know the return value, we cannot return yet: this would break the contract we have with solution monitors. They all deserve a chance to look at the solution.

Definition at line 1303 of file constraint_solver.cc.

◆ backtrack_at_the_end_of_the_search()

bool operations_research::Search::backtrack_at_the_end_of_the_search ( ) const
inline

Definition at line 1064 of file constraint_solver.cc.

◆ BeginFail()

void operations_research::Search::BeginFail ( )

Definition at line 1277 of file constraint_solver.cc.

◆ BeginInitialPropagation()

void operations_research::Search::BeginInitialPropagation ( )

Definition at line 1281 of file constraint_solver.cc.

◆ BeginNextDecision()

void operations_research::Search::BeginNextDecision ( DecisionBuilder * db)

Definition at line 1247 of file constraint_solver.cc.

◆ CheckFail()

void operations_research::Search::CheckFail ( )
inline

Definition at line 1078 of file constraint_solver.cc.

◆ Clear()

void operations_research::Search::Clear ( )

Definition at line 1216 of file constraint_solver.cc.

◆ created_by_solve()

bool operations_research::Search::created_by_solve ( ) const
inline

Definition at line 1056 of file constraint_solver.cc.

◆ decision_builder()

DecisionBuilder * operations_research::Search::decision_builder ( ) const
inline

Definition at line 1054 of file constraint_solver.cc.

◆ EndFail()

void operations_research::Search::EndFail ( )

Definition at line 1279 of file constraint_solver.cc.

◆ EndInitialPropagation()

void operations_research::Search::EndInitialPropagation ( )

Definition at line 1285 of file constraint_solver.cc.

◆ EndNextDecision()

void operations_research::Search::EndNextDecision ( DecisionBuilder * db,
Decision * d )

Definition at line 1253 of file constraint_solver.cc.

◆ EnterSearch()

void operations_research::Search::EnterSearch ( )

The solution counter is reset when entering search and not when leaving search. This enables the information to persist outside of top-level search.

Definition at line 1230 of file constraint_solver.cc.

◆ ExitSearch()

void operations_research::Search::ExitSearch ( )

Backtrack to the correct state.

Definition at line 1240 of file constraint_solver.cc.

◆ GetEventListeners()

const std::vector< SearchMonitor * > & operations_research::Search::GetEventListeners ( Solver::MonitorEvent event) const
inline

Definition at line 1040 of file constraint_solver.cc.

◆ IncrementSolutionCounter()

void operations_research::Search::IncrementSolutionCounter ( )
inline

Definition at line 1045 of file constraint_solver.cc.

◆ IncrementUncheckedSolutionCounter()

void operations_research::Search::IncrementUncheckedSolutionCounter ( )
inline

Definition at line 1047 of file constraint_solver.cc.

◆ IsUncheckedSolutionLimitReached()

bool operations_research::Search::IsUncheckedSolutionLimitReached ( )

Definition at line 1347 of file constraint_solver.cc.

◆ left_search_depth()

int operations_research::Search::left_search_depth ( ) const
inline

Definition at line 1072 of file constraint_solver.cc.

◆ LeftMove()

void operations_research::Search::LeftMove ( )
inline

Definition at line 1059 of file constraint_solver.cc.

◆ LocalOptimum()

bool operations_research::Search::LocalOptimum ( )

Definition at line 1319 of file constraint_solver.cc.

◆ ModifyDecision()

Solver::DecisionModification operations_research::Search::ModifyDecision ( )

Definition at line 1209 of file constraint_solver.cc.

◆ NoMoreSolutions()

void operations_research::Search::NoMoreSolutions ( )

Definition at line 1317 of file constraint_solver.cc.

◆ PeriodicCheck()

void operations_research::Search::PeriodicCheck ( )

Definition at line 1357 of file constraint_solver.cc.

◆ ProgressPercent()

int operations_research::Search::ProgressPercent ( )

Definition at line 1359 of file constraint_solver.cc.

◆ RefuteDecision()

void operations_research::Search::RefuteDecision ( Decision * d)

Definition at line 1271 of file constraint_solver.cc.

◆ RestartSearch()

void operations_research::Search::RestartSearch ( )

Definition at line 1245 of file constraint_solver.cc.

◆ RightMove()

void operations_research::Search::RightMove ( )
inline

Definition at line 1063 of file constraint_solver.cc.

◆ search_context()

std::string operations_research::Search::search_context ( ) const
inline

Definition at line 1086 of file constraint_solver.cc.

◆ search_depth()

int operations_research::Search::search_depth ( ) const
inline

Definition at line 1070 of file constraint_solver.cc.

◆ set_backtrack_at_the_end_of_the_search()

void operations_research::Search::set_backtrack_at_the_end_of_the_search ( bool restore)
inline

Definition at line 1067 of file constraint_solver.cc.

◆ set_created_by_solve()

void operations_research::Search::set_created_by_solve ( bool c)
inline

Definition at line 1055 of file constraint_solver.cc.

◆ set_decision_builder()

void operations_research::Search::set_decision_builder ( DecisionBuilder *const db)
inline

Definition at line 1051 of file constraint_solver.cc.

◆ set_search_context()

void operations_research::Search::set_search_context ( absl::string_view search_context)
inline

Definition at line 1083 of file constraint_solver.cc.

◆ set_search_depth()

void operations_research::Search::set_search_depth ( int d)
inline

Definition at line 1071 of file constraint_solver.cc.

◆ set_search_left_depth()

void operations_research::Search::set_search_left_depth ( int d)
inline

Definition at line 1073 of file constraint_solver.cc.

◆ set_should_finish()

void operations_research::Search::set_should_finish ( bool s)
inline

Definition at line 1076 of file constraint_solver.cc.

◆ set_should_restart()

void operations_research::Search::set_should_restart ( bool s)
inline

Definition at line 1074 of file constraint_solver.cc.

◆ SetBranchSelector()

void operations_research::Search::SetBranchSelector ( Solver::BranchSelector bs)

Definition at line 1176 of file constraint_solver.cc.

◆ should_finish()

bool operations_research::Search::should_finish ( ) const
inline

Definition at line 1077 of file constraint_solver.cc.

◆ should_restart()

bool operations_research::Search::should_restart ( ) const
inline

Definition at line 1075 of file constraint_solver.cc.

◆ solution_counter()

int64_t operations_research::Search::solution_counter ( ) const
inline

Definition at line 1046 of file constraint_solver.cc.

◆ unchecked_solution_counter()

int64_t operations_research::Search::unchecked_solution_counter ( ) const
inline

Definition at line 1048 of file constraint_solver.cc.

◆ Solver

friend class Solver
friend

Definition at line 1087 of file constraint_solver.cc.


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