OR-Tools  8.2
IntVarFilteredHeuristicabstract

Detailed Description

Generic filter-based heuristic applied to IntVars.

Definition at line 2997 of file routing.h.

Public Member Functions

 IntVarFilteredHeuristic (Solver *solver, const std::vector< IntVar * > &vars, LocalSearchFilterManager *filter_manager)
 
virtual ~IntVarFilteredHeuristic ()
 
Assignment *const BuildSolution ()
 Builds a solution. More...
 
int64 number_of_decisions () const
 Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters. More...
 
int64 number_of_rejects () const
 
virtual std::string DebugString () const
 

Protected Member Functions

void ResetSolution ()
 Resets the data members for a new solution. More...
 
virtual bool InitializeSolution ()
 Virtual method to initialize the solution. More...
 
virtual bool BuildSolutionInternal ()=0
 Virtual method to redefine how to build a solution. More...
 
bool Commit ()
 Commits the modifications to the current solution if these modifications are "filter-feasible", returns false otherwise; in any case discards all modifications. More...
 
virtual bool StopSearch ()
 Returns true if the search must be stopped. More...
 
void SetValue (int64 index, int64 value)
 Modifies the current solution by setting the variable of index 'index' to value 'value'. More...
 
int64 Value (int64 index) const
 Returns the value of the variable of index 'index' in the last committed solution. More...
 
bool Contains (int64 index) const
 Returns true if the variable of index 'index' is in the current solution. More...
 
int Size () const
 Returns the number of variables the decision builder is trying to instantiate. More...
 
IntVarVar (int64 index) const
 Returns the variable of index 'index'. More...
 
void SynchronizeFilters ()
 Synchronizes filters with an assignment (the current solution). More...
 

Protected Attributes

Assignment *const assignment_
 

Constructor & Destructor Documentation

◆ IntVarFilteredHeuristic()

IntVarFilteredHeuristic ( Solver solver,
const std::vector< IntVar * > &  vars,
LocalSearchFilterManager filter_manager 
)

Definition at line 2881 of file routing_search.cc.

◆ ~IntVarFilteredHeuristic()

virtual ~IntVarFilteredHeuristic ( )
inlinevirtual

Definition at line 3002 of file routing.h.

Member Function Documentation

◆ BuildSolution()

Assignment *const BuildSolution ( )

Builds a solution.

Returns the resulting assignment if a solution was found, and nullptr otherwise.

Definition at line 2907 of file routing_search.cc.

◆ BuildSolutionInternal()

virtual bool BuildSolutionInternal ( )
protectedpure virtual

◆ Commit()

bool Commit ( )
protected

Commits the modifications to the current solution if these modifications are "filter-feasible", returns false otherwise; in any case discards all modifications.

Definition at line 2952 of file routing_search.cc.

◆ Contains()

bool Contains ( int64  index) const
inlineprotected

Returns true if the variable of index 'index' is in the current solution.

Definition at line 3045 of file routing.h.

◆ DebugString()

◆ InitializeSolution()

virtual bool InitializeSolution ( )
inlineprotectedvirtual

Virtual method to initialize the solution.

Definition at line 3019 of file routing.h.

◆ number_of_decisions()

int64 number_of_decisions ( ) const
inline

Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters.

Definition at line 3010 of file routing.h.

◆ number_of_rejects()

int64 number_of_rejects ( ) const
inline

Definition at line 3011 of file routing.h.

◆ ResetSolution()

void ResetSolution ( )
protected

Resets the data members for a new solution.

Definition at line 2897 of file routing_search.cc.

◆ SetValue()

void SetValue ( int64  index,
int64  value 
)
inlineprotected

Modifies the current solution by setting the variable of index 'index' to value 'value'.

Definition at line 3030 of file routing.h.

◆ Size()

int Size ( ) const
inlineprotected

Returns the number of variables the decision builder is trying to instantiate.

Definition at line 3050 of file routing.h.

◆ StopSearch()

virtual bool StopSearch ( )
inlineprotectedvirtual

Returns true if the search must be stopped.

Reimplemented in RoutingFilteredHeuristic.

Definition at line 3027 of file routing.h.

◆ SynchronizeFilters()

void SynchronizeFilters ( )
protected

Synchronizes filters with an assignment (the current solution).

Definition at line 2980 of file routing_search.cc.

◆ Value()

int64 Value ( int64  index) const
inlineprotected

Returns the value of the variable of index 'index' in the last committed solution.

Definition at line 3041 of file routing.h.

◆ Var()

IntVar * Var ( int64  index) const
inlineprotected

Returns the variable of index 'index'.

Definition at line 3052 of file routing.h.

Member Data Documentation

◆ assignment_

Assignment* const assignment_
protected

Definition at line 3056 of file routing.h.


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