C++ Reference
C++ Reference: Routing
Detailed Description
template<class V, class Val, class Handler>
class operations_research::VarLocalSearchOperator< V, Val, Handler >
Base operator class for operators manipulating variables.
Definition at line 821 of file constraint_solveri.h.
Public Member Functions | |
VarLocalSearchOperator () | |
VarLocalSearchOperator (Handler var_handler) | |
~VarLocalSearchOperator () 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 |
const Val & | Value (int64 index) const |
Returns the value in the current assignment of the variable of given index. More... | |
V * | Var (int64 index) const |
Returns the variable of given index. More... | |
virtual bool | SkipUnchanged (int index) const |
const Val & | OldValue (int64 index) const |
void | SetValue (int64 index, const Val &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< V * > &vars) |
virtual void | OnStart () |
Called by Start() after synchronizing the operator with the current assignment. More... | |
virtual bool | MakeNextNeighbor (Assignment *delta, Assignment *deltadelta)=0 |
virtual void | Reset () |
virtual const LocalSearchOperator * | Self () const |
virtual bool | HasFragments () const |
Protected Member Functions | |
void | MarkChange (int64 index) |
OnStart() should really be protected, but then SWIG doesn't see it. More... | |
Protected Attributes | |
std::vector< V * > | vars_ |
std::vector< Val > | values_ |
std::vector< Val > | old_values_ |
std::vector< Val > | prev_values_ |
std::vector< int > | assignment_indices_ |
Bitset64 | activated_ |
Bitset64 | was_activated_ |
SparseBitset | changes_ |
SparseBitset | delta_changes_ |
bool | cleared_ |
Handler | var_handler_ |
Constructor & Destructor Documentation
◆ VarLocalSearchOperator() [1/2]
|
inline |
Definition at line 823 of file constraint_solveri.h.
◆ VarLocalSearchOperator() [2/2]
|
inlineexplicit |
Definition at line 824 of file constraint_solveri.h.
◆ ~VarLocalSearchOperator()
|
inlineoverride |
Definition at line 829 of file constraint_solveri.h.
Member Function Documentation
◆ Activate()
|
inline |
Definition at line 863 of file constraint_solveri.h.
◆ Activated()
|
inline |
Definition at line 862 of file constraint_solveri.h.
◆ AddVars()
|
inline |
Definition at line 908 of file constraint_solveri.h.
◆ ApplyChanges()
|
inline |
Definition at line 871 of file constraint_solveri.h.
◆ Deactivate()
|
inline |
Definition at line 867 of file constraint_solveri.h.
◆ HasFragments()
|
inlinevirtualinherited |
Reimplemented in BaseLns.
Definition at line 815 of file constraint_solveri.h.
◆ HoldsDelta()
|
inlineoverridevirtual |
Reimplemented from LocalSearchOperator.
Definition at line 830 of file constraint_solveri.h.
◆ IsIncremental()
|
inlinevirtual |
Definition at line 846 of file constraint_solveri.h.
◆ MakeNextNeighbor()
|
pure virtualinherited |
◆ MarkChange()
|
inlineprotected |
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 932 of file constraint_solveri.h.
◆ OldValue()
|
inline |
Definition at line 857 of file constraint_solveri.h.
◆ OnStart()
|
inlinevirtual |
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 SwapIndexPairOperator.
Definition at line 927 of file constraint_solveri.h.
◆ Reset()
|
inlinevirtualinherited |
Reimplemented in PathOperator.
Definition at line 811 of file constraint_solveri.h.
◆ RevertChanges()
|
inline |
Definition at line 895 of file constraint_solveri.h.
◆ Self()
|
inlinevirtualinherited |
Definition at line 813 of file constraint_solveri.h.
◆ SetValue()
|
inline |
Definition at line 858 of file constraint_solveri.h.
◆ Size()
|
inline |
Definition at line 847 of file constraint_solveri.h.
◆ SkipUnchanged()
|
inlinevirtual |
Reimplemented in PathOperator.
Definition at line 856 of file constraint_solveri.h.
◆ Start()
|
inlineoverridevirtual |
This method should not be overridden.
Override OnStart() instead which is called before exiting this method.
Implements LocalSearchOperator.
Definition at line 833 of file constraint_solveri.h.
◆ Value()
|
inline |
Returns the value in the current assignment of the variable of given index.
Definition at line 850 of file constraint_solveri.h.
◆ Var()
|
inline |
Returns the variable of given index.
Definition at line 855 of file constraint_solveri.h.
Member Data Documentation
◆ activated_
|
protected |
Definition at line 942 of file constraint_solveri.h.
◆ assignment_indices_
|
mutableprotected |
Definition at line 941 of file constraint_solveri.h.
◆ changes_
|
protected |
Definition at line 944 of file constraint_solveri.h.
◆ cleared_
|
protected |
Definition at line 946 of file constraint_solveri.h.
◆ delta_changes_
|
protected |
Definition at line 945 of file constraint_solveri.h.
◆ old_values_
|
protected |
Definition at line 939 of file constraint_solveri.h.
◆ prev_values_
|
protected |
Definition at line 940 of file constraint_solveri.h.
◆ values_
|
protected |
Definition at line 938 of file constraint_solveri.h.
◆ var_handler_
|
protected |
Definition at line 947 of file constraint_solveri.h.
◆ vars_
|
protected |
Definition at line 937 of file constraint_solveri.h.
◆ was_activated_
|
protected |
Definition at line 943 of file constraint_solveri.h.
The documentation for this class was generated from the following file: