OR-Tools  9.6
IntVarFilteredDecisionBuilder

Detailed Description

Decision builder building a solution using heuristics with local search filters to evaluate its feasibility.

This is very fast but can eventually fail when the solution is restored if filters did not detect all infeasiblities. More details: Using local search filters to build a solution. The approach is pretty straight-forward: have a general assignment storing the current solution, build delta assignment representing possible extensions to the current solution and validate them with filters. The tricky bit comes from using the assignment and filter APIs in a way which avoids the lazy creation of internal hash_maps between variables and indices. Generic filter-based decision builder using an IntVarFilteredHeuristic. when the code is mature enough.

Definition at line 151 of file routing_search.h.

Public Member Functions

 IntVarFilteredDecisionBuilder (std::unique_ptr< IntVarFilteredHeuristic > heuristic)
 
 ~IntVarFilteredDecisionBuilder () override
 
DecisionNext (Solver *solver) override
 This is the main method of the decision builder class. More...
 
std::string DebugString () const override
 
int64_t number_of_decisions () const
 Returns statistics from its underlying heuristic. More...
 
int64_t number_of_rejects () const
 
virtual void AppendMonitors (Solver *const solver, std::vector< SearchMonitor * > *const extras)
 This method will be called at the start of the search. More...
 
virtual void Accept (ModelVisitor *const visitor) const
 
void set_name (const std::string &name)
 
std::string GetName () const
 

Constructor & Destructor Documentation

◆ IntVarFilteredDecisionBuilder()

IntVarFilteredDecisionBuilder ( std::unique_ptr< IntVarFilteredHeuristic heuristic)
explicit

Definition at line 237 of file routing_search.cc.

◆ ~IntVarFilteredDecisionBuilder()

~IntVarFilteredDecisionBuilder ( )
inlineoverride

Definition at line 156 of file routing_search.h.

Member Function Documentation

◆ Accept()

void Accept ( ModelVisitor *const  visitor) const
virtualinherited

Reimplemented in ProfiledDecisionBuilder.

Definition at line 2570 of file constraint_solver.cc.

◆ AppendMonitors()

void AppendMonitors ( Solver *const  solver,
std::vector< SearchMonitor * > *const  extras 
)
virtualinherited

This method will be called at the start of the search.

It asks the decision builder if it wants to append search monitors to the list of active monitors for this search. Please note there are no checks at this point for duplication.

Reimplemented in ProfiledDecisionBuilder.

Definition at line 2567 of file constraint_solver.cc.

◆ DebugString()

std::string DebugString ( ) const
overridevirtual

Reimplemented from DecisionBuilder.

Definition at line 262 of file routing_search.cc.

◆ GetName()

std::string GetName ( ) const
inherited

Definition at line 2563 of file constraint_solver.cc.

◆ Next()

Decision * Next ( Solver s)
overridevirtual

This is the main method of the decision builder class.

It must return a decision (an instance of the class Decision). If it returns nullptr, this means that the decision builder has finished its work.

Implements DecisionBuilder.

Definition at line 241 of file routing_search.cc.

◆ number_of_decisions()

int64_t number_of_decisions ( ) const

Returns statistics from its underlying heuristic.

Definition at line 254 of file routing_search.cc.

◆ number_of_rejects()

int64_t number_of_rejects ( ) const

Definition at line 258 of file routing_search.cc.

◆ set_name()

void set_name ( const std::string &  name)
inlineinherited

Definition at line 3382 of file constraint_solver.h.


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