C++ Reference

C++ Reference: Routing

ComparatorCheapestAdditionFilteredHeuristic

Detailed Description

A CheapestAdditionFilteredHeuristic where the notion of 'cheapest arc' comes from an arc comparator.

Definition at line 3236 of file routing.h.

Public Member Functions

 ComparatorCheapestAdditionFilteredHeuristic (RoutingModel *model, Solver::VariableValueComparator comparator, const std::vector< LocalSearchFilter * > &filters)
 Takes ownership of evaluator. More...
 
 ~ComparatorCheapestAdditionFilteredHeuristic () override
 
std::string DebugString () const override
 
bool BuildSolutionInternal () override
 Virtual method to redefine how to build a solution. More...
 
const Assignment * BuildSolutionFromRoutes (const std::function< int64(int64)> &next_accessor)
 Builds a solution starting from the routes formed by the next accessor. More...
 
RoutingModelmodel () const
 
int GetStartChainEnd (int vehicle) const
 Returns the end of the start chain of vehicle,. More...
 
int GetEndChainStart (int vehicle) const
 Returns the start of the end chain of vehicle,. More...
 
void MakeDisjunctionNodesUnperformed (int64 node)
 Make nodes in the same disjunction as 'node' unperformed. More...
 
void MakeUnassignedNodesUnperformed ()
 Make all unassigned nodes unperformed. More...
 
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
 

Protected Member Functions

bool StopSearch () override
 Returns true if the search must be stopped. More...
 
virtual void SetVehicleIndex (int64 node, int vehicle)
 
virtual void ResetVehicleIndices ()
 
void ResetSolution ()
 Resets the data members for a new 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...
 
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...
 
IntVar * Var (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

◆ ComparatorCheapestAdditionFilteredHeuristic()

ComparatorCheapestAdditionFilteredHeuristic ( RoutingModel model,
Solver::VariableValueComparator  comparator,
const std::vector< LocalSearchFilter * > &  filters 
)

Takes ownership of evaluator.

◆ ~ComparatorCheapestAdditionFilteredHeuristic()

Definition at line 3243 of file routing.h.

Member Function Documentation

◆ BuildSolution()

Assignment* const BuildSolution ( )
inherited

Builds a solution.

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

◆ BuildSolutionFromRoutes()

const Assignment* BuildSolutionFromRoutes ( const std::function< int64(int64)> &  next_accessor)
inherited

Builds a solution starting from the routes formed by the next accessor.

◆ BuildSolutionInternal()

bool BuildSolutionInternal ( )
overridevirtualinherited

Virtual method to redefine how to build a solution.

Implements IntVarFilteredHeuristic.

◆ Commit()

bool Commit ( )
protectedinherited

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

◆ Contains()

bool Contains ( int64  index) const
inlineprotectedinherited

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

Definition at line 2745 of file routing.h.

◆ DebugString()

std::string DebugString ( ) const
inlineoverridevirtual

Reimplemented from IntVarFilteredHeuristic.

Definition at line 3244 of file routing.h.

◆ GetEndChainStart()

int GetEndChainStart ( int  vehicle) const
inlineinherited

Returns the start of the end chain of vehicle,.

Definition at line 2787 of file routing.h.

◆ GetStartChainEnd()

int GetStartChainEnd ( int  vehicle) const
inlineinherited

Returns the end of the start chain of vehicle,.

Definition at line 2785 of file routing.h.

◆ MakeDisjunctionNodesUnperformed()

void MakeDisjunctionNodesUnperformed ( int64  node)
inherited

Make nodes in the same disjunction as 'node' unperformed.

'node' is a variable index corresponding to a node.

◆ MakeUnassignedNodesUnperformed()

void MakeUnassignedNodesUnperformed ( )
inherited

Make all unassigned nodes unperformed.

◆ model()

RoutingModel* model ( ) const
inlineinherited

Definition at line 2783 of file routing.h.

◆ number_of_decisions()

int64 number_of_decisions ( ) const
inlineinherited

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

Definition at line 2710 of file routing.h.

◆ number_of_rejects()

int64 number_of_rejects ( ) const
inlineinherited

Definition at line 2711 of file routing.h.

◆ ResetSolution()

void ResetSolution ( )
protectedinherited

Resets the data members for a new solution.

◆ ResetVehicleIndices()

virtual void ResetVehicleIndices ( )
inlineprotectedvirtualinherited

Definition at line 2797 of file routing.h.

◆ SetValue()

void SetValue ( int64  index,
int64  value 
)
inlineprotectedinherited

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

Definition at line 2730 of file routing.h.

◆ SetVehicleIndex()

virtual void SetVehicleIndex ( int64  node,
int  vehicle 
)
inlineprotectedvirtualinherited

Definition at line 2796 of file routing.h.

◆ Size()

int Size ( ) const
inlineprotectedinherited

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

Definition at line 2750 of file routing.h.

◆ StopSearch()

bool StopSearch ( )
inlineoverrideprotectedvirtualinherited

Returns true if the search must be stopped.

Reimplemented from IntVarFilteredHeuristic.

Definition at line 2795 of file routing.h.

◆ SynchronizeFilters()

void SynchronizeFilters ( )
protectedinherited

Synchronizes filters with an assignment (the current solution).

◆ Value()

int64 Value ( int64  index) const
inlineprotectedinherited

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

Definition at line 2741 of file routing.h.

◆ Var()

IntVar* Var ( int64  index) const
inlineprotectedinherited

Returns the variable of index 'index'.

Definition at line 2752 of file routing.h.

Member Data Documentation

◆ assignment_

Assignment* const assignment_
protectedinherited

Definition at line 2756 of file routing.h.


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