Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::FilteredHeuristicLocalSearchOperator Class Referenceabstract

#include <routing_insertion_lns.h>

Inheritance diagram for operations_research::FilteredHeuristicLocalSearchOperator:
operations_research::IntVarLocalSearchOperator operations_research::LocalSearchOperator operations_research::BaseObject operations_research::FilteredHeuristicCloseNodesLNSOperator operations_research::FilteredHeuristicExpensiveChainLNSOperator operations_research::FilteredHeuristicPathLNSOperator operations_research::RelocatePathAndHeuristicInsertUnperformedOperator

Public Member Functions

 FilteredHeuristicLocalSearchOperator (std::unique_ptr< RoutingFilteredHeuristic > heuristic, bool keep_inverse_values=false)
 FilteredHeuristicLocalSearchOperator.
 
 ~FilteredHeuristicLocalSearchOperator () override
 
- Public Member Functions inherited from operations_research::IntVarLocalSearchOperator
 IntVarLocalSearchOperator (const std::vector< IntVar * > &vars, bool keep_inverse_values=false)
 
 ~IntVarLocalSearchOperator () override
 
bool HoldsDelta () const override
 
void Start (const Assignment *assignment) override
 
virtual bool IsIncremental () const
 
int Size () const
 
int64_t Value (int64_t index) const
 
IntVarVar (int64_t index) const
 Returns the variable of given index.
 
virtual bool SkipUnchanged (int index) const
 
int64_t OldValue (int64_t index) const
 
int64_t PrevValue (int64_t index) const
 
void SetValue (int64_t index, int64_t value)
 
bool Activated (int64_t index) const
 
void Activate (int64_t index)
 
void Deactivate (int64_t index)
 
bool ApplyChanges (Assignment *delta, Assignment *deltadelta) const
 
void RevertChanges (bool change_was_incremental)
 
void AddVars (const std::vector< IntVar * > &vars)
 
virtual void OnStart ()
 
bool MakeNextNeighbor (Assignment *delta, Assignment *deltadelta) override
 --— Base operator class for operators manipulating IntVars --—
 
- Public Member Functions inherited from operations_research::LocalSearchOperator
 LocalSearchOperator ()
 
 ~LocalSearchOperator () override
 
virtual void Reset ()
 
virtual const LocalSearchOperatorSelf () const
 
virtual bool HasFragments () const
 
- Public Member Functions inherited from operations_research::BaseObject
 BaseObject ()
 
 BaseObject (const BaseObject &)=delete
 This type is neither copyable nor movable.
 
BaseObjectoperator= (const BaseObject &)=delete
 
virtual ~BaseObject ()
 
virtual std::string DebugString () const
 

Protected Member Functions

virtual bool IncrementPosition ()=0
 
virtual std::function< int64_t(int64_t)> SetupNextAccessorForNeighbor ()=0
 
std::string HeuristicName () const
 
- Protected Member Functions inherited from operations_research::IntVarLocalSearchOperator
int64_t InverseValue (int64_t index) const
 
int64_t OldInverseValue (int64_t index) const
 
void AddToAssignment (IntVar *var, int64_t value, bool active, std::vector< int > *assignment_indices, int64_t index, Assignment *assignment) const
 

Protected Attributes

RoutingModel *const model_
 
SparseBitset removed_nodes_
 Keeps track of removed nodes when making a neighbor.
 

Detailed Description

Class of operators using a RoutingFilteredHeuristic to insert unperformed nodes after changes have been made to the current solution.

Todo
(user): Put these methods in an object with helper methods instead of adding a layer to the class hierarchy.

Definition at line 39 of file routing_insertion_lns.h.

Constructor & Destructor Documentation

◆ FilteredHeuristicLocalSearchOperator()

operations_research::FilteredHeuristicLocalSearchOperator::FilteredHeuristicLocalSearchOperator ( std::unique_ptr< RoutingFilteredHeuristic > heuristic,
bool keep_inverse_values = false )
explicit

◆ ~FilteredHeuristicLocalSearchOperator()

operations_research::FilteredHeuristicLocalSearchOperator::~FilteredHeuristicLocalSearchOperator ( )
inlineoverride

Definition at line 44 of file routing_insertion_lns.h.

Member Function Documentation

◆ HeuristicName()

std::string operations_research::FilteredHeuristicLocalSearchOperator::HeuristicName ( ) const
inlineprotected
Note
Verify that the "FilteredHeuristic" string was at the end of the heuristic name.

Definition at line 53 of file routing_insertion_lns.h.

◆ IncrementPosition()

virtual bool operations_research::FilteredHeuristicLocalSearchOperator::IncrementPosition ( )
protectedpure virtual

◆ SetupNextAccessorForNeighbor()

virtual std::function< int64_t(int64_t)> operations_research::FilteredHeuristicLocalSearchOperator::SetupNextAccessorForNeighbor ( )
protectedpure virtual

Virtual method to return the next_accessor to be passed to the heuristic to build a new solution. This method should also correctly set the nodes being removed (if any) in removed_nodes_.

Member Data Documentation

◆ model_

RoutingModel* const operations_research::FilteredHeuristicLocalSearchOperator::model_
protected
Todo
(user): Remove the dependency from RoutingModel by storing an IntVarFilteredHeuristic here instead and storing information on path start/ends like PathOperator does (instead of relying on the model).

Definition at line 69 of file routing_insertion_lns.h.

◆ removed_nodes_

SparseBitset operations_research::FilteredHeuristicLocalSearchOperator::removed_nodes_
protected

Keeps track of removed nodes when making a neighbor.

Definition at line 71 of file routing_insertion_lns.h.


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