![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
The base class for all local search operators. A local search operator is an object that defines the neighborhood of a solution. In other words, a neighborhood is the set of solutions which can be reached from a given solution using an operator. The behavior of the LocalSearchOperator class is similar to iterators. The operator is synchronized with an assignment (gives the current values of the variables); this is done in the Start() method. Then one can iterate over the neighbors using the MakeNextNeighbor method. This method returns an assignment which represents the incremental changes to the current solution. It also returns a second assignment representing the changes to the last solution defined by the neighborhood operator; this assignment is empty if the neighborhood operator cannot track this information.
(user): rename Start to Synchronize ?
(user): decouple the iterating from the defining of a neighbor.
Definition at line 987 of file constraint_solveri.h.
#include <constraint_solveri.h>
Public Member Functions | |
LocalSearchOperator () | |
~LocalSearchOperator () override | |
virtual bool | MakeNextNeighbor (Assignment *delta, Assignment *deltadelta)=0 |
virtual void | EnterSearch () |
virtual void | Start (const Assignment *assignment)=0 |
virtual void | Reset () |
virtual const LocalSearchOperator * | Self () const |
virtual bool | HasFragments () const |
virtual bool | HoldsDelta () const |
Public Member Functions inherited from operations_research::BaseObject | |
BaseObject () | |
BaseObject (const BaseObject &)=delete | |
This type is neither copyable nor movable. | |
BaseObject & | operator= (const BaseObject &)=delete |
virtual | ~BaseObject ()=default |
virtual std::string | DebugString () const |
|
inline |
Definition at line 989 of file constraint_solveri.h.
|
inlineoverride |
Definition at line 990 of file constraint_solveri.h.
|
inlinevirtual |
Reimplemented in operations_research::PathOperator< ignore_path_vars >.
Definition at line 992 of file constraint_solveri.h.
|
inlinevirtual |
Reimplemented in operations_research::BaseLns, and operations_research::PathLns< ignore_path_vars >.
Definition at line 998 of file constraint_solveri.h.
|
inlinevirtual |
Reimplemented in operations_research::IntVarLocalSearchOperator, and operations_research::NeighborhoodLimit.
Definition at line 999 of file constraint_solveri.h.
|
pure virtual |
Implemented in operations_research::IndexPairSwapActiveOperator< ignore_path_vars >, operations_research::IntVarLocalSearchOperator, operations_research::NeighborhoodLimit, operations_research::PairNodeSwapActiveOperator< swap_first, ignore_path_vars >, and operations_research::SwapIndexPairOperator.
|
inlinevirtual |
Reimplemented in operations_research::PathOperator< ignore_path_vars >.
Definition at line 994 of file constraint_solveri.h.
|
inlinevirtual |
Definition at line 996 of file constraint_solveri.h.
|
pure virtual |
Implemented in operations_research::IntVarLocalSearchOperator, and operations_research::NeighborhoodLimit.