Specialization of LocalSearchOperator built from an array of IntVars which specifies the scope of the operator. More...
#include <constraint_solveri.h>


Public Member Functions | |
| IntVarLocalSearchOperator () | |
| IntVarLocalSearchOperator (const std::vector< IntVar * > &vars) | |
| ~IntVarLocalSearchOperator () override | |
| bool | MakeNextNeighbor (Assignment *delta, Assignment *deltadelta) override |
| Redefines MakeNextNeighbor to export a simpler interface. More... | |
| bool | HoldsDelta () const override |
| void | Start (const Assignment *assignment) override |
| This method should not be overridden. More... | |
| virtual bool | IsIncremental () const |
| int | Size () const |
| const int64 & | Value (int64 index) const |
| Returns the value in the current assignment of the variable of given index. More... | |
| IntVar * | Var (int64 index) const |
| Returns the variable of given index. More... | |
| virtual bool | SkipUnchanged (int index) const |
| const int64 & | OldValue (int64 index) const |
| void | SetValue (int64 index, const int64 &value) |
| bool | Activated (int64 index) const |
| void | Activate (int64 index) |
| void | Deactivate (int64 index) |
| bool | ApplyChanges (Assignment *delta, Assignment *deltadelta) const |
| void | RevertChanges (bool incremental) |
| void | AddVars (const std::vector< IntVar * > &vars) |
| virtual void | OnStart () |
| Called by Start() after synchronizing the operator with the current assignment. More... | |
| virtual void | Reset () |
| virtual const LocalSearchOperator * | Self () const |
| virtual bool | HasFragments () const |
| virtual std::string | DebugString () const |
Protected Member Functions | |
| virtual bool | MakeOneNeighbor () |
| Creates a new neighbor. More... | |
| void | MarkChange (int64 index) |
| OnStart() should really be protected, but then SWIG doesn't see it. More... | |
Protected Attributes | |
| std::vector< IntVar * > | vars_ |
| std::vector< int64 > | values_ |
| std::vector< int64 > | old_values_ |
| std::vector< int64 > | prev_values_ |
| std::vector< int > | assignment_indices_ |
| Bitset64 | activated_ |
| Bitset64 | was_activated_ |
| SparseBitset | changes_ |
| SparseBitset | delta_changes_ |
| bool | cleared_ |
| IntVarLocalSearchHandler | var_handler_ |
Specialization of LocalSearchOperator built from an array of IntVars which specifies the scope of the operator.
This class also takes care of storing current variable values in Start(), keeps track of changes done by the operator and builds the delta. The Deactivate() method can be used to perform Large Neighborhood Search.
Definition at line 1042 of file constraint_solveri.h.
|
inline |
Definition at line 1045 of file constraint_solveri.h.
|
inlineexplicit |
Definition at line 1046 of file constraint_solveri.h.
|
inlineoverride |
Definition at line 1051 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 871 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 870 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 916 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 879 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 875 of file constraint_solveri.h.
|
inlinevirtualinherited |
Reimplemented in operations_research::Pack, operations_research::Assignment, operations_research::SequenceVar, operations_research::RegularLimit, operations_research::SearchLimit, operations_research::OptimizeVar, operations_research::SolutionCollector, operations_research::IntVarIterator, operations_research::Constraint, operations_research::Demon, operations_research::DecisionBuilder, operations_research::Decision, operations_research::PropagationBaseObject, operations_research::ArrayWithOffset< T >, operations_research::SearchLog, operations_research::BooleanVar, operations_research::LocalSearchMonitor, operations_research::PropagationMonitor, operations_research::LocalSearchFilterManager, operations_research::PathWithPreviousNodesOperator, operations_research::DelayedCallMethod2< T, P, Q >, operations_research::DelayedCallMethod1< T, P >, operations_research::DelayedCallMethod0< T >, operations_research::CallMethod3< T, P, Q, R >, operations_research::CallMethod2< T, P, Q >, operations_research::CallMethod1< T, P >, operations_research::ExchangeSubtrip, operations_research::CallMethod0< T >, operations_research::RelocateSubtrip, operations_research::PairNodeSwapActiveOperator< swap_first >, operations_research::RelocateExpensiveChain, operations_research::IndexPairSwapActiveOperator, operations_research::SwapIndexPairOperator, operations_research::PairExchangeRelocateOperator, operations_research::PairExchangeOperator, operations_research::LightPairRelocateOperator, operations_research::PairRelocateOperator, operations_research::MakePairInactiveOperator, operations_research::MakePairActiveOperator, and operations_research::MakeRelocateNeighborsOperator.
Definition at line 3138 of file constraint_solver.h.
|
inlinevirtualinherited |
Reimplemented in operations_research::BaseLns.
Definition at line 823 of file constraint_solveri.h.
|
inlineoverridevirtualinherited |
Reimplemented from operations_research::LocalSearchOperator.
Definition at line 839 of file constraint_solveri.h.
|
inlinevirtualinherited |
Definition at line 855 of file constraint_solveri.h.
|
overridevirtual |
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.
Implements operations_research::LocalSearchOperator.
Reimplemented in operations_research::PairNodeSwapActiveOperator< swap_first >, operations_research::IndexPairSwapActiveOperator, operations_research::SwapIndexPairOperator, and operations_research::MakePairActiveOperator.
|
protectedvirtual |
Creates a new neighbor.
It returns false when the neighborhood is completely explored.
Reimplemented in operations_research::PathOperator, operations_research::ChangeValue, operations_research::BaseLns, and operations_research::RelocateExpensiveChain.
|
inlineprotectedinherited |
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).
Definition at line 940 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 865 of file constraint_solveri.h.
|
inlinevirtualinherited |
Called by Start() after synchronizing the operator with the current assignment.
Should be overridden instead of Start() to avoid calling VarLocalSearchOperator::Start explicitly.
Reimplemented in operations_research::SwapIndexPairOperator.
Definition at line 935 of file constraint_solveri.h.
|
inlinevirtualinherited |
Reimplemented in operations_research::PathOperator.
Definition at line 819 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 903 of file constraint_solveri.h.
|
inlinevirtualinherited |
Definition at line 821 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 866 of file constraint_solveri.h.
|
inlineinherited |
Definition at line 856 of file constraint_solveri.h.
|
inlinevirtualinherited |
Reimplemented in operations_research::PathOperator.
Definition at line 864 of file constraint_solveri.h.
|
inlineoverridevirtualinherited |
This method should not be overridden.
Override OnStart() instead which is called before exiting this method.
Implements operations_research::LocalSearchOperator.
Definition at line 842 of file constraint_solveri.h.
|
inlineinherited |
Returns the value in the current assignment of the variable of given index.
Definition at line 858 of file constraint_solveri.h.
|
inlineinherited |
Returns the variable of given index.
Definition at line 863 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 950 of file constraint_solveri.h.
|
mutableprotectedinherited |
Definition at line 949 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 952 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 954 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 953 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 947 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 948 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 946 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 955 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 945 of file constraint_solveri.h.
|
protectedinherited |
Definition at line 951 of file constraint_solveri.h.