question

Mischa Spelt avatar image
0 Likes"
Mischa Spelt asked Jason Lightfoot commented

Travel to dynamic GIS location

Hi,

Based on this post I am dynamically creating GIS routes, which I know I'm probably not supposed to do :-)

The route update seems to work fine: in the attached GIS_demo.fsm the GetGISDuration user command synchronously waits for the route update, if needed, then returns the duration of the trip between A and B.

The problem in this model seems to be when I try to send a Task Executer down the newly executed path. To reproduce:

  • Call InitializeGISPoints to create some new points on the map.
  • Reset and Run the model.
    • You'll get an exception the first time a token enters the Travel task.
    • Note that the TravelTime label, which is the requested duration, is shown correctly.
  • Reset and Run again.
    • You'll notice that this time, the TE correctly travels down the indicated path.
    • The same exception now happens for the second leg, which did not exist yet.
  • When run again, all previously seen paths will work correctly but new ones do not.

I'm hoping there's a simple event function I can call to fix this... please help? :-)

FlexSim 24.0.1
task executergis navigatordynamic routing
gis-demo.fsm (90.8 KiB)
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·
@Mischa Spelt, can you update the link for "this post". Unfortunately it is internally stated as "isPasted" and this leads to nowhere. Thank you!
0 Likes 0 ·
Tomi Kosunen avatar image Tomi Kosunen commented ·

@Mischa Spelt This topic interests me and that is why I am commenting on it. I am successfully utilizing the example approach. In my model I create a number of Points in the OnReset. The ponts are connected as pairs: start point and end point. The "point pairs" are used for any transfer during the simulation run. When a transportation task is created, I choose the first free "point pair", move the start and end points to correct locations, download the route and that's about it.

I also installed internal Routing server (osrm) on a desktop. The response time to routing queries is much faster now (as I send thousands of queries during the simulation run). It is still wice to use the route cache if it is possible to find the required route from there as the queries make the simulation run slower.

The only problem I had, was that the code line "function_s(navigator, "storeWebResponse", url, response.value)" randomly (not often) returns empty and I have to send the query twice. I'm assuming that the problem is in the Routing Server, that has lack of a memory.

Good luck with the gis simulations!


0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

Hi @Mischa Spelt, was Phil BoBo's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Phil BoBo avatar image
0 Likes"
Phil BoBo answered

The routing table for the GIS navigator is only updated on reset. You shouldn't be dynamically creating new connections between points during the model run.

If you want to have dynamically calculated routes during the model run, follow the example in the post you linked to: Update an existing connection route rather than creating new ones.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.