0

Final edit- This turned out to be a bug with routing regression in AnyLogic and is getting fixed in the next update.

I'm developing a town simulation with pedestrian agents moving around it. The GIS region data I use is loaded from a .osm file in foot-traffic mode, and I randomly spawn building agents around the region.

They walk around the city fine at first, but around halfway to their destination, they suddenly fly across the town at high speed in a straight line to where they're going. They seem to arrive at the GIS node closest to the building, and then walk the last couple of meters inside. I believe this occurs with every pedestrian I've tried.

I am using Dijkstra bidirectional path-finding (built-in to AnyLogic). I have tried A* bidirectional with the same results, as well as using a different .osm/.pbf file, and trying it on fast and short route mode with no luck.

I have a feeling it is a bug in the bidirectional pathfinding, however AnyLogic doesn't allow non-bidirectional routing, or a way of implementing your own for GIS regions...

Any ideas would be appreciated.

-edit-

I came back to this bug and have determined it is 100% a path-finding bug. When creating a GIS route between 2 points using the AnyLogic online server, it works as expected and we can see a completed route. However, when using a loaded offline OSM or PBF file (I tried different map sources), I observe that the route it draws goes correctly halfway but then draws a straight line to the node closest to the destination, then a straight line to the destination. I have attached 2 pictures to demonstrate this.

Note that it doesn't make it halfway in distance, it is halfway in node count.

We can see the nodes exist based on the pictures below, but the routing ignores the second half of them. I'm sure it's not a disconnected network, as I tested a lot and sometimes it would route over a section of road fine, but other times it would fail at it.

So I suppose now my question is: how do I prevent or get around this? I tried using a custom GraphHopper router to get around the bidirectional routing and just use regular A* search, but didn't have any luck as the other algorithms I tried just made straight lines.

This is what happens when making the first point at the bottom:

Starting at bottom of road

This is what happens when making the first point at the top:

Starting at top

This is with online routing:

Correct with online

Zen Monkey
  • 101
  • 6
  • 1
    Might also be that you have more than 1 network created and they "fly" from 1 network to the next because there is no connection. Ensure your GIS network is only 1 network, not several – Benjamin Aug 05 '21 at 15:12
  • I downloaded the map data from OSM, unless their network is split I don't think it's this the problem – Zen Monkey Aug 06 '21 at 00:24
  • Additionally, querying the OSM server for pathfinding works fine. I just can't use that because the API calls are too slow – Zen Monkey Aug 06 '21 at 00:32
  • In my experience, you cannot rely on the OSM import to create clean AnyLogic networks. Check in your property tree on Main: are there several networks? – Benjamin Aug 06 '21 at 08:56
  • What am I looking for here? I don't think there are – Zen Monkey Aug 13 '21 at 00:12
  • Projects view under Main, Presentation, level, networks. Or search for "network" in your model. Help has more info as well :) – Benjamin Aug 13 '21 at 05:48
  • I don't think I have these network objects, just a GIS region with routing provided from a PBF file – Zen Monkey Aug 26 '21 at 10:28
  • @Benjamin I updated the post with screenshots and more info. Is this a common bug or am I totally missing something. Happens with all offline routing around a GIS map for me – Zen Monkey Sep 28 '21 at 13:27
  • Could be a bug, but try toying first with the GIS-map settings on LoD (how much to use at which zoom level), maybe related to that? Else check with support@anylogic.com to flag as a bug – Benjamin Sep 28 '21 at 17:50
  • Sorry, by LoD do you mean level of detail? – Zen Monkey Sep 29 '21 at 01:05
  • yes. Check the GIS-map setting Under "Advanced" that is named "Routes & regions generalization rules" and apply absolute precision – Benjamin Sep 29 '21 at 06:55
  • Ah yep. I have already tried that at low and high values, no luck. I submitted a report to AnyLogic support this morning – Zen Monkey Sep 29 '21 at 09:11

2 Answers2

1

as Benjamin already stated, this probably happens because you have multiple networks and routing acts in unpredictable ways sometimes when you have networks that are not defined as you would like.

Search on network on the projects section and be sure there is only 1 network..

For instance in the following image, you see that there are 2 networks... find a way to connect things in order to end up with 1 network...

networks

Felipe
  • 8,311
  • 2
  • 15
  • 31
  • Hey thanks for the help. I don't actually have the networks listed there. I have a GIS Map object in level, and then a GIS Region object in that. I do understand the issue and what needs to be done, I just can't seem to find the blue network objects that you have there. Any idea on how to see these with my configuration, or reconfigure it so I do have it? – Zen Monkey Aug 26 '21 at 09:50
  • if you have only a gisregion, that means you have no gis routes... only gis regions... in which case you are letting anylogic server define the path to take based on the osm server you are using, or the file your are loading... if no route is possible, then they will take straight routes so you will straight line movements – Felipe Aug 26 '21 at 09:56
  • Yeah I'm using a PBF file downloaded from OSM to generate the routing data. At inconsistent points the agents suddenly fly across the map in a straight line at a speed far faster than their walking speed. It's not that a route is not possible, the route can be completed – Zen Monkey Aug 26 '21 at 10:28
  • i wouldn't discard a bug... i think you showing the model is required for this one – Felipe Aug 26 '21 at 11:30
  • I came back to this bug and have determined it is 100% a path-finding bug. When creating a GIS route between 2 points using the AnyLogic online server, it works as expected and we can see a completed route. However, when using a loaded offline OSM or PBF file (I tried different map sources), I observe that the route it draws goes correctly halfway but then draws a straight line to the node closest to the destination, then a straight line to the destination. I have attached a picture to demonstrate this. Note that it doesn't make it halfway in distance, it is halfway in node count. – Zen Monkey Sep 28 '21 at 13:18
0

This was just confirmed by AnyLogic to be a bug in the path-finding regression. It is being fixed in the next update.

Zen Monkey
  • 101
  • 6