C++ Reference

C++ Reference: Routing

RoutingModel::CostClass::DimensionCost

Detailed Description

SUBTLE: The vehicle's fixed cost is skipped on purpose here, because we can afford to do so:

  • We don't really care about creating "strict" equivalence classes; all we care about is to: 1) compress the space of cost callbacks so that we can cache them more efficiently. 2) have a smaller IntVar domain thanks to using a "cost class var" instead of the vehicle var, so that we reduce the search space. Both of these are an incentive for fewer cost classes. Ignoring the fixed costs can only be good in that regard.
  • The fixed costs are only needed when evaluating the cost of the first arc of the route, in which case we know the vehicle, since we have the route's start node. Only dimensions that have non-zero cost evaluator and a non-zero cost coefficient (in this cost class) are listed here. Since we only need their transit evaluator (the raw version that takes var index, not Node Index) and their span cost coefficient, we just store those. This is sorted by the natural operator < (and not by DimensionIndex).

Definition at line 295 of file routing.h.

Public Member Functions

bool operator< (const DimensionCost &cost) const
 

Public Attributes

int64 transit_evaluator_class
 
int64 cost_coefficient
 
const RoutingDimensiondimension
 

Member Function Documentation

◆ operator<()

bool operator< ( const DimensionCost cost) const
inline

Definition at line 299 of file routing.h.

Member Data Documentation

◆ cost_coefficient

int64 cost_coefficient

Definition at line 297 of file routing.h.

◆ dimension

const RoutingDimension* dimension

Definition at line 298 of file routing.h.

◆ transit_evaluator_class

int64 transit_evaluator_class

Definition at line 296 of file routing.h.


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