Stay organized with collections
Save and categorize content based on your preferences.
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.
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.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eLocalDimensionCumulOptimizer\u003c/code\u003e class in C++ optimizes dimension cumuls for routes, minimizing costs related to cumul bounds and vehicle spans.\u003c/p\u003e\n"],["\u003cp\u003eIt uses a callback, \u003ccode\u003enext_accessor\u003c/code\u003e, to determine the sequence of nodes in a route.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods to compute optimal cumuls, costs, and breaks for a given route and vehicle.\u003c/p\u003e\n"],["\u003cp\u003eIt aims to find feasible solutions that satisfy constraints while minimizing the overall cost.\u003c/p\u003e\n"],["\u003cp\u003eIt offers functionality for packing cumul values, optimizing for resource time windows, and excluding fixed transit costs from calculations.\u003c/p\u003e\n"]]],["The `LocalDimensionCumulOptimizer` class computes optimal dimension cumul values for routes, minimizing costs associated with soft lower and upper bounds, and vehicle span. Key actions include: calculating the optimal cost of a route (`ComputeRouteCumulCost`), computing and packing cumul values (`ComputePackedRouteCumuls`), finding optimal cumul and break values (`ComputeRouteCumuls`), calculating costs without fixed transits (`ComputeRouteCumulCostWithoutFixedTransits`), and calculating route cumul costs for resources without transits (`ComputeRouteCumulCostsForResourcesWithoutFixedTransits`). It utilizes a `next_accessor` callback to navigate route nodes.\n"],null,["# LocalDimensionCumulOptimizer\n\nC++ Reference: class LocalDimensionCumulOptimizer\n=================================================\n\n\nNote: This documentation is automatically generated.\nClass 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.\n\n| Method ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`ComputePackedRouteCumuls`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L791) | Return type: `DimensionSchedulingStatus ` Arguments: ` int vehicle, const std::function\u003cint64_t(int64_t)\u003e& next_accessor, const RoutingModel::ResourceGroup::Resource* resource, std::vector\u003cint64_t\u003e* packed_cumuls, std::vector\u003cint64_t\u003e* 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. |\n| [`ComputeRouteCumulCost`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L756) | Return type: `DimensionSchedulingStatus ` Arguments: ` int vehicle, const std::function\u003cint64_t(int64_t)\u003e& 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. |\n| [`ComputeRouteCumulCostsForResourcesWithoutFixedTransits`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L767) | \u003cbr /\u003e Arguments: ` int vehicle, const std::function\u003cint64_t(int64_t)\u003e& next_accessor, const std::function\u003cint64_t(int64_t, int64_t)\u003e& transit_accessor, const std::vector\u003cRoutingModel::ResourceGroup::Resource\u003e& resources, const std::vector\u003cint\u003e& resource_indices, bool optimize_vehicle_costs, std::vector\u003cint64_t\u003e* optimal_costs_without_transits, std::vector\u003cstd::vector\u003cint64_t\u003e\u003e* optimal_cumuls, std::vector\u003cstd::vector\u003cint64_t\u003e\u003e* optimal_breaks` \u003cbr /\u003e |\n| [`ComputeRouteCumulCostWithoutFixedTransits`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L762) | Return type: `DimensionSchedulingStatus ` Arguments: ` int vehicle, const std::function\u003cint64_t(int64_t)\u003e& 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. |\n| [`ComputeRouteCumuls`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L781) | Return type: `DimensionSchedulingStatus ` Arguments: ` int vehicle, const std::function\u003cint64_t(int64_t)\u003e& next_accessor, std::vector\u003cint64_t\u003e* optimal_cumuls, std::vector\u003cint64_t\u003e* 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. |\n| [`dimension`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L796) | Return type: `const RoutingDimension* ` \u003cbr /\u003e |\n| [`LocalDimensionCumulOptimizer`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L748) | \u003cbr /\u003e Arguments: ` const RoutingDimension* dimension, RoutingSearchParameters::SchedulingSolver solver_type` \u003cbr /\u003e |"]]