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

Generic path-based filter class. More...

Detailed Description

Generic path-based filter class.

Definition at line 969 of file routing_filters.h.

#include <routing_filters.h>

Inheritance diagram for operations_research::BasePathFilter:
operations_research::IntVarLocalSearchFilter operations_research::LocalSearchFilter operations_research::BaseObject

Public Member Functions

 BasePathFilter (const std::vector< IntVar * > &nexts, int next_domain_size, const PathsMetadata &paths_metadata)
 ~BasePathFilter () override=default
bool Accept (const Assignment *delta, const Assignment *deltadelta, int64_t objective_min, int64_t objective_max) override
void OnSynchronize (const Assignment *delta) override
Public Member Functions inherited from operations_research::IntVarLocalSearchFilter
 IntVarLocalSearchFilter (const std::vector< IntVar * > &vars)
 ~IntVarLocalSearchFilter () override
void Synchronize (const Assignment *assignment, const Assignment *delta) override
bool FindIndex (IntVar *const var, int64_t *index) const
void AddVars (const std::vector< IntVar * > &vars)
 Add variables to "track" to the filter.
int Size () const
IntVarVar (int index) const
int64_t Value (int index) const
bool IsVarSynced (int index) const
Public Member Functions inherited from operations_research::LocalSearchFilter
virtual void Relax (const Assignment *, const Assignment *)
virtual void Commit (const Assignment *, const Assignment *)
 Dual of Relax(), lets the filter know that the delta was accepted.
virtual bool IsIncremental () const
virtual void Revert ()
 Cancels the changes made by the last Relax()/Accept() calls.
virtual void Reset ()
 Sets the filter to empty solution.
virtual int64_t GetSynchronizedObjectiveValue () const
 Objective value from last time Synchronize() was called.
virtual int64_t GetAcceptedObjectiveValue () const
 Objective value from the last time Accept() was called and returned true.
Public Member Functions inherited from operations_research::BaseObject
 BaseObject ()
 BaseObject (const BaseObject &)=delete
BaseObjectoperator= (const BaseObject &)=delete
virtual ~BaseObject ()=default
virtual std::string DebugString () const

Protected Member Functions

int64_t GetNext (int64_t node) const
bool HasAnySyncedPath () const
int NumPaths () const
int64_t Start (int i) const
int64_t End (int i) const
int GetPath (int64_t node) const
int Rank (int64_t node) const
const std::vector< int64_t > & GetTouchedPathStarts () const
bool PathStartTouched (int64_t start) const
const std::vector< int64_t > & GetNewSynchronizedUnperformedNodes () const
bool lns_detected () const
Protected Member Functions inherited from operations_research::IntVarLocalSearchFilter
void SynchronizeOnAssignment (const Assignment *assignment)

Static Protected Attributes

static const int64_t kUnassigned = -1

Constructor & Destructor Documentation

◆ BasePathFilter()

operations_research::BasePathFilter::BasePathFilter ( const std::vector< IntVar * > & nexts,
int next_domain_size,
const PathsMetadata & paths_metadata )

Definition at line 713 of file routing_filters.cc.

◆ ~BasePathFilter()

operations_research::BasePathFilter::~BasePathFilter ( )
overridedefault

Member Function Documentation

◆ Accept()

bool operations_research::BasePathFilter::Accept ( const Assignment * delta,
const Assignment * deltadelta,
int64_t objective_min,
int64_t objective_max )
overridevirtual

Accepts a "delta" given the assignment with which the filter has been synchronized; the delta holds the variables which have been modified and their new value. If the filter represents a part of the global objective, its contribution must be between objective_min and objective_max. Sample: supposing one wants to maintain a[0,1] + b[0,1] <= 1, for the assignment (a,1), (b,0), the delta (b,1) will be rejected but the delta (a,0) will be accepted.

Todo
(user): Remove arguments when there are no more need for those.

Implements operations_research::LocalSearchFilter.

Definition at line 726 of file routing_filters.cc.

◆ End()

int64_t operations_research::BasePathFilter::End ( int i) const
inlineprotected

Definition at line 994 of file routing_filters.h.

◆ GetNewSynchronizedUnperformedNodes()

const std::vector< int64_t > & operations_research::BasePathFilter::GetNewSynchronizedUnperformedNodes ( ) const
inlineprotected

Definition at line 1001 of file routing_filters.h.

◆ GetNext()

int64_t operations_research::BasePathFilter::GetNext ( int64_t node) const
inlineprotected

Definition at line 981 of file routing_filters.h.

◆ GetPath()

int operations_research::BasePathFilter::GetPath ( int64_t node) const
inlineprotected

Definition at line 995 of file routing_filters.h.

◆ GetTouchedPathStarts()

const std::vector< int64_t > & operations_research::BasePathFilter::GetTouchedPathStarts ( ) const
inlineprotected

Definition at line 997 of file routing_filters.h.

◆ HasAnySyncedPath()

bool operations_research::BasePathFilter::HasAnySyncedPath ( ) const
inlineprotected

Definition at line 986 of file routing_filters.h.

◆ lns_detected()

bool operations_research::BasePathFilter::lns_detected ( ) const
inlineprotected

Definition at line 1005 of file routing_filters.h.

◆ NumPaths()

int operations_research::BasePathFilter::NumPaths ( ) const
inlineprotected

Definition at line 992 of file routing_filters.h.

◆ OnSynchronize()

void operations_research::BasePathFilter::OnSynchronize ( const Assignment * delta)
overridevirtual

Reimplemented from operations_research::IntVarLocalSearchFilter.

Definition at line 854 of file routing_filters.cc.

◆ PathStartTouched()

bool operations_research::BasePathFilter::PathStartTouched ( int64_t start) const
inlineprotected

Definition at line 1000 of file routing_filters.h.

◆ Rank()

int operations_research::BasePathFilter::Rank ( int64_t node) const
inlineprotected

Definition at line 996 of file routing_filters.h.

◆ Start()

int64_t operations_research::BasePathFilter::Start ( int i) const
inlineprotected

Definition at line 993 of file routing_filters.h.

Member Data Documentation

◆ kUnassigned

const int64_t operations_research::BasePathFilter::kUnassigned = -1
staticprotected

Definition at line 979 of file routing_filters.h.


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