OR-Tools  8.2
LocalSearchOperatorabstract

Detailed Description

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 LocalSearchOperatorSelf () const
 
virtual bool HasFragments () const
 
virtual bool HoldsDelta () const
 
virtual std::string DebugString () const
 

Constructor & Destructor Documentation

◆ LocalSearchOperator()

LocalSearchOperator ( )
inline

Definition at line 800 of file constraint_solveri.h.

◆ ~LocalSearchOperator()

~LocalSearchOperator ( )
inlineoverride

Definition at line 801 of file constraint_solveri.h.

Member Function Documentation

◆ DebugString()

virtual std::string DebugString ( ) const
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.

◆ HasFragments()

virtual bool HasFragments ( ) const
inlinevirtual

Reimplemented in PathLns, and BaseLns.

Definition at line 808 of file constraint_solveri.h.

◆ HoldsDelta()

virtual bool HoldsDelta ( ) const
inlinevirtual

◆ MakeNextNeighbor()

virtual bool MakeNextNeighbor ( Assignment delta,
Assignment deltadelta 
)
pure virtual

◆ Reset()

virtual void Reset ( )
inlinevirtual

Reimplemented in PathOperator.

Definition at line 804 of file constraint_solveri.h.

◆ Self()

virtual const LocalSearchOperator* Self ( ) const
inlinevirtual

Definition at line 806 of file constraint_solveri.h.

◆ Start()


The documentation for this class was generated from the following file: