![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
Definition at line 29 of file RoutingModel.java.
Classes | |
| class | VehicleTypeContainer |
| class | ResourceGroup |
| class | VariableValuePair |
| class | SecondaryOptimizer |
| class | PickupDeliveryPosition |
| class | NodeNeighborsParameters |
| class | NodeNeighborsByCostClass |
Public Member Functions | |
| RoutingModel (long cPtr, boolean cMemoryOwn) | |
| synchronized void | delete () |
| RoutingModel (RoutingIndexManager index_manager) | |
| RoutingModel (RoutingIndexManager index_manager, com.google.ortools.constraintsolver.RoutingModelParameters parameters) | |
| int | registerUnaryTransitVector (long[] values) |
| int | registerUnaryTransitCallback (LongUnaryOperator callback, int sign) |
| int | registerUnaryTransitCallback (LongUnaryOperator callback) |
| int | registerTransitMatrix (long[][] values) |
| int | registerTransitCallback (LongBinaryOperator callback, int sign) |
| int | registerTransitCallback (LongBinaryOperator callback) |
| int | RegisterCumulDependentTransitCallback (SWIGTYPE_p_std__functionT_FloatSlopePiecewiseLinearFunction_const_pflong_longF_t callback) |
| SWIGTYPE_p_std__functionT_FloatSlopePiecewiseLinearFunction_const_pflong_longF_t | CumulDependentTransitCallback (int callback_index) |
| boolean | addDimension (int evaluator_index, long slack_max, long capacity, boolean fix_start_cumul_to_zero, String name) |
| boolean | addDimensionWithVehicleTransits (int[] evaluator_indices, long slack_max, long capacity, boolean fix_start_cumul_to_zero, String name) |
| boolean | addDimensionWithVehicleCapacity (int evaluator_index, long slack_max, long[] vehicle_capacities, boolean fix_start_cumul_to_zero, String name) |
| boolean | addDimensionWithVehicleTransitAndCapacity (int[] evaluator_indices, long slack_max, long[] vehicle_capacities, boolean fix_start_cumul_to_zero, String name) |
| boolean | AddDimensionWithCumulDependentVehicleTransitAndCapacity (int[] fixed_evaluator_indices, int[] cumul_dependent_evaluator_indices, long slack_max, long[] vehicle_capacities, boolean fix_start_cumul_to_zero, String name) |
| IntBoolPair | addConstantDimensionWithSlack (long value, long capacity, long slack_max, boolean fix_start_cumul_to_zero, String name) |
| IntBoolPair | addConstantDimension (long value, long capacity, boolean fix_start_cumul_to_zero, String name) |
| IntBoolPair | addVectorDimension (long[] values, long capacity, boolean fix_start_cumul_to_zero, String name) |
| IntBoolPair | addMatrixDimension (long[][] values, long capacity, boolean fix_start_cumul_to_zero, String name) |
| SWIGTYPE_p_std__vectorT_operations_research__RoutingDimension_p_t | GetUnaryDimensions () |
| SWIGTYPE_p_std__vectorT_operations_research__RoutingDimension_const_p_t | GetDimensionsWithGlobalCumulOptimizers () |
| SWIGTYPE_p_std__vectorT_operations_research__RoutingDimension_const_p_t | GetDimensionsWithLocalCumulOptimizers () |
| boolean | HasGlobalCumulOptimizer (RoutingDimension dimension) |
| boolean | HasLocalCumulOptimizer (RoutingDimension dimension) |
| SWIGTYPE_p_operations_research__GlobalDimensionCumulOptimizer | GetMutableGlobalCumulLPOptimizer (RoutingDimension dimension) |
| SWIGTYPE_p_operations_research__GlobalDimensionCumulOptimizer | GetMutableGlobalCumulMPOptimizer (RoutingDimension dimension) |
| SWIGTYPE_p_operations_research__LocalDimensionCumulOptimizer | GetMutableLocalCumulLPOptimizer (RoutingDimension dimension) |
| boolean | hasDimension (String dimension_name) |
| RoutingDimension | getDimensionOrDie (String dimension_name) |
| RoutingDimension | getMutableDimension (String dimension_name) |
| void | setPrimaryConstrainedDimension (String dimension_name) |
| String | getPrimaryConstrainedDimension () |
| RoutingModel.ResourceGroup | AddResourceGroup () |
| SWIGTYPE_p_std__vectorT_std__unique_ptrT_operations_research__RoutingModel__ResourceGroup_t_t | GetResourceGroups () |
| RoutingModel.ResourceGroup | GetResourceGroup (int rg_index) |
| int[] | GetDimensionResourceGroupIndices (RoutingDimension dimension) |
| int | GetDimensionResourceGroupIndex (RoutingDimension dimension) |
| int | addDisjunction (long[] indices, long penalty, long max_cardinality, int penalty_cost_behavior) |
| int | addDisjunction (long[] indices, long penalty, long max_cardinality) |
| int | addDisjunction (long[] indices, long penalty) |
| int | addDisjunction (long[] indices) |
| int[] | getDisjunctionIndices (long index) |
| long[] | GetDisjunctionNodeIndices (int index) |
| long | getDisjunctionPenalty (int index) |
| long | getDisjunctionMaxCardinality (int index) |
| int | GetDisjunctionPenaltyCostBehavior (int index) |
| int | getNumberOfDisjunctions () |
| boolean | HasMandatoryDisjunctions () |
| boolean | HasMaxCardinalityConstrainedDisjunctions () |
| void | ignoreDisjunctionsAlreadyForcedToZero () |
| void | addSoftSameVehicleConstraint (long[] indices, long cost) |
| int | GetNumberOfSoftSameVehicleConstraints () |
| long[] | GetSoftSameVehicleIndices (int index) |
| long | GetSoftSameVehicleCost (int index) |
| void | setAllowedVehiclesForIndex (SWIGTYPE_p_absl__SpanT_int_const_t vehicles, long index) |
| boolean | isVehicleAllowedForIndex (int vehicle, long index) |
| void | addPickupAndDelivery (long pickup, long delivery) |
| void | addPickupAndDeliverySets (int pickup_disjunction, int delivery_disjunction) |
| SWIGTYPE_p_std__optionalT_operations_research__RoutingModel__PickupDeliveryPosition_t | GetPickupPosition (long node_index) |
| SWIGTYPE_p_std__optionalT_operations_research__RoutingModel__PickupDeliveryPosition_t | GetDeliveryPosition (long node_index) |
| boolean | IsPickup (long node_index) |
| boolean | IsDelivery (long node_index) |
| void | setPickupAndDeliveryPolicyOfAllVehicles (int policy) |
| void | setPickupAndDeliveryPolicyOfVehicle (int policy, int vehicle) |
| int | getPickupAndDeliveryPolicyOfVehicle (int vehicle) |
| int | getNumOfSingletonNodes () |
| SWIGTYPE_p_std__optionalT_long_t | GetFirstMatchingPickupDeliverySibling (long node, SWIGTYPE_p_std__functionT_bool_flongF_t is_match) |
| void | setVisitType (long index, int type, int type_policy) |
| int | getVisitType (long index) |
| int[] | GetSingleNodesOfType (int type) |
| int[] | GetPairIndicesOfType (int type) |
| int | GetVisitTypePolicy (long index) |
| int | getNumberOfVisitTypes () |
| void | addHardTypeIncompatibility (int type1, int type2) |
| void | addTemporalTypeIncompatibility (int type1, int type2) |
| SWIGTYPE_p_absl__flat_hash_setT_int_t | getTemporalTypeIncompatibilitiesOfType (int type) |
| boolean | hasHardTypeIncompatibilities () |
| boolean | hasTemporalTypeIncompatibilities () |
| void | addRequiredTypeAlternativesWhenAddingType (int dependent_type, SWIGTYPE_p_absl__flat_hash_setT_int_t required_type_alternatives) |
| void | addRequiredTypeAlternativesWhenRemovingType (int dependent_type, SWIGTYPE_p_absl__flat_hash_setT_int_t required_type_alternatives) |
| SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t | GetRequiredTypeAlternativesWhenAddingType (int type) |
| SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t | GetRequiredTypeAlternativesWhenRemovingType (int type) |
| boolean | hasSameVehicleTypeRequirements () |
| boolean | hasTemporalTypeRequirements () |
| long | unperformedPenalty (long var_index) |
| long | unperformedPenaltyOrValue (long default_value, long var_index) |
| long | getDepot () |
| void | SetMaximumNumberOfActiveVehicles (int max_active_vehicles) |
| int | GetMaximumNumberOfActiveVehicles () |
| void | setArcCostEvaluatorOfAllVehicles (int evaluator_index) |
| void | setArcCostEvaluatorOfVehicle (int evaluator_index, int vehicle) |
| void | setFixedCostOfAllVehicles (long cost) |
| void | setFixedCostOfVehicle (long cost, int vehicle) |
| long | getFixedCostOfVehicle (int vehicle) |
| void | SetPathEnergyCostOfVehicle (String force, String distance, long cost_per_unit, int vehicle) |
| void | SetPathEnergyCostsOfVehicle (String force, String distance, long threshold, long cost_per_unit_below_threshold, long cost_per_unit_above_threshold, int vehicle) |
| void | setAmortizedCostFactorsOfAllVehicles (long linear_cost_factor, long quadratic_cost_factor) |
| void | setAmortizedCostFactorsOfVehicle (long linear_cost_factor, long quadratic_cost_factor, int vehicle) |
| long[] | getAmortizedLinearCostFactorOfVehicles () |
| long[] | getAmortizedQuadraticCostFactorOfVehicles () |
| SWIGTYPE_p_std__optionalT_long_t | GetRouteCost (long[] route) |
| void | SetVehicleUsedWhenEmpty (boolean is_used, int vehicle) |
| boolean | IsVehicleUsedWhenEmpty (int vehicle) |
| void | setFirstSolutionEvaluator (LongBinaryOperator evaluator) |
| void | SetFirstSolutionHint (Assignment hint) |
| Assignment | GetFirstSolutionHint () |
| void | addLocalSearchOperator (LocalSearchOperator ls_operator) |
| void | addSearchMonitor (SearchMonitor monitor) |
| void | AddEnterSearchCallback (Runnable callback) |
| void | addAtSolutionCallback (Runnable callback, boolean track_unchecked_neighbors) |
| void | addAtSolutionCallback (Runnable callback) |
| void | AddRestoreDimensionValuesResetCallback (Runnable callback) |
| void | addVariableMinimizedByFinalizer (IntVar var) |
| void | addVariableMaximizedByFinalizer (IntVar var) |
| void | AddWeightedVariableMinimizedByFinalizer (IntVar var, long cost) |
| void | AddWeightedVariableMaximizedByFinalizer (IntVar var, long cost) |
| void | addVariableTargetToFinalizer (IntVar var, long target) |
| void | AddWeightedVariableTargetToFinalizer (IntVar var, long target, long cost) |
| void | closeModel () |
| void | closeModelWithParameters (com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) |
| Assignment | solve (Assignment assignment) |
| Assignment | solve () |
| Assignment | solveWithParameters (com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters, SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t solutions) |
| Assignment | solveWithParameters (com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) |
| Assignment | solveFromAssignmentWithParameters (Assignment assignment, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters, SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t solutions) |
| Assignment | solveFromAssignmentWithParameters (Assignment assignment, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) |
| Assignment | FastSolveFromAssignmentWithParameters (Assignment assignment, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters, boolean check_solution_in_cp, SWIGTYPE_p_absl__flat_hash_setT_operations_research__IntVar_p_t touched) |
| Assignment | FastSolveFromAssignmentWithParameters (Assignment assignment, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters, boolean check_solution_in_cp) |
| Assignment | SolveFromAssignmentsWithParameters (SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t assignments, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters, SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t solutions) |
| Assignment | SolveFromAssignmentsWithParameters (SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t assignments, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) |
| Assignment | SolveWithIteratedLocalSearch (com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) |
| void | setAssignmentFromOtherModelAssignment (Assignment target_assignment, RoutingModel source_model, Assignment source_assignment) |
| SWIGTYPE_p_operations_research__SubSolverStatistics | GetSubSolverStatistics () |
| long | computeLowerBound () |
| long | objective_lower_bound () |
| com.google.ortools.constraintsolver.RoutingSearchStatus.Value | status () |
| RoutingSearchStats | search_stats () |
| boolean | enable_deep_serialization () |
| IntVar | applyLocks (SWIGTYPE_p_absl__SpanT_long_const_t locks) |
| boolean | applyLocksToAllVehicles (long[][] locks, boolean close_routes) |
| Assignment | preAssignment () |
| Assignment | mutablePreAssignment () |
| boolean | writeAssignment (String file_name) |
| Assignment | readAssignment (String file_name) |
| Assignment | restoreAssignment (Assignment solution) |
| Assignment | readAssignmentFromRoutes (long[][] routes, boolean ignore_inactive_indices) |
| boolean | routesToAssignment (long[][] routes, boolean ignore_inactive_indices, boolean close_routes, Assignment assignment) |
| void | assignmentToRoutes (Assignment assignment, long[][] routes) |
| Assignment | compactAssignment (Assignment assignment) |
| Assignment | compactAndCheckAssignment (Assignment assignment) |
| void | addToAssignment (IntVar var) |
| void | addIntervalToAssignment (IntervalVar interval) |
| RoutingModel.NodeNeighborsByCostClass | GetOrCreateNodeNeighborsByCostClass (double neighbors_ratio, long min_neighbors, SWIGTYPE_p_double neighbors_ratio_used, boolean add_vehicle_starts_to_neighbors, boolean add_vehicle_ends_to_neighbors, boolean only_sort_neighbors_for_partial_neighborhoods) |
| RoutingModel.NodeNeighborsByCostClass | GetOrCreateNodeNeighborsByCostClass (double neighbors_ratio, long min_neighbors, SWIGTYPE_p_double neighbors_ratio_used, boolean add_vehicle_starts_to_neighbors, boolean add_vehicle_ends_to_neighbors) |
| RoutingModel.NodeNeighborsByCostClass | GetOrCreateNodeNeighborsByCostClass (double neighbors_ratio, long min_neighbors, SWIGTYPE_p_double neighbors_ratio_used, boolean add_vehicle_starts_to_neighbors) |
| RoutingModel.NodeNeighborsByCostClass | GetOrCreateNodeNeighborsByCostClass (double neighbors_ratio, long min_neighbors, SWIGTYPE_p_double neighbors_ratio_used) |
| RoutingModel.NodeNeighborsByCostClass | GetOrCreateNodeNeighborsByCostClass (RoutingModel.NodeNeighborsParameters params) |
| void | addLocalSearchFilter (LocalSearchFilter filter) |
| long | start (int vehicle) |
| long | end (int vehicle) |
| boolean | isStart (long index) |
| boolean | isEnd (long index) |
| int | VehicleIndex (long index) |
| long | next (Assignment assignment, long index) |
| boolean | isVehicleUsed (Assignment assignment, int vehicle) |
| IntVar[] | nexts () |
| IntVar[] | vehicleVars () |
| IntVar[] | ResourceVars (int resource_group) |
| IntVar | nextVar (long index) |
| IntVar | activeVar (long index) |
| IntVar | activeVehicleVar (int vehicle) |
| IntVar | VehicleRouteConsideredVar (int vehicle) |
| IntVar | vehicleVar (long index) |
| IntVar | ResourceVar (int vehicle, int resource_group) |
| IntVar | costVar () |
| long | getArcCostForVehicle (long from_index, long to_index, long vehicle) |
| boolean | costsAreHomogeneousAcrossVehicles () |
| long | getHomogeneousCost (long from_index, long to_index) |
| long | getArcCostForFirstSolution (long from_index, long to_index) |
| long | getArcCostForClass (long from_index, long to_index, long cost_class_index) |
| int | getCostClassIndexOfVehicle (long vehicle) |
| boolean | hasVehicleWithCostClassIndex (int cost_class_index) |
| int | getCostClassesCount () |
| int | getNonZeroCostClassesCount () |
| int | getVehicleClassIndexOfVehicle (long vehicle) |
| int | GetVehicleOfClass (int vehicle_class) |
| int | getVehicleClassesCount () |
| int[] | getSameVehicleIndicesOfIndex (int node) |
| void | AddSameActivityGroup (SWIGTYPE_p_absl__SpanT_int_const_t nodes) |
| int[] | GetSameActivityIndicesOfIndex (int node) |
| int | GetSameActivityGroupOfIndex (int node) |
| int[] | GetSameActivityGroups () |
| int | GetSameActivityGroupsCount () |
| int[] | GetSameActivityIndicesOfGroup (int group) |
| RoutingModel.VehicleTypeContainer | GetVehicleTypeContainer () |
| boolean | arcIsMoreConstrainedThanArc (long from, long to1, long to2) |
| String | debugOutputAssignment (Assignment solution_assignment, String dimension_to_print) |
| boolean | CheckIfAssignmentIsFeasible (Assignment assignment, boolean call_at_solution_monitors) |
| Solver | solver () |
| boolean | checkLimit (SWIGTYPE_p_absl__Duration offset) |
| boolean | checkLimit () |
| void | UpdateTimeLimit (SWIGTYPE_p_absl__Duration time_limit) |
| SWIGTYPE_p_absl__Duration | TimeBuffer () |
| SWIGTYPE_p_std__atomicT_bool_t | GetMutableCPSatInterrupt () |
| SWIGTYPE_p_std__atomicT_bool_t | GetMutableCPInterrupt () |
| void | CancelSearch () |
| int | nodes () |
| int | vehicles () |
| long | size () |
| long | getNumberOfDecisionsInFirstSolution (com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) |
| long | getNumberOfRejectsInFirstSolution (com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) |
| boolean | isMatchingModel () |
| boolean | AreRoutesInterdependent (SWIGTYPE_p_operations_research__RoutingSearchParameters parameters) |
| DecisionBuilder | makeGuidedSlackFinalizer (RoutingDimension dimension, LongUnaryOperator initializer) |
| DecisionBuilder | makeSelfDependentDimensionFinalizer (RoutingDimension dimension) |
| PathsMetadata | GetPathsMetadata () |
| SWIGTYPE_p_std__dequeT_int_t | GetVehiclesOfSameClass (long start_end_index) |
| SWIGTYPE_p_std__vectorT_std__pairT_long_long_t_t | GetSameVehicleClassArcs (long from_index, long to_index) |
Static Public Member Functions | |
| static long | getCPtr (RoutingModel obj) |
| static long | swigRelease (RoutingModel obj) |
| static long | getKNoPenalty () |
| static int | getKNoDisjunction () |
| static int | getKNoDimension () |
Static Public Attributes | |
| static final int | PICKUP_AND_DELIVERY_NO_ORDER = mainJNI.RoutingModel_PICKUP_AND_DELIVERY_NO_ORDER_get() |
| static final int | PICKUP_AND_DELIVERY_LIFO = mainJNI.RoutingModel_PICKUP_AND_DELIVERY_LIFO_get() |
| static final int | PICKUP_AND_DELIVERY_FIFO = mainJNI.RoutingModel_PICKUP_AND_DELIVERY_FIFO_get() |
| static final int | kTransitEvaluatorSignUnknown = mainJNI.RoutingModel_kTransitEvaluatorSignUnknown_get() |
| static final int | kTransitEvaluatorSignPositiveOrZero = mainJNI.RoutingModel_kTransitEvaluatorSignPositiveOrZero_get() |
| static final int | kTransitEvaluatorSignNegativeOrZero = mainJNI.RoutingModel_kTransitEvaluatorSignNegativeOrZero_get() |
| static final int | PENALIZE_ONCE = mainJNI.RoutingModel_PENALIZE_ONCE_get() |
| static final int | PENALIZE_PER_INACTIVE = mainJNI.RoutingModel_PENALIZE_PER_INACTIVE_get() |
| static final int | TYPE_ADDED_TO_VEHICLE = mainJNI.RoutingModel_TYPE_ADDED_TO_VEHICLE_get() |
| static final int | ADDED_TYPE_REMOVED_FROM_VEHICLE = mainJNI.RoutingModel_ADDED_TYPE_REMOVED_FROM_VEHICLE_get() |
| static final int | TYPE_ON_VEHICLE_UP_TO_VISIT = mainJNI.RoutingModel_TYPE_ON_VEHICLE_UP_TO_VISIT_get() |
| static final int | TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED = mainJNI.RoutingModel_TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED_get() |
Protected Member Functions | |
| void | finalize () |
Protected Attributes | |
| transient boolean | swigCMemOwn |
| com.google.ortools.constraintsolver.RoutingModel.RoutingModel | ( | long | cPtr, |
| boolean | cMemoryOwn ) |
Definition at line 33 of file RoutingModel.java.
| com.google.ortools.constraintsolver.RoutingModel.RoutingModel | ( | RoutingIndexManager | index_manager | ) |
Constructor taking an index manager. The version which does not take
RoutingModelParameters is equivalent to passing
DefaultRoutingModelParameters().
Definition at line 607 of file RoutingModel.java.
| com.google.ortools.constraintsolver.RoutingModel.RoutingModel | ( | RoutingIndexManager | index_manager, |
| com.google.ortools.constraintsolver.RoutingModelParameters | parameters ) |
Definition at line 611 of file RoutingModel.java.
| IntVar com.google.ortools.constraintsolver.RoutingModel.activeVar | ( | long | index | ) |
Returns the active variable of the node corresponding to index.
Definition at line 2312 of file RoutingModel.java.
| IntVar com.google.ortools.constraintsolver.RoutingModel.activeVehicleVar | ( | int | vehicle | ) |
Returns the active variable of the vehicle. It will be equal to 1 iff the
route of the vehicle is not empty, 0 otherwise.
Definition at line 2321 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addAtSolutionCallback | ( | Runnable | callback | ) |
Adds a callback called each time a solution is found during the search.
This is a shortcut to creating a monitor to call the callback on
AtSolution() and adding it with AddSearchMonitor.
If track_unchecked_neighbors is true, the callback will also be called on
AcceptUncheckedNeighbor() events, which is useful to grab solutions
obtained when solver_parameters.check_solution_period > 1 (aka fastLS).
Definition at line 1573 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addAtSolutionCallback | ( | Runnable | callback, |
| boolean | track_unchecked_neighbors ) |
Adds a callback called each time a solution is found during the search.
This is a shortcut to creating a monitor to call the callback on
AtSolution() and adding it with AddSearchMonitor.
If track_unchecked_neighbors is true, the callback will also be called on
AcceptUncheckedNeighbor() events, which is useful to grab solutions
obtained when solver_parameters.check_solution_period > 1 (aka fastLS).
Definition at line 1561 of file RoutingModel.java.
| IntBoolPair com.google.ortools.constraintsolver.RoutingModel.addConstantDimension | ( | long | value, |
| long | capacity, | ||
| boolean | fix_start_cumul_to_zero, | ||
| String | name ) |
Definition at line 718 of file RoutingModel.java.
| IntBoolPair com.google.ortools.constraintsolver.RoutingModel.addConstantDimensionWithSlack | ( | long | value, |
| long | capacity, | ||
| long | slack_max, | ||
| boolean | fix_start_cumul_to_zero, | ||
| String | name ) |
Creates a dimension where the transit variable is constrained to be
equal to 'value'; 'capacity' is the upper bound of the cumul variables.
'name' is the name used to reference the dimension; this name is used to
get cumul and transit variables from the routing model.
Returns a pair consisting of an index to the registered unary transit
callback and a bool denoting whether the dimension has been created.
It is false if a dimension with the same name has already been created
(and doesn't create the new dimension but still register a new callback).
Definition at line 714 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.addDimension | ( | int | evaluator_index, |
| long | slack_max, | ||
| long | capacity, | ||
| boolean | fix_start_cumul_to_zero, | ||
| String | name ) |
Model creation
Methods to add dimensions to routes; dimensions represent quantities
accumulated at nodes along the routes. They represent quantities such as
weights or volumes carried along the route, or distance or times.
Quantities at a node are represented by "cumul" variables and the increase
or decrease of quantities between nodes are represented by "transit"
variables. These variables are linked as follows:
if j == next(i), cumul(j) = cumul(i) + transit(i, j) + slack(i)
where slack is a positive slack variable (can represent waiting times for
a time dimension).
Setting the value of fix_start_cumul_to_zero to true will force the
"cumul" variable of the start node of all vehicles to be equal to 0.
Creates a dimension where the transit variable is constrained to be
equal to evaluator(i, next(i)); 'slack_max' is the upper bound of the
slack variable and 'capacity' is the upper bound of the cumul variables.
'name' is the name used to reference the dimension; this name is used to
get cumul and transit variables from the routing model.
Returns false if a dimension with the same name has already been created
(and doesn't create the new dimension).
Takes ownership of the callback 'evaluator'.
Definition at line 676 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.AddDimensionWithCumulDependentVehicleTransitAndCapacity | ( | int[] | fixed_evaluator_indices, |
| int[] | cumul_dependent_evaluator_indices, | ||
| long | slack_max, | ||
| long[] | vehicle_capacities, | ||
| boolean | fix_start_cumul_to_zero, | ||
| String | name ) |
Creates a dimension where the transit variable on arc i->j is the sum of:
Definition at line 700 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.addDimensionWithVehicleCapacity | ( | int | evaluator_index, |
| long | slack_max, | ||
| long[] | vehicle_capacities, | ||
| boolean | fix_start_cumul_to_zero, | ||
| String | name ) |
Definition at line 684 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.addDimensionWithVehicleTransitAndCapacity | ( | int[] | evaluator_indices, |
| long | slack_max, | ||
| long[] | vehicle_capacities, | ||
| boolean | fix_start_cumul_to_zero, | ||
| String | name ) |
Definition at line 688 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.addDimensionWithVehicleTransits | ( | int[] | evaluator_indices, |
| long | slack_max, | ||
| long | capacity, | ||
| boolean | fix_start_cumul_to_zero, | ||
| String | name ) |
Definition at line 680 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.addDisjunction | ( | long[] | indices | ) |
Adds a disjunction constraint on the indices.
Exactly 'max_cardinality' of the indices are active.
If a penalty is given, at most 'max_cardinality' of the indices can be
active, and if less are active, 'penalty' is payed per inactive index if
the penalty cost is set to PENALIZE_PER_INACTIVE.
This is equivalent to adding the constraint:
p + Sum(i)active[i] == max_cardinality
where p is an integer variable.
If the penalty cost is set to PENALIZE_ONCE, then 'penalty' is payed
once if there are less than max_cardinality of the indices active.
This is equivalent to adding the constraint:
p == (Sum(i)active[i] != max_cardinality)
where p is a boolean variable.
The following cost is added to the cost function: p * penalty.
Warning: Start and end indices of any vehicle cannot be part of a
disjunction.
Definition at line 976 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.addDisjunction | ( | long[] | indices, |
| long | penalty ) |
Adds a disjunction constraint on the indices.
Exactly 'max_cardinality' of the indices are active.
If a penalty is given, at most 'max_cardinality' of the indices can be
active, and if less are active, 'penalty' is payed per inactive index if
the penalty cost is set to PENALIZE_PER_INACTIVE.
This is equivalent to adding the constraint:
p + Sum(i)active[i] == max_cardinality
where p is an integer variable.
If the penalty cost is set to PENALIZE_ONCE, then 'penalty' is payed
once if there are less than max_cardinality of the indices active.
This is equivalent to adding the constraint:
p == (Sum(i)active[i] != max_cardinality)
where p is a boolean variable.
The following cost is added to the cost function: p * penalty.
| penalty | must be positive to make the disjunction optional; a negative penalty will force 'max_cardinality' indices of the disjunction to be performed, and therefore p == 0. Note: passing a vector with a single index will model an optional index with a penalty cost if it is not visited. Warning: Start and end indices of any vehicle cannot be part of a disjunction. |
Definition at line 953 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.addDisjunction | ( | long[] | indices, |
| long | penalty, | ||
| long | max_cardinality ) |
Adds a disjunction constraint on the indices.
Exactly 'max_cardinality' of the indices are active.
If a penalty is given, at most 'max_cardinality' of the indices can be
active, and if less are active, 'penalty' is payed per inactive index if
the penalty cost is set to PENALIZE_PER_INACTIVE.
This is equivalent to adding the constraint:
p + Sum(i)active[i] == max_cardinality
where p is an integer variable.
If the penalty cost is set to PENALIZE_ONCE, then 'penalty' is payed
once if there are less than max_cardinality of the indices active.
This is equivalent to adding the constraint:
p == (Sum(i)active[i] != max_cardinality)
where p is a boolean variable.
The following cost is added to the cost function: p * penalty.
| penalty | must be positive to make the disjunction optional; a negative penalty will force 'max_cardinality' indices of the disjunction to be performed, and therefore p == 0. Note: passing a vector with a single index will model an optional index with a penalty cost if it is not visited. Warning: Start and end indices of any vehicle cannot be part of a disjunction. |
Definition at line 925 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.addDisjunction | ( | long[] | indices, |
| long | penalty, | ||
| long | max_cardinality, | ||
| int | penalty_cost_behavior ) |
Adds a disjunction constraint on the indices.
Exactly 'max_cardinality' of the indices are active.
If a penalty is given, at most 'max_cardinality' of the indices can be
active, and if less are active, 'penalty' is payed per inactive index if
the penalty cost is set to PENALIZE_PER_INACTIVE.
This is equivalent to adding the constraint:
p + Sum(i)active[i] == max_cardinality
where p is an integer variable.
If the penalty cost is set to PENALIZE_ONCE, then 'penalty' is payed
once if there are less than max_cardinality of the indices active.
This is equivalent to adding the constraint:
p == (Sum(i)active[i] != max_cardinality)
where p is a boolean variable.
The following cost is added to the cost function: p * penalty.
| penalty | must be positive to make the disjunction optional; a negative penalty will force 'max_cardinality' indices of the disjunction to be performed, and therefore p == 0. Note: passing a vector with a single index will model an optional index with a penalty cost if it is not visited. Warning: Start and end indices of any vehicle cannot be part of a disjunction. |
Definition at line 897 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.AddEnterSearchCallback | ( | Runnable | callback | ) |
Definition at line 1549 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addHardTypeIncompatibility | ( | int | type1, |
| int | type2 ) |
Incompatibilities:
Two nodes with "hard" incompatible types cannot share the same route at
all, while with a "temporal" incompatibility they can't be on the same
route at the same time.
NOTE: To avoid unnecessary memory reallocations, it is recommended to only
add incompatibilities once all the existing types have been set with
SetVisitType().
Definition at line 1295 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addIntervalToAssignment | ( | IntervalVar | interval | ) |
Definition at line 1991 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addLocalSearchFilter | ( | LocalSearchFilter | filter | ) |
Adds a custom local search filter to the list of filters used to speed up
local search by pruning unfeasible variable assignments.
Calling this method after the routing model has been closed (CloseModel()
or Solve() has been called) has no effect.
The routing model does not take ownership of the filter.
Definition at line 2218 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addLocalSearchOperator | ( | LocalSearchOperator | ls_operator | ) |
Adds a local search operator to the set of operators used to solve the
vehicle routing problem.
Definition at line 1538 of file RoutingModel.java.
| IntBoolPair com.google.ortools.constraintsolver.RoutingModel.addMatrixDimension | ( | long | values[][], |
| long | capacity, | ||
| boolean | fix_start_cumul_to_zero, | ||
| String | name ) |
Creates a dimension where the transit variable is constrained to be
equal to 'values[i][next(i)]' for node i; 'capacity' is the upper bound of
the cumul variables. 'name' is the name used to reference the dimension;
this name is used to get cumul and transit variables from the routing
model.
Returns a pair consisting of an index to the registered transit callback
and a bool denoting whether the dimension has been created.
It is false if a dimension with the same name has already been created
(and doesn't create the new dimension but still register a new callback).
Definition at line 748 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addPickupAndDelivery | ( | long | pickup, |
| long | delivery ) |
Notifies that index1 and index2 form a pair of nodes which should belong
to the same route. This methods helps the search find better solutions,
especially in the local search phase.
It should be called each time you have an equality constraint linking
the vehicle variables of two node (including for instance pickup and
delivery problems):
Solver* const solver = routing.solver();
int64_t index1 = manager.NodeToIndex(node1);
int64_t index2 = manager.NodeToIndex(node2);
solver->AddConstraint(solver->MakeEquality(
routing.VehicleVar(index1),
routing.VehicleVar(index2)));
routing.AddPickupAndDelivery(index1, index2);
Definition at line 1117 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addPickupAndDeliverySets | ( | int | pickup_disjunction, |
| int | delivery_disjunction ) |
Same as AddPickupAndDelivery but notifying that the performed node from
the disjunction of index 'pickup_disjunction' is on the same route as the
performed node from the disjunction of index 'delivery_disjunction'.
Definition at line 1126 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addRequiredTypeAlternativesWhenAddingType | ( | int | dependent_type, |
| SWIGTYPE_p_absl__flat_hash_setT_int_t | required_type_alternatives ) |
If type_D depends on type_R when adding type_D, any node_D of type_D and
VisitTypePolicy TYPE_ADDED_TO_VEHICLE or
TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED requires at least one type_R on its
vehicle at the time node_D is visited.
Definition at line 1325 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addRequiredTypeAlternativesWhenRemovingType | ( | int | dependent_type, |
| SWIGTYPE_p_absl__flat_hash_setT_int_t | required_type_alternatives ) |
The following requirements apply when visiting dependent nodes that remove
their type from the route, i.e. type_R must be on the vehicle when type_D
of VisitTypePolicy ADDED_TYPE_REMOVED_FROM_VEHICLE,
TYPE_ON_VEHICLE_UP_TO_VISIT or TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED is
visited.
Definition at line 1336 of file RoutingModel.java.
| RoutingModel.ResourceGroup com.google.ortools.constraintsolver.RoutingModel.AddResourceGroup | ( | ) |
Adds a resource group to the routing model and returns a pointer to it.
Definition at line 843 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.AddRestoreDimensionValuesResetCallback | ( | Runnable | callback | ) |
Definition at line 1577 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.AddSameActivityGroup | ( | SWIGTYPE_p_absl__SpanT_int_const_t | nodes | ) |
Definition at line 2461 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addSearchMonitor | ( | SearchMonitor | monitor | ) |
Adds a search monitor to the search used to solve the routing model.
Definition at line 1545 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addSoftSameVehicleConstraint | ( | long[] | indices, |
| long | cost ) |
Adds a soft constraint to force a set of variable indices to be on the
same vehicle. If all nodes are not on the same vehicle, each extra vehicle
used adds 'cost' to the cost function.
TODO(user): Extend this to allow nodes/indices to be on the same given
set of vehicle.
Definition at line 1059 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addTemporalTypeIncompatibility | ( | int | type1, |
| int | type2 ) |
Definition at line 1299 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addToAssignment | ( | IntVar | var | ) |
Adds an extra variable to the vehicle routing assignment.
Definition at line 1987 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addVariableMaximizedByFinalizer | ( | IntVar | var | ) |
Adds a variable to maximize in the solution finalizer (see above for
information on the solution finalizer).
Definition at line 1595 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addVariableMinimizedByFinalizer | ( | IntVar | var | ) |
Adds a variable to minimize in the solution finalizer. The solution
finalizer is called each time a solution is found during the search and
allows to instantiate secondary variables (such as dimension cumul
variables).
Definition at line 1587 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.addVariableTargetToFinalizer | ( | IntVar | var, |
| long | target ) |
Add a variable to set the closest possible to the target value in the
solution finalizer.
Definition at line 1619 of file RoutingModel.java.
| IntBoolPair com.google.ortools.constraintsolver.RoutingModel.addVectorDimension | ( | long[] | values, |
| long | capacity, | ||
| boolean | fix_start_cumul_to_zero, | ||
| String | name ) |
Creates a dimension where the transit variable is constrained to be
equal to 'values[i]' for node i; 'capacity' is the upper bound of
the cumul variables. 'name' is the name used to reference the dimension;
this name is used to get cumul and transit variables from the routing
model.
Returns a pair consisting of an index to the registered unary transit
callback and a bool denoting whether the dimension has been created.
It is false if a dimension with the same name has already been created
(and doesn't create the new dimension but still register a new callback).
Definition at line 733 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.AddWeightedVariableMaximizedByFinalizer | ( | IntVar | var, |
| long | cost ) |
Adds a variable to maximize in the solution finalizer, with a weighted
priority: the higher the more priority it has.
Definition at line 1611 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.AddWeightedVariableMinimizedByFinalizer | ( | IntVar | var, |
| long | cost ) |
Adds a variable to minimize in the solution finalizer, with a weighted
priority: the higher the more priority it has.
Definition at line 1603 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.AddWeightedVariableTargetToFinalizer | ( | IntVar | var, |
| long | target, | ||
| long | cost ) |
Same as above with a weighted priority: the higher the cost, the more
priority it has to be set close to the target value.
Definition at line 1627 of file RoutingModel.java.
| IntVar com.google.ortools.constraintsolver.RoutingModel.applyLocks | ( | SWIGTYPE_p_absl__SpanT_long_const_t | locks | ) |
Applies a lock chain to the next search. 'locks' represents an ordered
vector of nodes representing a partial route which will be fixed during
the next search; it will constrain next variables such that:
next[locks[i]] == locks[i+1].
Returns the next variable at the end of the locked chain; this variable is
not locked. An assignment containing the locks can be obtained by calling
PreAssignment().
Definition at line 1840 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.applyLocksToAllVehicles | ( | long | locks[][], |
| boolean | close_routes ) |
Applies lock chains to all vehicles to the next search, such that locks[p]
is the lock chain for route p. Returns false if the locks do not contain
valid routes; expects that the routes do not contain the depots,
i.e. there are empty vectors in place of empty routes.
If close_routes is set to true, adds the end nodes to the route of each
vehicle and deactivates other nodes.
An assignment containing the locks can be obtained by calling
PreAssignment().
Definition at line 1855 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.arcIsMoreConstrainedThanArc | ( | long | from, |
| long | to1, | ||
| long | to2 ) |
Returns whether the arc from->to1 is more constrained than from->to2,
taking into account, in order:
Definition at line 2524 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.AreRoutesInterdependent | ( | SWIGTYPE_p_operations_research__RoutingSearchParameters | parameters | ) |
Returns true if routes are interdependent. This means that any
modification to a route might impact another.
Definition at line 2657 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.assignmentToRoutes | ( | Assignment | assignment, |
| long | routes[][] ) |
Converts the solution in the given assignment to routes for all vehicles.
Expects that assignment contains a valid solution (i.e. routes for all
vehicles end with an end index for that vehicle).
Definition at line 1942 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.CancelSearch | ( | ) |
Cancels the current search.
Definition at line 2608 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.CheckIfAssignmentIsFeasible | ( | Assignment | assignment, |
| boolean | call_at_solution_monitors ) |
Returns a vector cumul_bounds, for which cumul_bounds[i][j] is a pair
containing the minimum and maximum of the CumulVar of the jth node on
route i.
Definition at line 2546 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.checkLimit | ( | ) |
Returns true if the search limit has been crossed with the given time
offset.
Definition at line 2571 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.checkLimit | ( | SWIGTYPE_p_absl__Duration | offset | ) |
Returns true if the search limit has been crossed with the given time
offset.
Definition at line 2563 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.closeModel | ( | ) |
Closes the current routing model; after this method is called, no
modification to the model can be done, but RoutesToAssignment becomes
available. Note that CloseModel() is automatically called by Solve() and
other methods that produce solution.
This is equivalent to calling
CloseModelWithParameters(DefaultRoutingSearchParameters()).
Definition at line 1639 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.closeModelWithParameters | ( | com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters | ) |
Same as above taking search parameters (as of 10/2015 some the parameters
have to be set when closing the model).
Definition at line 1647 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.compactAndCheckAssignment | ( | Assignment | assignment | ) |
Same as CompactAssignment() but also checks the validity of the final
compact solution; if it is not valid, no attempts to repair it are made
(instead, the method returns nullptr).
Definition at line 1979 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.compactAssignment | ( | Assignment | assignment | ) |
Converts the solution in the given assignment to routes for all vehicles.
If the returned vector is route_indices, route_indices[i][j] is the index
for jth location visited on route i. Note that contrary to
AssignmentToRoutes, the vectors do include start and end locations.
Returns a compacted version of the given assignment, in which all vehicles
with id lower or equal to some N have non-empty routes, and all vehicles
with id greater than N have empty routes. Does not take ownership of the
returned object.
If found, the cost of the compact assignment is the same as in the
original assignment and it preserves the values of 'active' variables.
Returns nullptr if a compact assignment was not found.
This method only works in homogenous mode, and it only swaps equivalent
vehicles (vehicles with the same start and end nodes). When creating the
compact assignment, the empty plan is replaced by the route assigned to
the compatible vehicle with the highest id. Note that with more complex
constraints on vehicle variables, this method might fail even if a compact
solution exists.
This method changes the vehicle and dimension variables as necessary.
While compacting the solution, only basic checks on vehicle variables are
performed; if one of these checks fails no attempts to repair it are made
(instead, the method returns nullptr).
Definition at line 1969 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.computeLowerBound | ( | ) |
Computes a lower bound to the routing problem solving a linear assignment
problem. The routing model must be closed before calling this method.
Note that problems with node disjunction constraints (including optional
nodes) and non-homogenous costs are not supported (the method returns 0 in
these cases).
Definition at line 1797 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.costsAreHomogeneousAcrossVehicles | ( | ) |
Whether costs are homogeneous across all vehicles.
Definition at line 2374 of file RoutingModel.java.
| IntVar com.google.ortools.constraintsolver.RoutingModel.costVar | ( | ) |
Returns the global cost variable which is being minimized.
Definition at line 2358 of file RoutingModel.java.
| SWIGTYPE_p_std__functionT_FloatSlopePiecewiseLinearFunction_const_pflong_longF_t com.google.ortools.constraintsolver.RoutingModel.CumulDependentTransitCallback | ( | int | callback_index | ) |
Definition at line 650 of file RoutingModel.java.
| String com.google.ortools.constraintsolver.RoutingModel.debugOutputAssignment | ( | Assignment | solution_assignment, |
| String | dimension_to_print ) |
Print some debugging information about an assignment, including the
feasible intervals of the CumulVar for dimension "dimension_to_print"
at each step of the routes.
If "dimension_to_print" is omitted, all dimensions will be printed.
Definition at line 2534 of file RoutingModel.java.
| synchronized void com.google.ortools.constraintsolver.RoutingModel.delete | ( | ) |
Definition at line 59 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.enable_deep_serialization | ( | ) |
Returns the value of the internal enable_deep_serialization_ parameter.
Definition at line 1826 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.end | ( | int | vehicle | ) |
Returns the variable index of the ending node of a vehicle route.
Definition at line 2233 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.FastSolveFromAssignmentWithParameters | ( | Assignment | assignment, |
| com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters, | ||
| boolean | check_solution_in_cp ) |
Improves a given assignment using unchecked local search.
If check_solution_in_cp is true the final solution will be checked with
the CP solver.
As of 11/2023, only works with greedy descent.
Definition at line 1740 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.FastSolveFromAssignmentWithParameters | ( | Assignment | assignment, |
| com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters, | ||
| boolean | check_solution_in_cp, | ||
| SWIGTYPE_p_absl__flat_hash_setT_operations_research__IntVar_p_t | touched ) |
Improves a given assignment using unchecked local search.
If check_solution_in_cp is true the final solution will be checked with
the CP solver.
As of 11/2023, only works with greedy descent.
Definition at line 1729 of file RoutingModel.java.
|
protected |
Definition at line 55 of file RoutingModel.java.
| long[] com.google.ortools.constraintsolver.RoutingModel.getAmortizedLinearCostFactorOfVehicles | ( | ) |
Definition at line 1487 of file RoutingModel.java.
| long[] com.google.ortools.constraintsolver.RoutingModel.getAmortizedQuadraticCostFactorOfVehicles | ( | ) |
Definition at line 1491 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getArcCostForClass | ( | long | from_index, |
| long | to_index, | ||
| long | cost_class_index ) |
Returns the cost of the segment between two nodes for a given cost
class. Input are variable indices of nodes and the cost class.
Unlike GetArcCostForVehicle(), if cost_class is kNoCost, then the
returned cost won't necessarily be zero: only some of the components
of the cost that depend on the cost class will be omited. See the code
for details.
Definition at line 2402 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getArcCostForFirstSolution | ( | long | from_index, |
| long | to_index ) |
Returns the cost of the arc in the context of the first solution strategy.
This is typically a simplification of the actual cost; see the .cc.
Definition at line 2390 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getArcCostForVehicle | ( | long | from_index, |
| long | to_index, | ||
| long | vehicle ) |
Returns the cost of the transit arc between two nodes for a given vehicle.
Input are variable indices of node. This returns 0 if vehicle < 0.
Definition at line 2367 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getCostClassesCount | ( | ) |
Returns the number of different cost classes in the model.
Definition at line 2424 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getCostClassIndexOfVehicle | ( | long | vehicle | ) |
Get the cost class index of the given vehicle.
Definition at line 2409 of file RoutingModel.java.
|
static |
Definition at line 38 of file RoutingModel.java.
| SWIGTYPE_p_std__optionalT_operations_research__RoutingModel__PickupDeliveryPosition_t com.google.ortools.constraintsolver.RoutingModel.GetDeliveryPosition | ( | long | node_index | ) |
Returns the pickup and delivery positions where the node is a delivery.
Definition at line 1219 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getDepot | ( | ) |
Returns the variable index of the first starting or ending node of all
routes. If all routes start and end at the same node (single depot), this
is the node returned.
Definition at line 1390 of file RoutingModel.java.
| RoutingDimension com.google.ortools.constraintsolver.RoutingModel.getDimensionOrDie | ( | String | dimension_name | ) |
Returns a dimension from its name. Dies if the dimension does not exist.
Definition at line 810 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.GetDimensionResourceGroupIndex | ( | RoutingDimension | dimension | ) |
Returns the index of the resource group attached to the dimension.
DCHECKS that there's exactly one resource group for this dimension.
Definition at line 869 of file RoutingModel.java.
| int[] com.google.ortools.constraintsolver.RoutingModel.GetDimensionResourceGroupIndices | ( | RoutingDimension | dimension | ) |
Returns the indices of resource groups for this dimension. This method can
only be called after the model has been closed.
Definition at line 861 of file RoutingModel.java.
| SWIGTYPE_p_std__vectorT_operations_research__RoutingDimension_const_p_t com.google.ortools.constraintsolver.RoutingModel.GetDimensionsWithGlobalCumulOptimizers | ( | ) |
Returns the dimensions which have [global|local]_dimension_optimizers_.
Definition at line 762 of file RoutingModel.java.
| SWIGTYPE_p_std__vectorT_operations_research__RoutingDimension_const_p_t com.google.ortools.constraintsolver.RoutingModel.GetDimensionsWithLocalCumulOptimizers | ( | ) |
Definition at line 766 of file RoutingModel.java.
| int[] com.google.ortools.constraintsolver.RoutingModel.getDisjunctionIndices | ( | long | index | ) |
Returns the indices of the disjunctions to which an index belongs.
Definition at line 983 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getDisjunctionMaxCardinality | ( | int | index | ) |
Returns the maximum number of possible active nodes of the node
disjunction of index 'index'.
Definition at line 1006 of file RoutingModel.java.
| long[] com.google.ortools.constraintsolver.RoutingModel.GetDisjunctionNodeIndices | ( | int | index | ) |
Returns the variable indices of the nodes in the disjunction of index
'index'.
Definition at line 991 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getDisjunctionPenalty | ( | int | index | ) |
Returns the penalty of the node disjunction of index 'index'.
Definition at line 998 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.GetDisjunctionPenaltyCostBehavior | ( | int | index | ) |
Returns the PenaltyCostBehavior used by the disjunction of index
'index'.
Definition at line 1014 of file RoutingModel.java.
| SWIGTYPE_p_std__optionalT_long_t com.google.ortools.constraintsolver.RoutingModel.GetFirstMatchingPickupDeliverySibling | ( | long | node, |
| SWIGTYPE_p_std__functionT_bool_flongF_t | is_match ) |
Definition at line 1258 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.GetFirstSolutionHint | ( | ) |
Returns the current hint assignment.
Definition at line 1529 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getFixedCostOfVehicle | ( | int | vehicle | ) |
Returns the route fixed cost taken into account if the route of the
vehicle is not empty, aka there's at least one node on the route other
than the first and last nodes.
Definition at line 1447 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getHomogeneousCost | ( | long | from_index, |
| long | to_index ) |
Returns the cost of the segment between two nodes supposing all vehicle
costs are the same (returns the cost for the first vehicle otherwise).
Definition at line 2382 of file RoutingModel.java.
|
static |
Constant used to express the "no dimension" index, returned when a
dimension name does not correspond to an actual dimension.
Definition at line 598 of file RoutingModel.java.
|
static |
Constant used to express the "no disjunction" index, returned when a node
does not appear in any disjunction.
Definition at line 590 of file RoutingModel.java.
|
static |
Constant used to express a hard constraint instead of a soft penalty.
Definition at line 582 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.GetMaximumNumberOfActiveVehicles | ( | ) |
Returns the maximum number of active vehicles.
Definition at line 1407 of file RoutingModel.java.
| SWIGTYPE_p_std__atomicT_bool_t com.google.ortools.constraintsolver.RoutingModel.GetMutableCPInterrupt | ( | ) |
Returns the atomic<bool> to stop the CP solver.
Definition at line 2600 of file RoutingModel.java.
| SWIGTYPE_p_std__atomicT_bool_t com.google.ortools.constraintsolver.RoutingModel.GetMutableCPSatInterrupt | ( | ) |
Returns the atomic<bool> to stop the CP-SAT solver.
Definition at line 2592 of file RoutingModel.java.
| RoutingDimension com.google.ortools.constraintsolver.RoutingModel.getMutableDimension | ( | String | dimension_name | ) |
Returns a dimension from its name. Returns nullptr if the dimension does
not exist.
Definition at line 818 of file RoutingModel.java.
| SWIGTYPE_p_operations_research__GlobalDimensionCumulOptimizer com.google.ortools.constraintsolver.RoutingModel.GetMutableGlobalCumulLPOptimizer | ( | RoutingDimension | dimension | ) |
Returns the global/local dimension cumul optimizer for a given dimension,
or nullptr if there is none.
Definition at line 785 of file RoutingModel.java.
| SWIGTYPE_p_operations_research__GlobalDimensionCumulOptimizer com.google.ortools.constraintsolver.RoutingModel.GetMutableGlobalCumulMPOptimizer | ( | RoutingDimension | dimension | ) |
Definition at line 790 of file RoutingModel.java.
| SWIGTYPE_p_operations_research__LocalDimensionCumulOptimizer com.google.ortools.constraintsolver.RoutingModel.GetMutableLocalCumulLPOptimizer | ( | RoutingDimension | dimension | ) |
Definition at line 795 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getNonZeroCostClassesCount | ( | ) |
Ditto, minus the 'always zero', built-in cost class.
Definition at line 2431 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getNumberOfDecisionsInFirstSolution | ( | com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters | ) |
Returns statistics on first solution search, number of decisions sent to
filters, number of decisions rejected by filters.
Definition at line 2638 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getNumberOfDisjunctions | ( | ) |
Returns the number of node disjunctions in the model.
Definition at line 1021 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.getNumberOfRejectsInFirstSolution | ( | com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters | ) |
Definition at line 2642 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.GetNumberOfSoftSameVehicleConstraints | ( | ) |
Returns the number of soft same vehicle constraints in the model.
Definition at line 1066 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getNumberOfVisitTypes | ( | ) |
Definition at line 1282 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getNumOfSingletonNodes | ( | ) |
Returns the number of non-start/end nodes which do not appear in a
pickup/delivery pair.
Definition at line 1254 of file RoutingModel.java.
| RoutingModel.NodeNeighborsByCostClass com.google.ortools.constraintsolver.RoutingModel.GetOrCreateNodeNeighborsByCostClass | ( | double | neighbors_ratio, |
| long | min_neighbors, | ||
| SWIGTYPE_p_double | neighbors_ratio_used ) |
Returns neighbors of all nodes for every cost class. The result is cached
and is computed once. The number of neighbors considered is based on a
ratio of non-vehicle nodes, specified by neighbors_ratio, with a minimum
of min-neighbors node considered.
Definition at line 2197 of file RoutingModel.java.
| RoutingModel.NodeNeighborsByCostClass com.google.ortools.constraintsolver.RoutingModel.GetOrCreateNodeNeighborsByCostClass | ( | double | neighbors_ratio, |
| long | min_neighbors, | ||
| SWIGTYPE_p_double | neighbors_ratio_used, | ||
| boolean | add_vehicle_starts_to_neighbors ) |
Returns neighbors of all nodes for every cost class. The result is cached
and is computed once. The number of neighbors considered is based on a
ratio of non-vehicle nodes, specified by neighbors_ratio, with a minimum
of min-neighbors node considered.
Definition at line 2186 of file RoutingModel.java.
| RoutingModel.NodeNeighborsByCostClass com.google.ortools.constraintsolver.RoutingModel.GetOrCreateNodeNeighborsByCostClass | ( | double | neighbors_ratio, |
| long | min_neighbors, | ||
| SWIGTYPE_p_double | neighbors_ratio_used, | ||
| boolean | add_vehicle_starts_to_neighbors, | ||
| boolean | add_vehicle_ends_to_neighbors ) |
Returns neighbors of all nodes for every cost class. The result is cached
and is computed once. The number of neighbors considered is based on a
ratio of non-vehicle nodes, specified by neighbors_ratio, with a minimum
of min-neighbors node considered.
Definition at line 2175 of file RoutingModel.java.
| RoutingModel.NodeNeighborsByCostClass com.google.ortools.constraintsolver.RoutingModel.GetOrCreateNodeNeighborsByCostClass | ( | double | neighbors_ratio, |
| long | min_neighbors, | ||
| SWIGTYPE_p_double | neighbors_ratio_used, | ||
| boolean | add_vehicle_starts_to_neighbors, | ||
| boolean | add_vehicle_ends_to_neighbors, | ||
| boolean | only_sort_neighbors_for_partial_neighborhoods ) |
Returns neighbors of all nodes for every cost class. The result is cached
and is computed once. The number of neighbors considered is based on a
ratio of non-vehicle nodes, specified by neighbors_ratio, with a minimum
of min-neighbors node considered.
Definition at line 2164 of file RoutingModel.java.
| RoutingModel.NodeNeighborsByCostClass com.google.ortools.constraintsolver.RoutingModel.GetOrCreateNodeNeighborsByCostClass | ( | RoutingModel.NodeNeighborsParameters | params | ) |
Returns parameters.num_neighbors neighbors of all nodes for every cost
class. The result is cached and is computed once.
Definition at line 2206 of file RoutingModel.java.
| int[] com.google.ortools.constraintsolver.RoutingModel.GetPairIndicesOfType | ( | int | type | ) |
Definition at line 1274 of file RoutingModel.java.
| PathsMetadata com.google.ortools.constraintsolver.RoutingModel.GetPathsMetadata | ( | ) |
Definition at line 2700 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getPickupAndDeliveryPolicyOfVehicle | ( | int | vehicle | ) |
Definition at line 1246 of file RoutingModel.java.
| SWIGTYPE_p_std__optionalT_operations_research__RoutingModel__PickupDeliveryPosition_t com.google.ortools.constraintsolver.RoutingModel.GetPickupPosition | ( | long | node_index | ) |
Returns the pickup and delivery positions where the node is a pickup.
Definition at line 1212 of file RoutingModel.java.
| String com.google.ortools.constraintsolver.RoutingModel.getPrimaryConstrainedDimension | ( | ) |
Get the primary constrained dimension, or an empty string if it is unset.
Definition at line 836 of file RoutingModel.java.
| SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t com.google.ortools.constraintsolver.RoutingModel.GetRequiredTypeAlternativesWhenAddingType | ( | int | type | ) |
Returns the set of requirement alternatives when adding the given type.
Definition at line 1343 of file RoutingModel.java.
| SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t com.google.ortools.constraintsolver.RoutingModel.GetRequiredTypeAlternativesWhenRemovingType | ( | int | type | ) |
Returns the set of requirement alternatives when removing the given type.
Definition at line 1350 of file RoutingModel.java.
| RoutingModel.ResourceGroup com.google.ortools.constraintsolver.RoutingModel.GetResourceGroup | ( | int | rg_index | ) |
Definition at line 852 of file RoutingModel.java.
| SWIGTYPE_p_std__vectorT_std__unique_ptrT_operations_research__RoutingModel__ResourceGroup_t_t com.google.ortools.constraintsolver.RoutingModel.GetResourceGroups | ( | ) |
Definition at line 848 of file RoutingModel.java.
| SWIGTYPE_p_std__optionalT_long_t com.google.ortools.constraintsolver.RoutingModel.GetRouteCost | ( | long[] | route | ) |
Definition at line 1495 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.GetSameActivityGroupOfIndex | ( | int | node | ) |
Returns the same activity group of the node.
Definition at line 2475 of file RoutingModel.java.
| int[] com.google.ortools.constraintsolver.RoutingModel.GetSameActivityGroups | ( | ) |
Returns same activity groups of all nodes.
Definition at line 2482 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.GetSameActivityGroupsCount | ( | ) |
Returns the number of same activity groups.
Definition at line 2489 of file RoutingModel.java.
| int[] com.google.ortools.constraintsolver.RoutingModel.GetSameActivityIndicesOfGroup | ( | int | group | ) |
Returns variable indices of nodes in the same activity group.
Definition at line 2496 of file RoutingModel.java.
| int[] com.google.ortools.constraintsolver.RoutingModel.GetSameActivityIndicesOfIndex | ( | int | node | ) |
Returns variable indices of nodes constrained to have the same activity.
Definition at line 2468 of file RoutingModel.java.
| SWIGTYPE_p_std__vectorT_std__pairT_long_long_t_t com.google.ortools.constraintsolver.RoutingModel.GetSameVehicleClassArcs | ( | long | from_index, |
| long | to_index ) |
Returns all arcs which are equivalent to the {from_index, to_index} arc
wrt vehicle classes. Arcs will be returned only if from_index is the
start of a vehicle or if to_index is the end of a vehicle. The returned
arcs will then be starting or ending at start or end nodes of vehicles in
the same vehicle class. The input arc is included in the returned vector.
Definition at line 2719 of file RoutingModel.java.
| int[] com.google.ortools.constraintsolver.RoutingModel.getSameVehicleIndicesOfIndex | ( | int | node | ) |
Returns variable indices of nodes constrained to be on the same route.
Definition at line 2457 of file RoutingModel.java.
| int[] com.google.ortools.constraintsolver.RoutingModel.GetSingleNodesOfType | ( | int | type | ) |
Definition at line 1270 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.GetSoftSameVehicleCost | ( | int | index | ) |
Returns the cost of the soft same vehicle constraint of index 'index'.
Definition at line 1081 of file RoutingModel.java.
| long[] com.google.ortools.constraintsolver.RoutingModel.GetSoftSameVehicleIndices | ( | int | index | ) |
Returns the indices of the nodes in the soft same vehicle constraint of
index 'index'.
Definition at line 1074 of file RoutingModel.java.
| SWIGTYPE_p_operations_research__SubSolverStatistics com.google.ortools.constraintsolver.RoutingModel.GetSubSolverStatistics | ( | ) |
Returns detailed search statistics.
Definition at line 1786 of file RoutingModel.java.
| SWIGTYPE_p_absl__flat_hash_setT_int_t com.google.ortools.constraintsolver.RoutingModel.getTemporalTypeIncompatibilitiesOfType | ( | int | type | ) |
Definition at line 1303 of file RoutingModel.java.
| SWIGTYPE_p_std__vectorT_operations_research__RoutingDimension_p_t com.google.ortools.constraintsolver.RoutingModel.GetUnaryDimensions | ( | ) |
Returns dimensions for which all transit evaluators are unary.
Definition at line 755 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getVehicleClassesCount | ( | ) |
Returns the number of different vehicle classes in the model.
Definition at line 2450 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getVehicleClassIndexOfVehicle | ( | long | vehicle | ) |
Definition at line 2435 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.GetVehicleOfClass | ( | int | vehicle_class | ) |
Returns a vehicle of the given vehicle class, and -1 if there are no
vehicles for this class.
Definition at line 2443 of file RoutingModel.java.
| SWIGTYPE_p_std__dequeT_int_t com.google.ortools.constraintsolver.RoutingModel.GetVehiclesOfSameClass | ( | long | start_end_index | ) |
Returns indices of the vehicles which are in the same vehicle class as the
vehicle starting or ending at start_end_index.
Definition at line 2708 of file RoutingModel.java.
| RoutingModel.VehicleTypeContainer com.google.ortools.constraintsolver.RoutingModel.GetVehicleTypeContainer | ( | ) |
Definition at line 2500 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.getVisitType | ( | long | index | ) |
Definition at line 1266 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.GetVisitTypePolicy | ( | long | index | ) |
Definition at line 1278 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.hasDimension | ( | String | dimension_name | ) |
Returns true if a dimension exists for a given dimension name.
Definition at line 803 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.HasGlobalCumulOptimizer | ( | RoutingDimension | dimension | ) |
Returns whether the given dimension has global/local cumul optimizers.
Definition at line 773 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.hasHardTypeIncompatibilities | ( | ) |
Returns true iff any hard (resp. temporal) type incompatibilities have
been added to the model.
Definition at line 1311 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.HasLocalCumulOptimizer | ( | RoutingDimension | dimension | ) |
Definition at line 777 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.HasMandatoryDisjunctions | ( | ) |
Returns true if the model contains mandatory disjunctions (ones with
kNoPenalty as penalty).
Definition at line 1029 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.HasMaxCardinalityConstrainedDisjunctions | ( | ) |
Returns true if the model contains at least one disjunction which is
constrained by its max_cardinality.
Definition at line 1037 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.hasSameVehicleTypeRequirements | ( | ) |
Returns true iff any same-route (resp. temporal) type requirements have
been added to the model.
Definition at line 1358 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.hasTemporalTypeIncompatibilities | ( | ) |
Definition at line 1315 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.hasTemporalTypeRequirements | ( | ) |
Definition at line 1362 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.hasVehicleWithCostClassIndex | ( | int | cost_class_index | ) |
Returns true iff the model contains a vehicle with the given
cost_class_index.
Definition at line 2417 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.ignoreDisjunctionsAlreadyForcedToZero | ( | ) |
SPECIAL: Makes the solver ignore all the disjunctions whose active
variables are all trivially zero (i.e. Max() == 0), by setting their
max_cardinality to 0.
This can be useful when using the BaseBinaryDisjunctionNeighborhood
operators, in the context of arc-based routing.
Definition at line 1048 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.IsDelivery | ( | long | node_index | ) |
Definition at line 1230 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.isEnd | ( | long | index | ) |
Returns true if 'index' represents the last node of a route.
Definition at line 2247 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.isMatchingModel | ( | ) |
Returns true if a vehicle/node matching problem is detected.
Definition at line 2649 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.IsPickup | ( | long | node_index | ) |
Returns whether the node is a pickup (resp. delivery).
Definition at line 1226 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.isStart | ( | long | index | ) |
Returns true if 'index' represents the first node of a route.
Definition at line 2240 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.isVehicleAllowedForIndex | ( | int | vehicle, |
| long | index ) |
Returns true if a vehicle is allowed to visit a given node.
Definition at line 1098 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.isVehicleUsed | ( | Assignment | assignment, |
| int | vehicle ) |
Returns true if the route of 'vehicle' is non empty in 'assignment'.
Definition at line 2271 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.IsVehicleUsedWhenEmpty | ( | int | vehicle | ) |
Definition at line 1503 of file RoutingModel.java.
| DecisionBuilder com.google.ortools.constraintsolver.RoutingModel.makeGuidedSlackFinalizer | ( | RoutingDimension | dimension, |
| LongUnaryOperator | initializer ) |
The next few members are in the public section only for testing purposes.
MakeGuidedSlackFinalizer creates a DecisionBuilder for the slacks of a
dimension using a callback to choose which values to start with.
The finalizer works only when all next variables in the model have
been fixed. It has the following two characteristics:
Definition at line 2675 of file RoutingModel.java.
| DecisionBuilder com.google.ortools.constraintsolver.RoutingModel.makeSelfDependentDimensionFinalizer | ( | RoutingDimension | dimension | ) |
MakeSelfDependentDimensionFinalizer is a finalizer for the slacks of a
self-dependent dimension. It makes an extensive use of the caches of the
state dependent transits.
In detail, MakeSelfDependentDimensionFinalizer returns a composition of a
local search decision builder with a greedy descent operator for the cumul
of the start of each route and a guided slack finalizer. Provided there
are no time windows and the maximum slacks are large enough, once the
cumul of the start of route is fixed, the guided finalizer can find
optimal values of the slacks for the rest of the route in time
proportional to the length of the route. Therefore the composed finalizer
generally works in time O(log(t)*n*m), where t is the latest possible
departute time, n is the number of nodes in the network and m is the
number of vehicles.
Definition at line 2695 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.mutablePreAssignment | ( | ) |
Definition at line 1870 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.next | ( | Assignment | assignment, |
| long | index ) |
Assignment inspection
Returns the variable index of the node directly after the node
corresponding to 'index' in 'assignment'.
Definition at line 2264 of file RoutingModel.java.
| IntVar[] com.google.ortools.constraintsolver.RoutingModel.nexts | ( | ) |
Returns all next variables of the model, such that Nexts(i) is the next
variable of the node corresponding to i.
Definition at line 2279 of file RoutingModel.java.
| IntVar com.google.ortools.constraintsolver.RoutingModel.nextVar | ( | long | index | ) |
Returns the next variable of the node corresponding to index. Note that
NextVar(index) == index is equivalent to ActiveVar(index) == 0.
Definition at line 2304 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.nodes | ( | ) |
Sizes and indices
Returns the number of nodes in the model.
Definition at line 2616 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.objective_lower_bound | ( | ) |
Returns the current lower bound found by internal solvers during the
search.
Definition at line 1805 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.preAssignment | ( | ) |
Returns an assignment used to fix some of the variables of the problem.
In practice, this assignment locks partial routes of the problem. This
can be used in the context of locking the parts of the routes which have
already been driven in online routing problems.
Definition at line 1865 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.readAssignment | ( | String | file_name | ) |
Reads an assignment from a file and returns the current solution.
Returns nullptr if the file cannot be opened or if the assignment is not
valid.
Definition at line 1889 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.readAssignmentFromRoutes | ( | long | routes[][], |
| boolean | ignore_inactive_indices ) |
Restores the routes as the current solution. Returns nullptr if the
solution cannot be restored (routes do not contain a valid solution). Note
that calling this method will run the solver to assign values to the
dimension variables; this may take considerable amount of time, especially
when using dimensions with slack.
Definition at line 1910 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.RegisterCumulDependentTransitCallback | ( | SWIGTYPE_p_std__functionT_FloatSlopePiecewiseLinearFunction_const_pflong_longF_t | callback | ) |
Definition at line 646 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.registerTransitCallback | ( | LongBinaryOperator | callback | ) |
Definition at line 642 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.registerTransitCallback | ( | LongBinaryOperator | callback, |
| int | sign ) |
Definition at line 638 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.registerTransitMatrix | ( | long | values[][] | ) |
Definition at line 634 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.registerUnaryTransitCallback | ( | LongUnaryOperator | callback | ) |
Definition at line 630 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.registerUnaryTransitCallback | ( | LongUnaryOperator | callback, |
| int | sign ) |
Definition at line 626 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.registerUnaryTransitVector | ( | long[] | values | ) |
Registers 'callback' and returns its index.
The sign parameter allows to notify the solver that the callback only
return values of the given sign. This can help the solver, but passing
an incorrect sign may crash in non-opt compilation mode, and yield
incorrect results in opt.
Definition at line 622 of file RoutingModel.java.
| IntVar com.google.ortools.constraintsolver.RoutingModel.ResourceVar | ( | int | vehicle, |
| int | resource_group ) |
Returns the resource variable for the given vehicle index in the given
resource group. If a vehicle doesn't require a resource from the
corresponding resource group, then ResourceVar(v, r_g) == -1.
Definition at line 2350 of file RoutingModel.java.
| IntVar[] com.google.ortools.constraintsolver.RoutingModel.ResourceVars | ( | int | resource_group | ) |
Returns vehicle resource variables for a given resource group, such that
ResourceVars(r_g)[v] is the resource variable for vehicle 'v' in resource
group 'r_g'.
Definition at line 2296 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.restoreAssignment | ( | Assignment | solution | ) |
Restores an assignment as a solution in the routing model and returns the
new solution. Returns nullptr if the assignment is not valid.
Definition at line 1898 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.routesToAssignment | ( | long | routes[][], |
| boolean | ignore_inactive_indices, | ||
| boolean | close_routes, | ||
| Assignment | assignment ) |
Fills an assignment from a specification of the routes of the
vehicles. The routes are specified as lists of variable indices that
appear on the routes of the vehicles. The indices of the outer vector in
'routes' correspond to vehicles IDs, the inner vector contains the
variable indices on the routes for the given vehicle. The inner vectors
must not contain the start and end indices, as these are determined by the
routing model. Sets the value of NextVars in the assignment, adding the
variables to the assignment if necessary. The method does not touch other
variables in the assignment. The method can only be called after the model
is closed. With ignore_inactive_indices set to false, this method will
fail (return nullptr) in case some of the route contain indices that are
deactivated in the model; when set to true, these indices will be
skipped. Returns true if routes were successfully
loaded. However, such assignment still might not be a valid
solution to the routing problem due to more complex constraints;
it is advisible to call solver()->CheckSolution() afterwards.
Definition at line 1933 of file RoutingModel.java.
| RoutingSearchStats com.google.ortools.constraintsolver.RoutingModel.search_stats | ( | ) |
Returns search statistics.
Definition at line 1819 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setAllowedVehiclesForIndex | ( | SWIGTYPE_p_absl__SpanT_int_const_t | vehicles, |
| long | index ) |
Sets the vehicles which can visit a given node. If the node is in a
disjunction, this will not prevent it from being unperformed.
Specifying an empty vector of vehicles has no effect (all vehicles
will be allowed to visit the node).
Definition at line 1091 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setAmortizedCostFactorsOfAllVehicles | ( | long | linear_cost_factor, |
| long | quadratic_cost_factor ) |
The following methods set the linear and quadratic cost factors of
vehicles (must be positive values). The default value of these parameters
is zero for all vehicles.
When set, the cost_ of the model will contain terms aiming at reducing the
number of vehicles used in the model, by adding the following to the
objective for every vehicle v:
INDICATOR(v used in the model) *
[linear_cost_factor_of_vehicle_[v]
Definition at line 1476 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setAmortizedCostFactorsOfVehicle | ( | long | linear_cost_factor, |
| long | quadratic_cost_factor, | ||
| int | vehicle ) |
Sets the linear and quadratic cost factor of the given vehicle.
Definition at line 1483 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setArcCostEvaluatorOfAllVehicles | ( | int | evaluator_index | ) |
Sets the cost function of the model such that the cost of a segment of a
route between node 'from' and 'to' is evaluator(from, to), whatever the
route or vehicle performing the route.
Definition at line 1416 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setArcCostEvaluatorOfVehicle | ( | int | evaluator_index, |
| int | vehicle ) |
Sets the cost function for a given vehicle route.
Definition at line 1423 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setAssignmentFromOtherModelAssignment | ( | Assignment | target_assignment, |
| RoutingModel | source_model, | ||
| Assignment | source_assignment ) |
Given a "source_model" and its "source_assignment", resets
"target_assignment" with the IntVar variables (nexts_, and vehicle_vars_
if costs aren't homogeneous across vehicles) of "this" model, with the
values set according to those in "other_assignment".
The objective_element of target_assignment is set to this->cost_.
Definition at line 1779 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setFirstSolutionEvaluator | ( | LongBinaryOperator | evaluator | ) |
Gets/sets the evaluator used during the search. Only relevant when
RoutingSearchParameters.first_solution_strategy = EVALUATOR_STRATEGY.
Takes ownership of evaluator.
Definition at line 1512 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.SetFirstSolutionHint | ( | Assignment | hint | ) |
Adds a hint to be used by first solution strategies. The hint assignment
must outlive the search.
As of 2024-12, only used by LOCAL_CHEAPEST_INSERTION and
LOCAL_CHEAPEST_COST_INSERTION.
Definition at line 1522 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setFixedCostOfAllVehicles | ( | long | cost | ) |
Sets the fixed cost of all vehicle routes. It is equivalent to calling
SetFixedCostOfVehicle on all vehicle routes.
Definition at line 1431 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setFixedCostOfVehicle | ( | long | cost, |
| int | vehicle ) |
Sets the fixed cost of one vehicle route.
Definition at line 1438 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.SetMaximumNumberOfActiveVehicles | ( | int | max_active_vehicles | ) |
Constrains the maximum number of active vehicles, aka the number of
vehicles which do not have an empty route. For instance, this can be used
to limit the number of routes in the case where there are fewer drivers
than vehicles and that the fleet of vehicle is heterogeneous.
Definition at line 1400 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.SetPathEnergyCostOfVehicle | ( | String | force, |
| String | distance, | ||
| long | cost_per_unit, | ||
| int | vehicle ) |
Definition at line 1451 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.SetPathEnergyCostsOfVehicle | ( | String | force, |
| String | distance, | ||
| long | threshold, | ||
| long | cost_per_unit_below_threshold, | ||
| long | cost_per_unit_above_threshold, | ||
| int | vehicle ) |
Definition at line 1455 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setPickupAndDeliveryPolicyOfAllVehicles | ( | int | policy | ) |
Sets the Pickup and delivery policy of all vehicles. It is equivalent to
calling SetPickupAndDeliveryPolicyOfVehicle on all vehicles.
Definition at line 1238 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setPickupAndDeliveryPolicyOfVehicle | ( | int | policy, |
| int | vehicle ) |
Definition at line 1242 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setPrimaryConstrainedDimension | ( | String | dimension_name | ) |
Set the given dimension as "primary constrained". As of August 2013, this
is only used by ArcIsMoreConstrainedThanArc().
"dimension" must be the name of an existing dimension, or be empty, in
which case there will not be a primary dimension after this call.
Definition at line 829 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.SetVehicleUsedWhenEmpty | ( | boolean | is_used, |
| int | vehicle ) |
Definition at line 1499 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.setVisitType | ( | long | index, |
| int | type, | ||
| int | type_policy ) |
Definition at line 1262 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.size | ( | ) |
Returns the number of next variables in the model.
Definition at line 2630 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.solve | ( | ) |
Solves the current routing model; closes the current model.
This is equivalent to calling
SolveWithParameters(DefaultRoutingSearchParameters())
or
SolveFromAssignmentWithParameters(assignment,<br>
DefaultRoutingSearchParameters()).
Definition at line 1672 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.solve | ( | Assignment | assignment | ) |
Solves the current routing model; closes the current model.
This is equivalent to calling
SolveWithParameters(DefaultRoutingSearchParameters())
or
SolveFromAssignmentWithParameters(assignment,<br>
DefaultRoutingSearchParameters()).
Definition at line 1659 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.SolveFromAssignmentsWithParameters | ( | SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t | assignments, |
| com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters ) |
Same as above but will try all assignments in order as first solutions
until one succeeds.
Definition at line 1758 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.SolveFromAssignmentsWithParameters | ( | SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t | assignments, |
| com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters, | ||
| SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t | solutions ) |
Same as above but will try all assignments in order as first solutions
until one succeeds.
Definition at line 1749 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.solveFromAssignmentWithParameters | ( | Assignment | assignment, |
| com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters ) |
Same as above, except that if assignment is not null, it will be used as
the initial solution.
Definition at line 1718 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.solveFromAssignmentWithParameters | ( | Assignment | assignment, |
| com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters, | ||
| SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t | solutions ) |
Same as above, except that if assignment is not null, it will be used as
the initial solution.
Definition at line 1709 of file RoutingModel.java.
| Solver com.google.ortools.constraintsolver.RoutingModel.solver | ( | ) |
Returns the underlying constraint solver. Can be used to add extra
constraints and/or modify search algorithms.
Definition at line 2554 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.SolveWithIteratedLocalSearch | ( | com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters | ) |
Solves the current routing model by using an Iterated Local Search
approach.
Definition at line 1767 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.solveWithParameters | ( | com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters | ) |
Solves the current routing model with the given parameters. If 'solutions'
is specified, it will contain the k best solutions found during the search
(from worst to best, including the one returned by this method), where k
corresponds to the 'number_of_solutions_to_collect' in
'search_parameters'. Note that the Assignment returned by the method and
the ones in solutions are owned by the underlying solver and should not be
deleted.
Definition at line 1700 of file RoutingModel.java.
| Assignment com.google.ortools.constraintsolver.RoutingModel.solveWithParameters | ( | com.google.ortools.constraintsolver.RoutingSearchParameters | search_parameters, |
| SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t | solutions ) |
Solves the current routing model with the given parameters. If 'solutions'
is specified, it will contain the k best solutions found during the search
(from worst to best, including the one returned by this method), where k
corresponds to the 'number_of_solutions_to_collect' in
'search_parameters'. Note that the Assignment returned by the method and
the ones in solutions are owned by the underlying solver and should not be
deleted.
Definition at line 1686 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.start | ( | int | vehicle | ) |
Model inspection.
Returns the variable index of the starting node of a vehicle route.
Definition at line 2226 of file RoutingModel.java.
| com.google.ortools.constraintsolver.RoutingSearchStatus.Value com.google.ortools.constraintsolver.RoutingModel.status | ( | ) |
Returns the current status of the routing model.
Definition at line 1812 of file RoutingModel.java.
|
static |
Definition at line 42 of file RoutingModel.java.
| SWIGTYPE_p_absl__Duration com.google.ortools.constraintsolver.RoutingModel.TimeBuffer | ( | ) |
Returns the time buffer to safely return a solution.
Definition at line 2585 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.unperformedPenalty | ( | long | var_index | ) |
Get the "unperformed" penalty of a node. This is only well defined if the
node is only part of a single Disjunction, and that disjunction has a
penalty. For forced active nodes returns max int64_t. In all other cases,
this returns 0.
Definition at line 1372 of file RoutingModel.java.
| long com.google.ortools.constraintsolver.RoutingModel.unperformedPenaltyOrValue | ( | long | default_value, |
| long | var_index ) |
Same as above except that it returns default_value instead of 0 when
penalty is not well defined (default value is passed as first argument to
simplify the usage of the method in a callback).
Definition at line 1381 of file RoutingModel.java.
| void com.google.ortools.constraintsolver.RoutingModel.UpdateTimeLimit | ( | SWIGTYPE_p_absl__Duration | time_limit | ) |
Updates the time limit of the search limit.
Definition at line 2578 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.VehicleIndex | ( | long | index | ) |
Returns the vehicle of the given start/end index, and -1 if the given
index is not a vehicle start/end.
Definition at line 2255 of file RoutingModel.java.
| IntVar com.google.ortools.constraintsolver.RoutingModel.VehicleRouteConsideredVar | ( | int | vehicle | ) |
Returns the variable specifying whether or not the given vehicle route is
considered for costs and constraints. It will be equal to 1 iff the route
of the vehicle is not empty OR vehicle_used_when_empty_[vehicle] is true.
Definition at line 2331 of file RoutingModel.java.
| int com.google.ortools.constraintsolver.RoutingModel.vehicles | ( | ) |
Returns the number of vehicle routes in the model.
Definition at line 2623 of file RoutingModel.java.
| IntVar com.google.ortools.constraintsolver.RoutingModel.vehicleVar | ( | long | index | ) |
Returns the vehicle variable of the node corresponding to index. Note that
VehicleVar(index) == -1 is equivalent to ActiveVar(index) == 0.
Definition at line 2340 of file RoutingModel.java.
| IntVar[] com.google.ortools.constraintsolver.RoutingModel.vehicleVars | ( | ) |
Returns all vehicle variables of the model, such that VehicleVars(i) is
the vehicle variable of the node corresponding to i.
Definition at line 2287 of file RoutingModel.java.
| boolean com.google.ortools.constraintsolver.RoutingModel.writeAssignment | ( | String | file_name | ) |
Writes the current solution to a file containing an AssignmentProto.
Returns false if the file cannot be opened or if there is no current
solution.
Definition at line 1880 of file RoutingModel.java.
|
static |
When visited, one instance of type 'T' previously added to the route
(TYPE_ADDED_TO_VEHICLE), if any, is removed from the vehicle.
If the type was not previously added to the route or all added instances
have already been removed, this visit has no effect on the types.
Definition at line 2782 of file RoutingModel.java.
|
static |
Definition at line 2748 of file RoutingModel.java.
|
static |
Definition at line 2747 of file RoutingModel.java.
|
static |
Represents the sign of values returned by a transit evaluator.
Definition at line 2746 of file RoutingModel.java.
|
static |
The following enum is used to describe how the penalty cost is computed
when using AddDisjunction.
Definition at line 2756 of file RoutingModel.java.
|
static |
Definition at line 2757 of file RoutingModel.java.
|
static |
Deliveries must be performed in the same order as pickups.
Definition at line 2739 of file RoutingModel.java.
|
static |
Deliveries must be performed in reverse order of pickups.
Definition at line 2735 of file RoutingModel.java.
|
static |
Types of precedence policy applied to pickup and delivery pairs. Any precedence is accepted.
Definition at line 2731 of file RoutingModel.java.
|
protected |
Definition at line 31 of file RoutingModel.java.
|
static |
Set the node visit types and incompatibilities/requirements between the
types (see below).
NOTE: Before adding any incompatibilities and/or requirements on types,
all corresponding node types must have been set.
The following enum is used to describe how a node with a given type 'T'
impacts the number of types 'T' on the route when visited, and thus
determines how temporal incompatibilities and requirements take effect. When visited, the number of types 'T' on the vehicle increases by one.
Definition at line 2775 of file RoutingModel.java.
|
static |
With the following policy, the visit enforces that type 'T' is
considered on the route from its start until this node is visited.
Definition at line 2787 of file RoutingModel.java.
|
static |
The visit doesn't have an impact on the number of types 'T' on the
route, as it's (virtually) added and removed directly.
This policy can be used for visits which are part of an incompatibility
or requirement set without affecting the type count on the route.
Definition at line 2794 of file RoutingModel.java.