Open mvacoyote opened 2 years ago
@MVAC13 In the example, we create the same number or routes as workers.
results = arcgis.features.analysis.plan_routes(breweries_layer, # Feature Layer of Stops
len(workers), # Number of routes to generate
5, # Maximum stops per route
datetime.now(), # Start time of route
start_layer, # The dictionary we created to represent the start location
stop_service_time=60, # How much time in minutes to spend at each stop
max_route_time=480, # The maximum time for the worker to complete the route
)
We then iterate over each route and select a worker, and remove that worker from the possible list of workers to chose (so that a worker only is assigned one route). Then for each stop in the route we create an assignment and assign it to the selected worker.
Then after all assignments for all routes have been created, we add them to the project.
If workers.remove(worker)
was removed, a worker could be assigned to multiple routes which doesn't make sense from a practical standpoint.
Does that help explain it?
It does explain it. Thanks!
Hello, In the 'Optimally Creating and Assigning Work Orders Based on Routes' notebook there is the following code:
I think the line workers.remove(worker) should be removed because then in assignments_to_add.append() the worker=worker will give an error of empty list. Am I wrong?
Thanks