Google OR-Tools: operations_research::BasePathFilter Class Reference

Generic path-based filter class. More...

Generic path-based filter class.

Definition at line 969 of file routing_filters.h.

#include <routing_filters.h>

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
operations_research::BasePathFilter::BasePathFilter ( const std::vector< IntVar * > & nexts,
int next_domain_size,
const PathsMetadata & paths_metadata )

◆ ~BasePathFilter()

operations_research::BasePathFilter::~BasePathFilter ( )
overridedefault

◆ 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

◆ GetNewSynchronizedUnperformedNodes()

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

◆ GetNext()

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

◆ GetPath()

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

◆ GetTouchedPathStarts()

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

◆ HasAnySyncedPath()

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

◆ lns_detected()

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

◆ NumPaths()

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

◆ OnSynchronize()

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

◆ PathStartTouched()

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

◆ Rank()

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

◆ Start()

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

◆ kUnassigned

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

staticprotected

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