Today I unbury old scripts from my archives, and I post them here and on my GitHub.
This script illustrates how to integrate the M3 Delivery Toolbox – MWS410/B with OptiMap – Fastest Roundtrip Solver to calculate and show on Google Maps the fastest roundtrip from the Warehouse to the selected Delivery addresses; it’s an application of the Traveling Salesman Problem (TSP) to M3. This is interesting for a company to reduce overall driving time and cost, and for a driver to optimize its truck load according to the order of delivery.
OptiMap_V3
The Warehouse (WHLO) is now detected from the selected rows, and its address is dynamically retrieved using API MMS005MI.GetWarehouse; no need to specify the Warehouse address as a parameter anymore.
Create a view in M3 Delivery Toolbox MWS410/B that shows the address fields in the columns (e.g. ADR1, ADR2, ADR3), and set the field names in the parameter of the script.
OptiMap_V4 [PENDING]
Add ability to Export OptiMap’s route to M3 Loading (MULS) and Unloading sequence (SULS) using API MYS450MI.AddDelivery, closing the loop of integrating M3 to OptiMap.
This is an idea for version 4. Script to be developed…
Source code
I posted the source code on my GitHub.
Hey Thibaud. How is it going ? This one is interesting. Your script is working fine. Thinking about v4… Have you ever think about how to retrieve the result from Optimap ? I see we can use labels for our addresses. I don’t understand how you can pass labels in the query; it could be useful if you click later on “export raw path with labels”. At the end, MYS450MI/AddDelivery allows us to update SULS and MULS. If you attach the deliveries to a shipment and print the loading/unloading list in DRS100, the sorting on the printout corresponds to what you have uploaded.
LikeLike
Hi Maxime,
I am doing good thank you. Glad to read you again here.
I do not have plans to develop V4, although I would like to if the opportunity arises. Feel free to develop it yourself and publish it here if you want; that would be great.
As for retrieving the result from OptiMap, it should be possible with the correct HTTP request from the Smart Office script and process the result, instead of simply using LaunchTask.
It is also possible to calculate and visualize the shortest path of a picking list inside the warehouse; see my series on Warehouse Optimization.
As for the labels, I have not explored that. It looks really interesting and would be good to have.
Are you working on something similar at your work? Please come write a blog post about your experience with this topic, the results, new version of the script, or anything that could be useful to others too.
Thanks.
–Thibaud
LikeLike
In fact, you can use labels by adding : namei=xxxx before &loc(i+1)
ex : name0=ADR0&loc0=…&name1=ADR1&loc1=…
The base http request is : http://gebweb.net/optimap/index.php?
Row path with labels result :
ADR0: (46.9431271, 6.8467862999999625)
ADR1: (48.6917395, 6.181768299999931)
ADR3: (48.8426079, 2.3233072000000447)
ADR0: (46.9431271, 6.8467862999999625)
LikeLike
Great! Can you make a Pull Request on GitHub? Otherwise I will add it there. Thanks for sharing!
LikeLike