Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::RoutingModel::CostClass::DimensionCost Struct Reference

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 324 of file routing.h.

#include <routing.h>

Public Member Functions

bool operator< (const DimensionCost &cost) const

Public Attributes

int64_t transit_evaluator_class
int64_t span_cost_coefficient
int64_t slack_cost_coefficient
const RoutingDimensiondimension

Friends

bool operator== (const DimensionCost &c1, const DimensionCost &c2)
template<typename H>
AbslHashValue (H h, const DimensionCost &cost)

Member Function Documentation

◆ operator<()

bool operations_research::RoutingModel::CostClass::DimensionCost::operator< ( const DimensionCost & cost) const
inline

Definition at line 331 of file routing.h.

◆ AbslHashValue

template<typename H>
H AbslHashValue ( H h,
const DimensionCost & cost )
friend

Definition at line 345 of file routing.h.

◆ operator==

bool operator== ( const DimensionCost & c1,
const DimensionCost & c2 )
friend

Definition at line 339 of file routing.h.

Member Data Documentation

◆ dimension

const RoutingDimension* operations_research::RoutingModel::CostClass::DimensionCost::dimension

Definition at line 330 of file routing.h.

◆ slack_cost_coefficient

int64_t operations_research::RoutingModel::CostClass::DimensionCost::slack_cost_coefficient

Definition at line 329 of file routing.h.

◆ span_cost_coefficient

int64_t operations_research::RoutingModel::CostClass::DimensionCost::span_cost_coefficient

Definition at line 328 of file routing.h.

◆ transit_evaluator_class

int64_t operations_research::RoutingModel::CostClass::DimensionCost::transit_evaluator_class

Definition at line 325 of file routing.h.


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