Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <routing_lp_scheduling.h>
Public Member Functions | |
DimensionCumulOptimizerCore (const RoutingDimension *dimension, bool use_precedence_propagator) | |
DimensionSchedulingStatus | OptimizeSingleRouteWithResource (int vehicle, const std::function< int64_t(int64_t)> &next_accessor, const RouteDimensionTravelInfo &dimension_travel_info, const Resource *resource, bool optimize_vehicle_costs, RoutingLinearSolverWrapper *solver, std::vector< int64_t > *cumul_values, std::vector< int64_t > *break_values, int64_t *cost_without_transit, int64_t *transit_cost, bool clear_lp=true) |
DimensionSchedulingStatus | ComputeSingleRouteSolutionCostWithoutFixedTransits (int vehicle, const std::function< int64_t(int64_t)> &next_accessor, const RouteDimensionTravelInfo &dimension_travel_info, RoutingLinearSolverWrapper *solver, absl::Span< const int64_t > solution_cumul_values, absl::Span< const int64_t > solution_break_values, int64_t *cost_without_transits, int64_t *cost_offset=nullptr, bool reuse_previous_model_if_possible=true, bool clear_lp=false, bool clear_solution_constraints=true, absl::Duration *solve_duration=nullptr) |
std::vector< DimensionSchedulingStatus > | OptimizeSingleRouteWithResources (int vehicle, const std::function< int64_t(int64_t)> &next_accessor, const std::function< int64_t(int64_t, int64_t)> &transit_accessor, const RouteDimensionTravelInfo &dimension_travel_info, const std::vector< Resource > &resources, const std::vector< int > &resource_indices, bool optimize_vehicle_costs, RoutingLinearSolverWrapper *solver, std::vector< std::vector< int64_t > > *cumul_values, std::vector< std::vector< int64_t > > *break_values, std::vector< int64_t > *costs_without_transits, int64_t *transit_cost, bool clear_lp=true) |
DimensionSchedulingStatus | Optimize (const std::function< int64_t(int64_t)> &next_accessor, const std::vector< RouteDimensionTravelInfo > &dimension_travel_info_per_route, RoutingLinearSolverWrapper *solver, std::vector< int64_t > *cumul_values, std::vector< int64_t > *break_values, std::vector< std::vector< int > > *resource_indices_per_group, int64_t *cost_without_transits, int64_t *transit_cost, bool clear_lp=true, bool optimize_resource_assignment=true) |
DimensionSchedulingStatus | OptimizeAndPack (const std::function< int64_t(int64_t)> &next_accessor, const std::vector< RouteDimensionTravelInfo > &dimension_travel_info_per_route, RoutingLinearSolverWrapper *solver, std::vector< int64_t > *cumul_values, std::vector< int64_t > *break_values) |
DimensionSchedulingStatus | OptimizeAndPackSingleRoute (int vehicle, const std::function< int64_t(int64_t)> &next_accessor, const RouteDimensionTravelInfo &dimension_travel_info, const Resource *resource, RoutingLinearSolverWrapper *solver, std::vector< int64_t > *cumul_values, std::vector< int64_t > *break_values) |
const RoutingDimension * | dimension () const |
Utility class used in Local/GlobalDimensionCumulOptimizer to set the linear solver constraints and solve the problem.
Definition at line 637 of file routing_lp_scheduling.h.
operations_research::DimensionCumulOptimizerCore::DimensionCumulOptimizerCore | ( | const RoutingDimension * | dimension, |
bool | use_precedence_propagator ) |
Initialize vehicle_to_first_index_ so the variables of the breaks of vehicle v are stored from vehicle_to_first_index_[v] to vehicle_to_first_index_[v+1] - 1.
Definition at line 549 of file routing_lp_scheduling.cc.
DimensionSchedulingStatus operations_research::DimensionCumulOptimizerCore::ComputeSingleRouteSolutionCostWithoutFixedTransits | ( | int | vehicle, |
const std::function< int64_t(int64_t)> & | next_accessor, | ||
const RouteDimensionTravelInfo & | dimension_travel_info, | ||
RoutingLinearSolverWrapper * | solver, | ||
absl::Span< const int64_t > | solution_cumul_values, | ||
absl::Span< const int64_t > | solution_break_values, | ||
int64_t * | cost_without_transits, | ||
int64_t * | cost_offset = nullptr, | ||
bool | reuse_previous_model_if_possible = true, | ||
bool | clear_lp = false, | ||
bool | clear_solution_constraints = true, | ||
absl::Duration * | solve_duration = nullptr ) |
Given some cumuls and breaks, computes the solution cost by solving the same model as in OptimizeSingleRouteWithResource() with the addition of constraints for cumuls and breaks.
Make sure SetRouteCumulConstraints will properly set the cumul bounds by looking at this route only.
Constrains the cumuls.
Constrains the breaks.
Definition at line 579 of file routing_lp_scheduling.cc.
|
inline |
Definition at line 713 of file routing_lp_scheduling.h.
DimensionSchedulingStatus operations_research::DimensionCumulOptimizerCore::Optimize | ( | const std::function< int64_t(int64_t)> & | next_accessor, |
const std::vector< RouteDimensionTravelInfo > & | dimension_travel_info_per_route, | ||
RoutingLinearSolverWrapper * | solver, | ||
std::vector< int64_t > * | cumul_values, | ||
std::vector< int64_t > * | break_values, | ||
std::vector< std::vector< int > > * | resource_indices_per_group, | ||
int64_t * | cost_without_transits, | ||
int64_t * | transit_cost, | ||
bool | clear_lp = true, | ||
bool | optimize_resource_assignment = true ) |
In the Optimize() method, if both 'cumul_values' and 'cost' parameters are null, we don't optimize the cost and stop at the first feasible solution in the linear solver (since in this case only feasibility is of interest). When 'optimize_resource_assignment' is false, the resource var values are used to constrain the vehicle routes according to their assigned resource.
If both "cumul_values" and "costs_without_transits" parameters are null, we don't try to optimize the cost and stop at the first feasible solution.
Tighten the route start/end cumul wrt. resources assigned to it.
Definition at line 928 of file routing_lp_scheduling.cc.
DimensionSchedulingStatus operations_research::DimensionCumulOptimizerCore::OptimizeAndPack | ( | const std::function< int64_t(int64_t)> & | next_accessor, |
const std::vector< RouteDimensionTravelInfo > & | dimension_travel_info_per_route, | ||
RoutingLinearSolverWrapper * | solver, | ||
std::vector< int64_t > * | cumul_values, | ||
std::vector< int64_t > * | break_values ) |
Subtle: Even if the status was RELAXED_OPTIMAL_ONLY we try to pack just in case packing manages to make the solution completely feasible.
Definition at line 1023 of file routing_lp_scheduling.cc.
DimensionSchedulingStatus operations_research::DimensionCumulOptimizerCore::OptimizeAndPackSingleRoute | ( | int | vehicle, |
const std::function< int64_t(int64_t)> & | next_accessor, | ||
const RouteDimensionTravelInfo & | dimension_travel_info, | ||
const Resource * | resource, | ||
RoutingLinearSolverWrapper * | solver, | ||
std::vector< int64_t > * | cumul_values, | ||
std::vector< int64_t > * | break_values ) |
Definition at line 1073 of file routing_lp_scheduling.cc.
DimensionSchedulingStatus operations_research::DimensionCumulOptimizerCore::OptimizeSingleRouteWithResource | ( | int | vehicle, |
const std::function< int64_t(int64_t)> & | next_accessor, | ||
const RouteDimensionTravelInfo & | dimension_travel_info, | ||
const Resource * | resource, | ||
bool | optimize_vehicle_costs, | ||
RoutingLinearSolverWrapper * | solver, | ||
std::vector< int64_t > * | cumul_values, | ||
std::vector< int64_t > * | break_values, | ||
int64_t * | cost_without_transit, | ||
int64_t * | transit_cost, | ||
bool | clear_lp = true ) |
Finds an optimal (or just feasible) solution for the route for the given resource. If the resource is null, it is simply ignored.
Definition at line 690 of file routing_lp_scheduling.cc.
std::vector< DimensionSchedulingStatus > operations_research::DimensionCumulOptimizerCore::OptimizeSingleRouteWithResources | ( | int | vehicle, |
const std::function< int64_t(int64_t)> & | next_accessor, | ||
const std::function< int64_t(int64_t, int64_t)> & | transit_accessor, | ||
const RouteDimensionTravelInfo & | dimension_travel_info, | ||
const std::vector< Resource > & | resources, | ||
const std::vector< int > & | resource_indices, | ||
bool | optimize_vehicle_costs, | ||
RoutingLinearSolverWrapper * | solver, | ||
std::vector< std::vector< int64_t > > * | cumul_values, | ||
std::vector< std::vector< int64_t > > * | break_values, | ||
std::vector< int64_t > * | costs_without_transits, | ||
int64_t * | transit_cost, | ||
bool | clear_lp = true ) |
Computes the optimal scheduling solution(s) for the route for each resource in 'resources' with an index in 'resource_indices'. If both 'resources' and 'resource_indices' are empty, computes the optimal solution for the route itself (without added resource constraints).
Make sure SetRouteCumulConstraints will properly set the cumul bounds by looking at this route only.
An unused empty vehicle doesn't require resources.
The model's deadline has been reached, stop.
The resource attributes don't match this vehicle.
Definition at line 824 of file routing_lp_scheduling.cc.