Generic filter-based heuristic applied to IntVars.
More...
Generic filter-based heuristic applied to IntVars.
Definition at line 218 of file routing_search.h.
#include <routing_search.h>

|
| void | ResetSolution () |
| | Resets the data members for a new solution.
|
| virtual void | Initialize () |
| | Initialize the heuristic; called before starting to build a new solution.
|
| virtual bool | InitializeSolution () |
| | Virtual method to initialize the solution.
|
| virtual bool | BuildSolutionInternal ()=0 |
| | Virtual method to redefine how to build a solution.
|
| std::optional< int64_t > | Evaluate (bool commit, bool ignore_upper_bound=false, bool update_upper_bound=true) |
| virtual bool | StopSearch () |
| | Returns true if the search must be stopped.
|
| void | SetValue (int64_t index, int64_t value) |
| const std::vector< int > & | delta_indices () const |
| | Returns the indices of the nodes currently in the insertion delta.
|
| int64_t | Value (int64_t index) const |
| bool | Contains (int64_t index) const |
| | Returns true if the variable of index 'index' is in the current solution.
|
| IntVar * | Var (int64_t index) const |
| | Returns the variable of index 'index'.
|
| int64_t | SecondaryVarIndex (int64_t index) const |
| | Returns the index of a secondary var.
|
| bool | HasSecondaryVars () const |
| | Returns true if there are secondary variables.
|
| bool | IsSecondaryVar (int64_t index) const |
| | Returns true if 'index' is a secondary variable index.
|
| void | SynchronizeFilters () |
| | Synchronizes filters with an assignment (the current solution).
|
| operations_research::IntVarFilteredHeuristic::IntVarFilteredHeuristic |
( |
Solver * | solver, |
|
|
const std::vector< IntVar * > & | vars, |
|
|
const std::vector< IntVar * > & | secondary_vars, |
|
|
LocalSearchFilterManager * | filter_manager ) |
◆ ~IntVarFilteredHeuristic()
| virtual operations_research::IntVarFilteredHeuristic::~IntVarFilteredHeuristic |
( |
| ) |
|
|
virtualdefault |
◆ BuildSolution()
| Assignment * operations_research::IntVarFilteredHeuristic::BuildSolution |
( |
| ) |
|
Builds a solution. Returns the resulting assignment if a solution was found, and nullptr otherwise.
Definition at line 497 of file routing_search.cc.
◆ BuildSolutionInternal()
| virtual bool operations_research::IntVarFilteredHeuristic::BuildSolutionInternal |
( |
| ) |
|
|
protectedpure virtual |
◆ Contains()
| bool operations_research::IntVarFilteredHeuristic::Contains |
( |
int64_t | index | ) |
const |
|
inlineprotected |
Returns true if the variable of index 'index' is in the current solution.
Definition at line 277 of file routing_search.h.
◆ DebugString()
| virtual std::string operations_research::IntVarFilteredHeuristic::DebugString |
( |
| ) |
const |
|
inlinevirtual |
◆ delta_indices()
| const std::vector< int > & operations_research::IntVarFilteredHeuristic::delta_indices |
( |
| ) |
const |
|
inlineprotected |
Returns the indices of the nodes currently in the insertion delta.
Definition at line 270 of file routing_search.h.
◆ Evaluate()
| std::optional< int64_t > operations_research::IntVarFilteredHeuristic::Evaluate |
( |
bool | commit, |
|
|
bool | ignore_upper_bound = false, |
|
|
bool | update_upper_bound = true ) |
|
protected |
Evaluates the modifications to the current solution. If these modifications are "filter-feasible" returns their corresponding cost computed by filters. If 'commit' is true, the modifications are committed to the current solution. In any case all modifications to the internal delta are cleared before returning.
Definition at line 542 of file routing_search.cc.
◆ HasSecondaryVars()
| bool operations_research::IntVarFilteredHeuristic::HasSecondaryVars |
( |
| ) |
const |
|
inlineprotected |
Returns true if there are secondary variables.
Definition at line 288 of file routing_search.h.
◆ Initialize()
| virtual void operations_research::IntVarFilteredHeuristic::Initialize |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ InitializeSolution()
| virtual bool operations_research::IntVarFilteredHeuristic::InitializeSolution |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ IsSecondaryVar()
| bool operations_research::IntVarFilteredHeuristic::IsSecondaryVar |
( |
int64_t | index | ) |
const |
|
inlineprotected |
Returns true if 'index' is a secondary variable index.
Definition at line 290 of file routing_search.h.
◆ number_of_decisions()
| int64_t operations_research::IntVarFilteredHeuristic::number_of_decisions |
( |
| ) |
const |
|
inline |
Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters.
Definition at line 232 of file routing_search.h.
◆ number_of_rejects()
| int64_t operations_research::IntVarFilteredHeuristic::number_of_rejects |
( |
| ) |
const |
|
inline |
◆ ResetSolution()
| void operations_research::IntVarFilteredHeuristic::ResetSolution |
( |
| ) |
|
|
protected |
◆ SecondaryVarIndex()
| int64_t operations_research::IntVarFilteredHeuristic::SecondaryVarIndex |
( |
int64_t | index | ) |
const |
|
inlineprotected |
◆ SetValue()
| void operations_research::IntVarFilteredHeuristic::SetValue |
( |
int64_t | index, |
|
|
int64_t | value ) |
|
inlineprotected |
Modifies the current solution by setting the variable of index 'index' to value 'value'.
Definition at line 259 of file routing_search.h.
◆ StopSearch()
| virtual bool operations_research::IntVarFilteredHeuristic::StopSearch |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ SynchronizeFilters()
| void operations_research::IntVarFilteredHeuristic::SynchronizeFilters |
( |
| ) |
|
|
protected |
Synchronizes filters with an assignment (the current solution).
Definition at line 591 of file routing_search.cc.
◆ Value()
| int64_t operations_research::IntVarFilteredHeuristic::Value |
( |
int64_t | index | ) |
const |
|
inlineprotected |
Returns the value of the variable of index 'index' in the last committed solution.
Definition at line 273 of file routing_search.h.
◆ Var()
| IntVar * operations_research::IntVarFilteredHeuristic::Var |
( |
int64_t | index | ) |
const |
|
inlineprotected |
◆ assignment_
|
Assignment* const operations_research::IntVarFilteredHeuristic::assignment_
|
protected |
The documentation for this class was generated from the following files: