![]() |
OR-Tools
9.6
|
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 368 of file routing_neighborhoods.h.
Public Member Functions | |
| SwapIndexPairOperator (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &path_vars, std::function< int(int64_t)> start_empty_path_class, const RoutingIndexPairs &index_pairs) | |
| ~SwapIndexPairOperator () override | |
| bool | MakeNextNeighbor (Assignment *delta, Assignment *deltadelta) override |
| OnStart() should really be protected, but then SWIG doesn't see it. More... | |
| void | OnStart () override |
| Called by Start() after synchronizing the operator with the current assignment. More... | |
| std::string | DebugString () const 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 | Reset () |
| virtual const LocalSearchOperator * | Self () const |
| virtual bool | HasFragments () const |
Protected Member Functions | |
| virtual bool | MakeOneNeighbor () |
| Creates a new neighbor. More... | |
| 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 |
| SwapIndexPairOperator | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | path_vars, | ||
| std::function< int(int64_t)> | start_empty_path_class, | ||
| const RoutingIndexPairs & | index_pairs | ||
| ) |
Definition at line 677 of file routing_neighborhoods.cc.
|
inlineoverride |
Definition at line 374 of file routing_neighborhoods.h.
|
inlineinherited |
Definition at line 1111 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 1108 of file constraint_solveri.h.
|
inlineprotectedinherited |
Definition at line 1188 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 1149 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 1114 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 1112 of file constraint_solveri.h.
|
inlineoverridevirtual |
Reimplemented from BaseObject.
Definition at line 378 of file routing_neighborhoods.h.
|
inlinevirtualinherited |
Reimplemented in PathLns, and BaseLns.
Definition at line 922 of file constraint_solveri.h.
|
inlineoverridevirtualinherited |
Reimplemented from LocalSearchOperator.
Definition at line 1066 of file constraint_solveri.h.
|
inlineprotectedinherited |
Definition at line 1181 of file constraint_solveri.h.
|
inlinevirtualinherited |
Reimplemented in TwoOpt.
Definition at line 1089 of file constraint_solveri.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 IntVarLocalSearchOperator.
Definition at line 693 of file routing_neighborhoods.cc.
|
protectedvirtualinherited |
Creates a new neighbor.
It returns false when the neighborhood is completely explored. MakeNextNeighbor() in a subclass of IntVarLocalSearchOperator.
Reimplemented in RelocateExpensiveChain, MakePairActiveOperator, TSPLns, BaseInactiveNodeToPathOperator, PathOperator, ChangeValue, and BaseLns.
Definition at line 100 of file local_search.cc.
|
inlineprotectedinherited |
Definition at line 1184 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 1101 of file constraint_solveri.h.
|
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 IntVarLocalSearchOperator.
Definition at line 747 of file routing_neighborhoods.cc.
|
inlineinherited |
Definition at line 1102 of file constraint_solveri.h.
|
inlinevirtualinherited |
Reimplemented in PathOperator.
Definition at line 918 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 1138 of file constraint_solveri.h.
|
inlinevirtualinherited |
Definition at line 920 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 1105 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 1091 of file constraint_solveri.h.
|
inlinevirtualinherited |
Reimplemented in PathOperator.
Definition at line 1100 of file constraint_solveri.h.
|
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.
|
inlineinherited |
Returns the value in the current assignment of the variable of given index.
Definition at line 1094 of file constraint_solveri.h.
|
inlineinherited |
Returns the variable of given index.
Definition at line 1099 of file constraint_solveri.h.