C++ Reference

C++ Reference: Routing

Detailed Description

Filtered heuristic LNS operator, where the destruction phase consists of removing a node and the 'num_close_nodes' nodes closest to it, along with each of their corresponding sibling pickup/deliveries that are performed.

Definition at line 497 of file routing_neighborhoods.h.

Public Member Functions

 FilteredHeuristicCloseNodesLNSOperator (std::unique_ptr< RoutingFilteredHeuristic > heuristic, int num_close_nodes)
 
 ~FilteredHeuristicCloseNodesLNSOperator () override
 
std::string DebugString () const 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...
 
IntVarVar (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 Reset ()
 
virtual const LocalSearchOperatorSelf () const
 
virtual bool HasFragments () const
 

Protected Member Functions

std::string HeuristicName () const
 
bool IsInverseValue (int64 index) const
 
int64 InverseValue (int64 index) const
 
int64 OldInverseValue (int64 index) const
 
void SetInverseValue (int64 index, int64 value)
 
void SetOldInverseValue (int64 index, int64 value)
 
void MarkChange (int64 index)
 OnStart() should really be protected, but then SWIG doesn't see it. More...
 

Protected Attributes

const RoutingModelmodel_
 
SparseBitset removed_nodes_
 Keeps track of removed nodes when making a neighbor. More...
 
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_
 

Constructor & Destructor Documentation

◆ FilteredHeuristicCloseNodesLNSOperator()

FilteredHeuristicCloseNodesLNSOperator ( std::unique_ptr< RoutingFilteredHeuristic heuristic,
int  num_close_nodes 
)

◆ ~FilteredHeuristicCloseNodesLNSOperator()

Definition at line 502 of file routing_neighborhoods.h.

Member Function Documentation

◆ Activate()

void Activate ( int64  index)
inlineinherited

Definition at line 856 of file constraint_solveri.h.

◆ Activated()

bool Activated ( int64  index) const
inlineinherited

Definition at line 855 of file constraint_solveri.h.

◆ AddVars()

void AddVars ( const std::vector< V * > &  vars)
inlineinherited

Definition at line 901 of file constraint_solveri.h.

◆ ApplyChanges()

bool ApplyChanges ( Assignment delta,
Assignment deltadelta 
) const
inlineinherited

Definition at line 864 of file constraint_solveri.h.

◆ Deactivate()

void Deactivate ( int64  index)
inlineinherited

Definition at line 860 of file constraint_solveri.h.

◆ DebugString()

std::string DebugString ( ) const
inlineoverridevirtual

Reimplemented from BaseObject.

Definition at line 504 of file routing_neighborhoods.h.

◆ HasFragments()

virtual bool HasFragments ( ) const
inlinevirtualinherited

Reimplemented in BaseLns.

Definition at line 808 of file constraint_solveri.h.

◆ HeuristicName()

std::string HeuristicName ( ) const
inlineprotectedinherited

Definition at line 361 of file routing_neighborhoods.h.

◆ HoldsDelta()

bool HoldsDelta ( ) const
inlineoverridevirtualinherited

Reimplemented from LocalSearchOperator.

Definition at line 823 of file constraint_solveri.h.

◆ InverseValue()

int64 InverseValue ( int64  index) const
inlineprotectedinherited

Definition at line 1072 of file constraint_solveri.h.

◆ IsIncremental()

virtual bool IsIncremental ( ) const
inlinevirtualinherited

Definition at line 839 of file constraint_solveri.h.

◆ IsInverseValue()

bool IsInverseValue ( int64  index) const
inlineprotectedinherited

Definition at line 1067 of file constraint_solveri.h.

◆ MakeNextNeighbor()

bool MakeNextNeighbor ( Assignment delta,
Assignment deltadelta 
)
overridevirtualinherited

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 LocalSearchOperator.

Reimplemented in PairNodeSwapActiveOperator< swap_first >, IndexPairSwapActiveOperator, and SwapIndexPairOperator.

◆ MarkChange()

void MarkChange ( int64  index)
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 925 of file constraint_solveri.h.

◆ OldInverseValue()

int64 OldInverseValue ( int64  index) const
inlineprotectedinherited

Definition at line 1074 of file constraint_solveri.h.

◆ OldValue()

const int64 & OldValue ( int64  index) const
inlineinherited

Definition at line 850 of file constraint_solveri.h.

◆ Reset()

virtual void Reset ( )
inlinevirtualinherited

Reimplemented in PathOperator.

Definition at line 804 of file constraint_solveri.h.

◆ RevertChanges()

void RevertChanges ( bool  incremental)
inlineinherited

Definition at line 888 of file constraint_solveri.h.

◆ Self()

virtual const LocalSearchOperator* Self ( ) const
inlinevirtualinherited

Definition at line 806 of file constraint_solveri.h.

◆ SetInverseValue()

void SetInverseValue ( int64  index,
int64  value 
)
inlineprotectedinherited

Definition at line 1078 of file constraint_solveri.h.

◆ SetOldInverseValue()

void SetOldInverseValue ( int64  index,
int64  value 
)
inlineprotectedinherited

Definition at line 1082 of file constraint_solveri.h.

◆ SetValue()

void SetValue ( int64  index,
const Val &  value 
)
inlineinherited

Definition at line 851 of file constraint_solveri.h.

◆ Size()

int Size ( ) const
inlineinherited

Definition at line 840 of file constraint_solveri.h.

◆ SkipUnchanged()

virtual bool SkipUnchanged ( int  index) const
inlinevirtualinherited

Reimplemented in PathOperator.

Definition at line 849 of file constraint_solveri.h.

◆ Start()

void Start ( const Assignment assignment)
inlineoverridevirtualinherited

This method should not be overridden.

Override OnStart() instead which is called before exiting this method.

Implements LocalSearchOperator.

Definition at line 826 of file constraint_solveri.h.

◆ Value()

const int64 & Value ( int64  index) const
inlineinherited

Returns the value in the current assignment of the variable of given index.

Definition at line 843 of file constraint_solveri.h.

◆ Var()

IntVar * Var ( int64  index) const
inlineinherited

Returns the variable of given index.

Definition at line 848 of file constraint_solveri.h.

Member Data Documentation

◆ activated_

Bitset64 activated_
protectedinherited

Definition at line 935 of file constraint_solveri.h.

◆ assignment_indices_

std::vector<int> assignment_indices_
mutableprotectedinherited

Definition at line 934 of file constraint_solveri.h.

◆ changes_

SparseBitset changes_
protectedinherited

Definition at line 937 of file constraint_solveri.h.

◆ cleared_

bool cleared_
protectedinherited

Definition at line 939 of file constraint_solveri.h.

◆ delta_changes_

SparseBitset delta_changes_
protectedinherited

Definition at line 938 of file constraint_solveri.h.

◆ model_

const RoutingModel& model_
protectedinherited

Definition at line 377 of file routing_neighborhoods.h.

◆ old_values_

std::vector<int64 > old_values_
protectedinherited

Definition at line 932 of file constraint_solveri.h.

◆ prev_values_

std::vector<int64 > prev_values_
protectedinherited

Definition at line 933 of file constraint_solveri.h.

◆ removed_nodes_

SparseBitset removed_nodes_
protectedinherited

Keeps track of removed nodes when making a neighbor.

Definition at line 379 of file routing_neighborhoods.h.

◆ values_

std::vector<int64 > values_
protectedinherited

Definition at line 931 of file constraint_solveri.h.

◆ var_handler_

IntVarLocalSearchHandler var_handler_
protectedinherited

Definition at line 940 of file constraint_solveri.h.

◆ vars_

std::vector<IntVar *> vars_
protectedinherited

Definition at line 930 of file constraint_solveri.h.

◆ was_activated_

Bitset64 was_activated_
protectedinherited

Definition at line 936 of file constraint_solveri.h.


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