C++ Reference
C++ Reference: Routing
IntVarFilteredHeuristicabstract
Detailed Description
Public Member Functions | |
IntVarFilteredHeuristic (Solver *solver, const std::vector< IntVar * > &vars, LocalSearchFilterManager *filter_manager) | |
virtual | ~IntVarFilteredHeuristic () |
Assignment *const | BuildSolution () |
Builds a solution. More... | |
int64 | number_of_decisions () const |
Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters. More... | |
int64 | number_of_rejects () const |
virtual std::string | DebugString () const |
Protected Member Functions | |
void | ResetSolution () |
Resets the data members for a new solution. More... | |
virtual bool | InitializeSolution () |
Virtual method to initialize the solution. More... | |
virtual bool | BuildSolutionInternal ()=0 |
Virtual method to redefine how to build a solution. More... | |
bool | Commit () |
Commits the modifications to the current solution if these modifications are "filter-feasible", returns false otherwise; in any case discards all modifications. More... | |
virtual bool | StopSearch () |
Returns true if the search must be stopped. More... | |
void | SetValue (int64 index, int64 value) |
Modifies the current solution by setting the variable of index 'index' to value 'value'. More... | |
int64 | Value (int64 index) const |
Returns the value of the variable of index 'index' in the last committed solution. More... | |
bool | Contains (int64 index) const |
Returns true if the variable of index 'index' is in the current solution. More... | |
int | Size () const |
Returns the number of variables the decision builder is trying to instantiate. More... | |
IntVar * | Var (int64 index) const |
Returns the variable of index 'index'. More... | |
void | SynchronizeFilters () |
Synchronizes filters with an assignment (the current solution). More... | |
Protected Attributes | |
Assignment *const | assignment_ |
Constructor & Destructor Documentation
◆ IntVarFilteredHeuristic()
IntVarFilteredHeuristic | ( | Solver * | solver, |
const std::vector< IntVar * > & | vars, | ||
LocalSearchFilterManager * | filter_manager | ||
) |
◆ ~IntVarFilteredHeuristic()
|
inlinevirtual |
Member Function Documentation
◆ BuildSolution()
Assignment *const BuildSolution | ( | ) |
Builds a solution.
Returns the resulting assignment if a solution was found, and nullptr otherwise.
◆ BuildSolutionInternal()
|
protectedpure virtual |
Virtual method to redefine how to build a solution.
Implemented in GlobalCheapestInsertionFilteredHeuristic, LocalCheapestInsertionFilteredHeuristic, CheapestAdditionFilteredHeuristic, SavingsFilteredHeuristic, and ChristofidesFilteredHeuristic.
◆ Commit()
|
protected |
Commits the modifications to the current solution if these modifications are "filter-feasible", returns false otherwise; in any case discards all modifications.
◆ Contains()
|
inlineprotected |
◆ DebugString()
|
inlinevirtual |
◆ InitializeSolution()
|
inlineprotectedvirtual |
◆ number_of_decisions()
|
inline |
◆ number_of_rejects()
◆ ResetSolution()
|
protected |
Resets the data members for a new solution.
◆ SetValue()
|
inlineprotected |
◆ Size()
|
inlineprotected |
◆ StopSearch()
|
inlineprotectedvirtual |
Returns true if the search must be stopped.
Reimplemented in RoutingFilteredHeuristic.
◆ SynchronizeFilters()
|
protected |
Synchronizes filters with an assignment (the current solution).
◆ Value()
|
inlineprotected |
◆ Var()
|
inlineprotected |
Member Data Documentation
◆ assignment_
|
protected |
The documentation for this class was generated from the following file: