Skip to main content

The goal is to make the shortest paths for the first salesman for first day of work, then the second salesman for the first day of work, then the third salesman for the first day of work, then move to the second day, and repeat. 

 

  • Days = User Parameter on # of days to iterate
  • Sum_Total_Time= the work + travel time for the combine paths for that salesman for that day.
    • Each salesman can work a maximum of 3 hours per day (total_time).
    • I have calculated the work, travel, and combined time per path per salesman.

 

Set Work_Date = today

Set total_time = 0

Set Sum_Total_Time = 0

Set day = 0

If Day =< Days

 Then

    For Salesman in Salesmen:

     Set WorkDate = WorkDate + Day

         If Sum_Total_Time =< 3

               From_Node = Salesman_Location

               TestFilter = Days_Since_Visited > = Target_Days_Since_Visited

               Spatial_Filter Topology Nodes inside Salesman Boundary

               NearestNeighbor From_Node to Topo_Nodes

               Shortest_Path

               AttributeCreator (Path_ID, Work_Time, Travel_Time, Total_Time, Day, Work_Date)

             Update Days_Since_Visited = 0

               Update SalesmanLocation = last node in path not equal to From_Node

                 For Path in Paths

                  Sum_Total_Time = sum(Total_Time)

         Else

               Day = Day +1

 

I have the basic workbench working, i.e. I am reading the current location of all the salesmen, doing the nearestneighbor, and creating the shortestpath, but I need to figure out how to loop them and combine them.                 

You can achieve this without needing to loop. Assuming:

  • 3 workers
  • Each working 5 days
  • The list of jobs can be grouped/filtered by worker and day to complete

 

Each worker works 5 days so that means there are 15 days to be worked (think of these as 15 separate features) the first feature will be Worker 1 Day 1, next will be Worker 1 Day 2 ......through to....... Worker 3 Day 5

 

In the jobs data ,you will have a field that has the worker and the day of the job (these need to be named the same as they are in the worker data)

 

Then pass all the jobs into the nearestneighbor and set the group by to the worker and day fields. This will result in worker 1 day 1 only being compared to jobs that are set for worker 1 on day 1

 


Reply