C++ Reference: class LocalDimensionCumulOptimizer

Note: This documentation is automatically generated.

Class used to compute optimal values for dimension cumuls of routes, minimizing cumul soft lower and upper bound costs, and vehicle span costs of a route. In its methods, next_accessor is a callback returning the next node of a given node on a route.
Method
ComputePackedRouteCumuls

Return type: DimensionSchedulingStatus

Arguments: int vehicle, const std::function<int64_t(int64_t)>& next_accessor, const RoutingModel::ResourceGroup::Resource* resource, std::vector<int64_t>* packed_cumuls, std::vector<int64_t>* packed_breaks

Similar to ComputeRouteCumuls, but also tries to pack the cumul values on the route, such that the cost remains the same, the cumul of route end is minimized, and then the cumul of the start of the route is maximized. If 'resource' is non-null, the packed route must also respect its start/end time window.

ComputeRouteCumulCost

Return type: DimensionSchedulingStatus

Arguments: int vehicle, const std::function<int64_t(int64_t)>& next_accessor, int64_t* optimal_cost

If feasible, computes the optimal cost of the route performed by a vehicle, minimizing cumul soft lower and upper bound costs and vehicle span costs, and stores it in "optimal_cost" (if not null). Returns true iff the route respects all constraints.

ComputeRouteCumulCostsForResourcesWithoutFixedTransits

Arguments: int vehicle, const std::function<int64_t(int64_t)>& next_accessor, const std::function<int64_t(int64_t, int64_t)>& transit_accessor, const std::vector<RoutingModel::ResourceGroup::Resource>& resources, const std::vector<int>& resource_indices, bool optimize_vehicle_costs, std::vector<int64_t>* optimal_costs_without_transits, std::vector<std::vector<int64_t>>* optimal_cumuls, std::vector<std::vector<int64_t>>* optimal_breaks

ComputeRouteCumulCostWithoutFixedTransits

Return type: DimensionSchedulingStatus

Arguments: int vehicle, const std::function<int64_t(int64_t)>& next_accessor, int64_t* optimal_cost_without_transits

Same as ComputeRouteCumulCost, but the cost computed does not contain the part of the vehicle span cost due to fixed transits.

ComputeRouteCumuls

Return type: DimensionSchedulingStatus

Arguments: int vehicle, const std::function<int64_t(int64_t)>& next_accessor, std::vector<int64_t>* optimal_cumuls, std::vector<int64_t>* optimal_breaks

If feasible, computes the optimal values for cumul and break variables of the route performed by a vehicle, minimizing cumul soft lower, upper bound costs and vehicle span costs, stores them in "optimal_cumuls" (if not null), and optimal_breaks, and returns true. Returns false if the route is not feasible.

dimension

Return type: const RoutingDimension*

LocalDimensionCumulOptimizer

Arguments: const RoutingDimension* dimension, RoutingSearchParameters::SchedulingSolver solver_type