Summary
Creates routes in a Vehicle Routing Problem (VRP) layer. This tool will append rows to the Routes sublayer and can add rows with specific settings while creating a unique name field.
Usage
The tool adds routes to the VRP layer with unique names starting with the Route Name Prefix parameter value.
The Start Depot Name and End Depot Name parameter values are based on the name in the Depots layer.
To delete all existing routes and create new routes, check the Append To Existing Routes parameter checkbox(append_to_existing_routes = "CLEAR" in Python).
Syntax
arcpy.na.AddVehicleRoutingProblemRoutes(in_vrp_layer, {number_of_routes}, {route_name_prefix}, {start_depot_name}, {end_depot_name}, {earliest_start_time}, {latest_start_time}, {max_order_count}, {capacities}, {route_constraints}, {costs}, {additional_route_time}, {append_to_existing_routes})
Parameter | Explanation | Data Type |
in_vrp_layer | The vehicle routing problem analysis layer to which routes will be added. | Network Analyst Layer |
number_of_routes (Optional) | The number of routes to add. | Long |
route_name_prefix (Optional) | A qualifier added to the title of every route layer item. For example, a route name prefix WeekdayRoute would be used as the starting text for every route’s name with Object ID appended to it. | String |
start_depot_name (Optional) | The name of the starting depot for the route. If the Start Depot Name value is null, the route will begin from the first order assigned. Omitting the start depot is useful when the vehicle's starting location is unknown or irrelevant to your problem. However, when the Start Depot Name value is null, the End Depot Name value cannot also be null. Virtual start depots are not allowed if orders or depots are in multiple time zones. | String |
end_depot_name (Optional) | The name of the ending depot for the route. If the End Depot Name value is null, the route will end at the last order assigned. When the End Depot Name value is null, the Start Depot Name value cannot also be null. | String |
earliest_start_time (Optional) | The earliest allowable start time for the route. This parameter is used by the solver in conjunction with the time window of the starting depot, provided in the Depots layer by the TimeWindowStart field, for determining feasible route start times. This parameter has a default time-only value of 8:00:00 a.m., interpreted as 8:00:00 a.m. on the date given by the Default Date property of the analysis layer. If no value is specified, the default value is used. | Date |
latest_start_time (Optional) | The latest allowable start time for the route. This parameter has a default time-only value of 10:00:00 a.m., interpreted as 10:00:00 a.m. on the date provided by the Default Date property of the analysis layer. If no value is specified, the default value is used. | Date |
max_order_count (Optional) | The maximum allowable number of orders on the route. The default value is 30. If no value is specified, the default value is used. | Long |
capacities [capacities,...] (Optional) |
The maximum amount (volume, weight, quantity, and so on) that can be carried by the vehicle. A null value is the same as zero. A maximum of nine capacity fields are allowed, but use only the number necessary to model the needs of the vehicles. | Value Table |
route_constraints [route_constraints,...] (Optional) |
The constraints placed on routes to limit total time, total travel time, and total distance.
| Value Table |
costs [costs,...] (Optional) | The costs incurred by the route in a VRP solution.
| Value Table |
additional_route_time [additional_route_time,...] (Optional) |
Additional route time options.
| Value Table |
append_to_existing_routes (Optional) | Specifies whether new routes will be appended to the existing routes attribute table.
| Boolean |
Derived Output
Name | Explanation | Data Type |
out_vrp_layer | The updated network analyst layer. | Network Analyst Layer |
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes