Computes the vehicle-to-resource assignment costs for the given vehicle to
all resources in the group, and sets these costs in assignment_costs (if
non-null).
optimize_vehicle_costs indicates if the costs should be optimized or if
we merely care about feasibility (cost of 0) and infeasibility (cost of -1)
of the assignments.
The cumul and break values corresponding to the assignment of each resource
are also set in cumul_values and break_values, if non-null.
Returns the cost resulting from the min-cost assignment of resources to
(used) vehicles, or -1 if the assignment is impossible.
For each vehicle v and resource r, the cost of assigning r to v is equal to
- primary_vehicle_to_resource_assignment_costs[v][r] if
primary_vehicle_to_resource_assignment_costs[v] is not empty,
- secondary_vehicle_to_resource_assignment_costs[v][r] otherwise
(secondary_vehicle_to_resource_assignment_costs[v] can never be empty).
If non-null, 'resource_indices' contains the index of the resource assigned
to each vehicle.
TODO(user): Return std::optional to catch infeasibilities.
[[["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."],[[["The `ResourceAssignmentOptimizer` class facilitates the optimal assignment of resources to vehicles within a routing problem."],["It leverages cost computations and optimization techniques to determine the most efficient assignment strategy."],["The class offers methods for calculating assignment costs, determining the best assignment, and accessing relevant routing dimensions."],["The `ComputeAssignmentCostsForVehicle` method calculates the cost of assigning a resource to a given vehicle."],["The `ComputeBestAssignmentCost` method aims to find the assignment with the lowest total cost."]]],["The `ResourceAssignmentOptimizer` class provides methods for managing resource-to-vehicle assignments. `ComputeAssignmentCostsForVehicle` calculates the cost of assigning a vehicle to each resource, determining feasibility and storing costs, cumul, and break values. `ComputeBestAssignmentCost` finds the minimum-cost assignment of resources to vehicles, using primary or secondary assignment cost vectors, returning -1 if impossible. The class also holds a `dimension` object, and the constructor `ResourceAssignmentOptimizer` initializes it with a resource group and optimizers.\n"]]