![]() |
OR-Tools
9.6
|
Filtered-base decision builder based on the addition heuristic, extending a path from its start node with the cheapest arc.
Definition at line 957 of file routing_search.h.
Public Member Functions | |
| CheapestAdditionFilteredHeuristic (RoutingModel *model, std::function< bool()> stop_search, LocalSearchFilterManager *filter_manager) | |
| ~CheapestAdditionFilteredHeuristic () override=default | |
| bool | BuildSolutionInternal () override |
| Virtual method to redefine how to build a solution. More... | |
| const Assignment * | BuildSolutionFromRoutes (const std::function< int64_t(int64_t)> &next_accessor) |
| Builds a solution starting from the routes formed by the next accessor. More... | |
| RoutingModel * | model () const |
| int | GetStartChainEnd (int vehicle) const |
| Returns the end of the start chain of vehicle,. More... | |
| int | GetEndChainStart (int vehicle) const |
| Returns the start of the end chain of vehicle,. More... | |
| void | MakeDisjunctionNodesUnperformed (int64_t node) |
| Make nodes in the same disjunction as 'node' unperformed. More... | |
| bool | MakeUnassignedNodesUnperformed () |
| Make all unassigned nodes unperformed, always returns true. More... | |
| void | MakePartiallyPerformedPairsUnperformed () |
| Make all partially performed pickup and delivery pairs unperformed. More... | |
| Assignment *const | BuildSolution () |
| Builds a solution. More... | |
| int64_t | number_of_decisions () const |
| Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters. More... | |
| int64_t | number_of_rejects () const |
| virtual std::string | DebugString () const |
Protected Member Functions | |
| bool | StopSearch () override |
| Returns true if the search must be stopped. More... | |
| virtual void | SetVehicleIndex (int64_t, int) |
| virtual void | ResetVehicleIndices () |
| bool | VehicleIsEmpty (int vehicle) const |
| void | ResetSolution () |
| Resets the data members for a new solution. More... | |
| virtual void | Initialize () |
| Initialize the heuristic; called before starting to build a new solution. More... | |
| std::optional< int64_t > | Evaluate (bool commit) |
| Evaluates the modifications to the current solution. More... | |
| void | SetValue (int64_t index, int64_t value) |
| Modifies the current solution by setting the variable of index 'index' to value 'value'. More... | |
| int64_t | Value (int64_t index) const |
| Returns the value of the variable of index 'index' in the last committed solution. More... | |
| bool | Contains (int64_t 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_t index) const |
| Returns the variable of index 'index'. More... | |
| int64_t | SecondaryVarIndex (int64_t index) const |
| Returns the index of a secondary var. More... | |
| bool | HasSecondaryVars () const |
| Returns true if there are secondary variables. More... | |
| bool | IsSecondaryVar (int64_t index) const |
| Returns true if 'index' is a secondary variable index. More... | |
| void | SynchronizeFilters () |
| Synchronizes filters with an assignment (the current solution). More... | |
Protected Attributes | |
| Assignment *const | assignment_ |
| CheapestAdditionFilteredHeuristic | ( | RoutingModel * | model, |
| std::function< bool()> | stop_search, | ||
| LocalSearchFilterManager * | filter_manager | ||
| ) |
Definition at line 2598 of file routing_search.cc.
|
overridedefault |
|
inherited |
Builds a solution.
Returns the resulting assignment if a solution was found, and nullptr otherwise.
Definition at line 303 of file routing_search.cc.
|
inherited |
Builds a solution starting from the routes formed by the next accessor.
Definition at line 316 of file routing_search.cc.
|
overridevirtual |
Virtual method to redefine how to build a solution.
Implements IntVarFilteredHeuristic.
Definition at line 2603 of file routing_search.cc.
|
inlineprotectedinherited |
Returns true if the variable of index 'index' is in the current solution.
Definition at line 226 of file routing_search.h.
|
inlinevirtualinherited |
Reimplemented in ChristofidesFilteredHeuristic, ParallelSavingsFilteredHeuristic, SequentialSavingsFilteredHeuristic, ComparatorCheapestAdditionFilteredHeuristic, EvaluatorCheapestAdditionFilteredHeuristic, LocalCheapestInsertionFilteredHeuristic, and GlobalCheapestInsertionFilteredHeuristic.
Definition at line 188 of file routing_search.h.
|
protectedinherited |
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 353 of file routing_search.cc.
|
inlineinherited |
Returns the start of the end chain of vehicle,.
Definition at line 282 of file routing_search.h.
|
inlineinherited |
Returns the end of the start chain of vehicle,.
Definition at line 280 of file routing_search.h.
|
inlineprotectedinherited |
Returns true if there are secondary variables.
Definition at line 240 of file routing_search.h.
|
inlineprotectedvirtualinherited |
Initialize the heuristic; called before starting to build a new solution.
Reimplemented in LocalCheapestInsertionFilteredHeuristic.
Definition at line 194 of file routing_search.h.
|
inlineprotectedinherited |
Returns true if 'index' is a secondary variable index.
Definition at line 242 of file routing_search.h.
|
inherited |
Make nodes in the same disjunction as 'node' unperformed.
'node' is a variable index corresponding to a node.
Definition at line 477 of file routing_search.cc.
|
inherited |
Make all partially performed pickup and delivery pairs unperformed.
A pair is partially unperformed if one element of the pair has one of its alternatives performed in the solution and the other has no alternatives in the solution or none performed.
Definition at line 499 of file routing_search.cc.
|
inherited |
Make all unassigned nodes unperformed, always returns true.
Definition at line 486 of file routing_search.cc.
|
inlineinherited |
Definition at line 278 of file routing_search.h.
|
inlineinherited |
Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters.
Definition at line 185 of file routing_search.h.
|
inlineinherited |
Definition at line 186 of file routing_search.h.
|
protectedinherited |
Resets the data members for a new solution.
Definition at line 293 of file routing_search.cc.
|
inlineprotectedvirtualinherited |
Definition at line 297 of file routing_search.h.
|
inlineprotectedinherited |
Returns the index of a secondary var.
Definition at line 235 of file routing_search.h.
|
inlineprotectedinherited |
Modifies the current solution by setting the variable of index 'index' to value 'value'.
Definition at line 211 of file routing_search.h.
|
inlineprotectedvirtualinherited |
Definition at line 296 of file routing_search.h.
|
inlineprotectedinherited |
Returns the number of variables the decision builder is trying to instantiate.
Definition at line 231 of file routing_search.h.
|
inlineoverrideprotectedvirtualinherited |
Returns true if the search must be stopped.
Reimplemented from IntVarFilteredHeuristic.
Definition at line 295 of file routing_search.h.
|
protectedinherited |
Synchronizes filters with an assignment (the current solution).
Definition at line 396 of file routing_search.cc.
|
inlineprotectedinherited |
Returns the value of the variable of index 'index' in the last committed solution.
Definition at line 222 of file routing_search.h.
|
inlineprotectedinherited |
Returns the variable of index 'index'.
Definition at line 233 of file routing_search.h.
|
inlineprotectedinherited |
Definition at line 298 of file routing_search.h.
|
protectedinherited |
Definition at line 246 of file routing_search.h.