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

#include <routing_search.h>

Inheritance diagram for operations_research::IntVarFilteredDecisionBuilder:
operations_research::DecisionBuilder operations_research::BaseObject

Public Member Functions

 IntVarFilteredDecisionBuilder (std::unique_ptr< IntVarFilteredHeuristic > heuristic)
 — First solution decision builder —
 
 ~IntVarFilteredDecisionBuilder () override
 
DecisionNext (Solver *solver) override
 
std::string DebugString () const override
 -------— Decision Builder -------—
 
int64_t number_of_decisions () const
 Returns statistics from its underlying heuristic.
 
int64_t number_of_rejects () const
 
- Public Member Functions inherited from operations_research::DecisionBuilder
 DecisionBuilder ()
 
 DecisionBuilder (const DecisionBuilder &)=delete
 This type is neither copyable nor movable.
 
DecisionBuilderoperator= (const DecisionBuilder &)=delete
 
 ~DecisionBuilder () override
 
virtual void AppendMonitors (Solver *solver, std::vector< SearchMonitor * > *extras)
 
virtual void Accept (ModelVisitor *visitor) const
 
void set_name (absl::string_view name)
 
std::string GetName () const
 
- Public Member Functions inherited from operations_research::BaseObject
 BaseObject ()
 
 BaseObject (const BaseObject &)=delete
 This type is neither copyable nor movable.
 
BaseObjectoperator= (const BaseObject &)=delete
 
virtual ~BaseObject ()
 

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.

Todo
(user): Eventually move this to the core CP solver library when the code is mature enough.

Definition at line 154 of file routing_search.h.

Constructor & Destructor Documentation

◆ IntVarFilteredDecisionBuilder()

operations_research::IntVarFilteredDecisionBuilder::IntVarFilteredDecisionBuilder ( std::unique_ptr< IntVarFilteredHeuristic > heuristic)
explicit

— First solution decision builder —

IntVarFilteredDecisionBuilder

Definition at line 239 of file routing_search.cc.

◆ ~IntVarFilteredDecisionBuilder()

operations_research::IntVarFilteredDecisionBuilder::~IntVarFilteredDecisionBuilder ( )
inlineoverride

Definition at line 159 of file routing_search.h.

Member Function Documentation

◆ DebugString()

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

-------— Decision Builder -------—

Reimplemented from operations_research::DecisionBuilder.

Definition at line 264 of file routing_search.cc.

◆ Next()

Decision * operations_research::IntVarFilteredDecisionBuilder::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 operations_research::DecisionBuilder.

Definition at line 243 of file routing_search.cc.

◆ number_of_decisions()

int64_t operations_research::IntVarFilteredDecisionBuilder::number_of_decisions ( ) const

Returns statistics from its underlying heuristic.

Definition at line 256 of file routing_search.cc.

◆ number_of_rejects()

int64_t operations_research::IntVarFilteredDecisionBuilder::number_of_rejects ( ) const

Definition at line 260 of file routing_search.cc.


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