![]() |
OR-Tools
8.2
|
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.
Definition at line 798 of file constraint_solveri.h.
Public Member Functions | |
LocalSearchOperator () | |
~LocalSearchOperator () override | |
virtual bool | MakeNextNeighbor (Assignment *delta, Assignment *deltadelta)=0 |
virtual void | Start (const Assignment *assignment)=0 |
virtual void | Reset () |
virtual const LocalSearchOperator * | Self () const |
virtual bool | HasFragments () const |
virtual bool | HoldsDelta () const |
virtual std::string | DebugString () const |
|
inline |
Definition at line 800 of file constraint_solveri.h.
|
inlineoverride |
Definition at line 801 of file constraint_solveri.h.
|
inlinevirtualinherited |
Reimplemented in SymmetryManager, ExchangeSubtrip, RelocateSubtrip, PairNodeSwapActiveOperator< swap_first >, RelocateExpensiveChain, FilteredHeuristicCloseNodesLNSOperator, FilteredHeuristicExpensiveChainLNSOperator, RelocatePathAndHeuristicInsertUnperformedOperator, FilteredHeuristicPathLNSOperator, IndexPairSwapActiveOperator, SwapIndexPairOperator, PairExchangeRelocateOperator, PairExchangeOperator, LightPairRelocateOperator, PairRelocateOperator, MakePairInactiveOperator, MakePairActiveOperator, MakeRelocateNeighborsOperator, CPFeasibilityFilter, IntVarFilteredDecisionBuilder, GlobalVehicleBreaksConstraint, Dimension, LocalSearchPhaseParameters, FindOneNeighbor, LocalSearchProfiler, NeighborhoodLimit, PathLns, LinKernighan, TSPLns, TSPOpt, ExtendedSwapActiveOperator, SwapActiveOperator, MakeChainInactiveOperator, RelocateAndMakeInactiveOperator, MakeInactiveOperator, MakeActiveAndRelocate, RelocateAndMakeActiveOperator, MakeActiveOperator, Cross, Exchange, Relocate, TwoOpt, PiecewiseLinearExpr, IfThenElseCt, DemonProfiler, ArrayWithOffset< T >, SearchLog, BooleanVar, LocalSearchMonitor, PropagationMonitor, LocalSearchFilterManager, 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, DecisionBuilder, Decision, PropagationBaseObject, LocalSearchMonitorMaster, and Trace.
Definition at line 3156 of file constraint_solver.h.
|
inlinevirtual |
Reimplemented in PathLns, and BaseLns.
Definition at line 808 of file constraint_solveri.h.
|
inlinevirtual |
Reimplemented in NeighborhoodLimit, VarLocalSearchOperator< V, Val, Handler >, and VarLocalSearchOperator< IntVar, int64, IntVarLocalSearchHandler >.
Definition at line 809 of file constraint_solveri.h.
|
pure virtual |
|
inlinevirtual |
Reimplemented in PathOperator.
Definition at line 804 of file constraint_solveri.h.
|
inlinevirtual |
Definition at line 806 of file constraint_solveri.h.
|
pure virtual |