C++ Reference
C++ Reference: Routing
Detailed Description
Class of operators using a RoutingFilteredHeuristic to insert unperformed nodes after changes have been made to the current solution.
Definition at line 432 of file routing_neighborhoods.h.
Public Member Functions | |
| FilteredHeuristicLocalSearchOperator (std::unique_ptr< RoutingFilteredHeuristic > heuristic, bool keep_inverse_values=false) | |
| ~FilteredHeuristicLocalSearchOperator () override | |
| bool | HoldsDelta () const override |
| void | Start (const Assignment *assignment) override |
| This method should not be overridden. More... | |
| virtual bool | IsIncremental () const |
| int | Size () const |
| int64_t | Value (int64_t index) const |
| Returns the value in the current assignment of the variable of given index. More... | |
| IntVar * | Var (int64_t index) const |
| Returns the variable of given index. More... | |
| virtual bool | SkipUnchanged (int index) const |
| int64_t | OldValue (int64_t index) const |
| int64_t | PrevValue (int64_t index) const |
| void | SetValue (int64_t index, int64_t value) |
| bool | Activated (int64_t index) const |
| void | Activate (int64_t index) |
| void | Deactivate (int64_t index) |
| bool | ApplyChanges (Assignment *delta, Assignment *deltadelta) const |
| void | RevertChanges (bool change_was_incremental) |
| void | AddVars (const std::vector< IntVar * > &vars) |
| virtual void | OnStart () |
| Called by Start() after synchronizing the operator with the current assignment. More... | |
| bool | MakeNextNeighbor (Assignment *delta, Assignment *deltadelta) override |
| OnStart() should really be protected, but then SWIG doesn't see it. More... | |
| virtual void | Reset () |
| virtual const LocalSearchOperator * | Self () const |
| virtual bool | HasFragments () const |
| virtual std::string | DebugString () const |
Protected Member Functions | |
| virtual bool | IncrementPosition ()=0 |
| virtual std::function< int64_t(int64_t)> | SetupNextAccessorForNeighbor ()=0 |
| Virtual method to return the next_accessor to be passed to the heuristic to build a new solution. More... | |
| std::string | HeuristicName () const |
| int64_t | InverseValue (int64_t index) const |
| int64_t | OldInverseValue (int64_t index) const |
| void | AddToAssignment (IntVar *var, int64_t value, bool active, std::vector< int > *assignment_indices, int64_t index, Assignment *assignment) const |
Protected Attributes | |
| RoutingModel *const | model_ |
| SparseBitset | removed_nodes_ |
| Keeps track of removed nodes when making a neighbor. More... | |
Constructor & Destructor Documentation
◆ FilteredHeuristicLocalSearchOperator()
|
explicit |
◆ ~FilteredHeuristicLocalSearchOperator()
|
inlineoverride |
Definition at line 437 of file routing_neighborhoods.h.
Member Function Documentation
◆ Activate()
|
inlineinherited |
Definition at line 1111 of file constraint_solveri.h.
◆ Activated()
|
inlineinherited |
Definition at line 1108 of file constraint_solveri.h.
◆ AddToAssignment()
|
inlineprotectedinherited |
Definition at line 1188 of file constraint_solveri.h.
◆ AddVars()
|
inlineinherited |
Definition at line 1149 of file constraint_solveri.h.
◆ ApplyChanges()
|
inlineinherited |
Definition at line 1114 of file constraint_solveri.h.
◆ Deactivate()
|
inlineinherited |
Definition at line 1112 of file constraint_solveri.h.
◆ DebugString()
|
inlinevirtualinherited |
Reimplemented in ExchangeSubtrip, RelocateSubtrip, PairNodeSwapActiveOperator< swap_first >, RelocateExpensiveChain, FilteredHeuristicCloseNodesLNSOperator, FilteredHeuristicExpensiveChainLNSOperator, RelocatePathAndHeuristicInsertUnperformedOperator, FilteredHeuristicPathLNSOperator, IndexPairSwapActiveOperator, SwapIndexPairOperator, PairExchangeRelocateOperator, PairExchangeOperator, LightPairRelocateOperator, GroupPairAndRelocateOperator, PairRelocateOperator, MakePairInactiveOperator, MakePairActiveOperator, SwapActiveToShortestPathOperator, MakeRelocateNeighborsOperator, GlobalVehicleBreaksConstraint, ArrayWithOffset< T >, SearchLog, BooleanVar, LocalSearchMonitor, PropagationMonitor, LocalSearchFilterManager, LightIntIntFunctionElementCt< F >, LightIntFunctionElementCt< F >, DelayedCallMethod2< T, P, Q >, DelayedCallMethod1< T, P >, DelayedCallMethod0< T >, CallMethod3< T, P, Q, R >, CallMethod2< T, P, Q >, CallMethod1< T, P >, CallMethod0< T >, Pack, Assignment, SequenceVar, RegularLimit, SearchLimit, OptimizeVar, SolutionCollector, IntVarIterator, Constraint, Demon, ProfiledDecisionBuilder, DecisionBuilder, Decision, and PropagationBaseObject.
Definition at line 3251 of file constraint_solver.h.
◆ HasFragments()
|
inlinevirtualinherited |
Reimplemented in BaseLns.
Definition at line 922 of file constraint_solveri.h.
◆ HeuristicName()
|
inlineprotected |
Definition at line 446 of file routing_neighborhoods.h.
◆ HoldsDelta()
|
inlineoverridevirtualinherited |
Reimplemented from LocalSearchOperator.
Definition at line 1066 of file constraint_solveri.h.
◆ IncrementPosition()
|
protectedpure virtual |
◆ InverseValue()
|
inlineprotectedinherited |
Definition at line 1181 of file constraint_solveri.h.
◆ IsIncremental()
|
inlinevirtualinherited |
Definition at line 1089 of file constraint_solveri.h.
◆ MakeNextNeighbor()
|
overridevirtualinherited |
OnStart() should really be protected, but then SWIG doesn't see it.
So we make it public, but only subclasses should access to it (to override it). Redefines MakeNextNeighbor to export a simpler interface. The calls to ApplyChanges() and RevertChanges() are factored in this method, hiding both delta and deltadelta from subclasses which only need to override MakeOneNeighbor(). Therefore this method should not be overridden. Override MakeOneNeighbor() instead.
Implements LocalSearchOperator.
Reimplemented in PairNodeSwapActiveOperator< swap_first >, IndexPairSwapActiveOperator, and SwapIndexPairOperator.
◆ OldInverseValue()
|
inlineprotectedinherited |
Definition at line 1184 of file constraint_solveri.h.
◆ OldValue()
|
inlineinherited |
Definition at line 1101 of file constraint_solveri.h.
◆ OnStart()
|
inlinevirtualinherited |
Called by Start() after synchronizing the operator with the current assignment.
Should be overridden instead of Start() to avoid calling IntVarLocalSearchOperator::Start explicitly.
Reimplemented in SwapIndexPairOperator.
Definition at line 1161 of file constraint_solveri.h.
◆ PrevValue()
|
inlineinherited |
Definition at line 1102 of file constraint_solveri.h.
◆ Reset()
|
inlinevirtualinherited |
Reimplemented in PathOperator.
Definition at line 918 of file constraint_solveri.h.
◆ RevertChanges()
|
inlineinherited |
Definition at line 1138 of file constraint_solveri.h.
◆ Self()
|
inlinevirtualinherited |
Definition at line 920 of file constraint_solveri.h.
◆ SetupNextAccessorForNeighbor()
|
protectedpure virtual |
Virtual method to return the next_accessor to be passed to the heuristic to build a new solution.
This method should also correctly set the nodes being removed (if any) in removed_nodes_.
◆ SetValue()
|
inlineinherited |
Definition at line 1105 of file constraint_solveri.h.
◆ Size()
|
inlineinherited |
Definition at line 1091 of file constraint_solveri.h.
◆ SkipUnchanged()
|
inlinevirtualinherited |
Reimplemented in PathOperator.
Definition at line 1100 of file constraint_solveri.h.
◆ Start()
|
inlineoverridevirtualinherited |
This method should not be overridden.
Override OnStart() instead which is called before exiting this method.
Implements LocalSearchOperator.
Definition at line 1069 of file constraint_solveri.h.
◆ Value()
|
inlineinherited |
Returns the value in the current assignment of the variable of given index.
Definition at line 1094 of file constraint_solveri.h.
◆ Var()
|
inlineinherited |
Returns the variable of given index.
Definition at line 1099 of file constraint_solveri.h.
Member Data Documentation
◆ model_
|
protected |
Definition at line 462 of file routing_neighborhoods.h.
◆ removed_nodes_
|
protected |
Keeps track of removed nodes when making a neighbor.
Definition at line 464 of file routing_neighborhoods.h.
The documentation for this class was generated from the following file: