![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
Operator which iterates through each alternative of a set of pairs. If a pair has n and m alternatives, n.m alternatives will be explored. Possible neighbors for the path 1 -> A -> a -> 2 (where (1, 2) are first and last nodes of a path and A has B, C as alternatives and a has b as alternative): 1 -> A -> [b] -> 2 1 -> [B] -> a -> 2 1 -> [B] -> [b] -> 2 1 -> [C] -> a -> 2 1 -> [C] -> [b] -> 2
Definition at line 548 of file routing_neighborhoods.h.
#include <routing_neighborhoods.h>
Public Member Functions | |
| SwapIndexPairOperator (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &path_vars, const std::vector< PickupDeliveryPair > &pairs) | |
| ~SwapIndexPairOperator () override=default | |
| bool | MakeNextNeighbor (Assignment *delta, Assignment *deltadelta) override |
| void | OnStart () override |
| std::string | DebugString () const override |
| Public Member Functions inherited from operations_research::IntVarLocalSearchOperator | |
| IntVarLocalSearchOperator (const std::vector< IntVar * > &vars, bool keep_inverse_values=false) | |
| ~IntVarLocalSearchOperator () override | |
| bool | HoldsDelta () const override |
| void | Start (const Assignment *assignment) override |
| virtual bool | IsIncremental () const |
| int | Size () const |
| int64_t | Value (int64_t index) const |
| IntVar * | Var (int64_t index) const |
| Returns the variable of given index. | |
| virtual bool | SkipUnchanged (int) 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) |
| Public Member Functions inherited from operations_research::LocalSearchOperator | |
| LocalSearchOperator () | |
| ~LocalSearchOperator () override | |
| virtual void | EnterSearch () |
| virtual void | Reset () |
| virtual const LocalSearchOperator * | Self () const |
| virtual bool | HasFragments () const |
| Public Member Functions inherited from operations_research::BaseObject | |
| BaseObject () | |
| BaseObject (const BaseObject &)=delete | |
| BaseObject & | operator= (const BaseObject &)=delete |
| virtual | ~BaseObject ()=default |
Additional Inherited Members | |
| Protected Member Functions inherited from operations_research::IntVarLocalSearchOperator | |
| virtual bool | MakeOneNeighbor () |
| MakeNextNeighbor() in a subclass of IntVarLocalSearchOperator. | |
| 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 |
| operations_research::SwapIndexPairOperator::SwapIndexPairOperator | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | path_vars, | ||
| const std::vector< PickupDeliveryPair > & | pairs ) |
Definition at line 1112 of file routing_neighborhoods.cc.
|
overridedefault |
|
inlineoverridevirtual |
Reimplemented from operations_research::BaseObject.
Definition at line 557 of file routing_neighborhoods.h.
|
overridevirtual |
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.
Reimplemented from operations_research::IntVarLocalSearchOperator.
Definition at line 1127 of file routing_neighborhoods.cc.
|
overridevirtual |
Called by Start() after synchronizing the operator with the current assignment. Should be overridden instead of Start() to avoid calling IntVarLocalSearchOperator::Start explicitly.
Reimplemented from operations_research::IntVarLocalSearchOperator.
Definition at line 1183 of file routing_neighborhoods.cc.