question

Shinya O avatar image
0 Likes"
Shinya O asked Shinya O commented

Searching for a route with Freight Railways may fail

Hi,

Searching for a route with Freight Railways may fail as below.

1700033099219.png

The Freight Railway route search between two points on the left is working, but on the right I have the same settings, but it's not working.

Is there a way to check if the search failed? What else can you think of?

Thanks in advance.

FlexSim 23.0.11
gisroutingfreight railwayrailway
1700033099219.png (696.0 KiB)
5 |100000

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

1 Answer

Jonah K avatar image
0 Likes"
Jonah K answered Shinya O commented

Currently the GIS Navigator does not notify the user if a route search failed, but I will submit this issue to the dev team. In the meantime, there is a way you can check if a route search was successful, though it is a bit tedious:

If the GIS Navigator successfully generates a route, it will create one or multiple subnodes in the webResponses variable (i.e. a new web Response node means a new route was successfully generated). You can check if the number of webResponses has changed with this script:

treenode UpdateCount = model().subnodes.assert("UpdateCount", 0);
int numUpdates = UpdateCount.value;
treenode webResponses = getvarnode(Model.find("GISNavigator"), "webResponses");
int responses = webResponses.subnodes.length;

if (numUpdates == responses){
return "Up To Date";
} else {
UpdateCount.value = responses;
return "UPDATED";
}


By alternating between selecting "Update" and "Run Script", you can check if your proposed map points yielded any successful routes. It will return "Up To Date" if there are no new web responses (i.e. no route was found) and will return "UPDATED" if there has been a new web response since the last time you ran the script.

1700678011230.png

I know this solution isn't very straightforward, but hopefully it helps you get closer to your goal. And again, I will submit this issue to the development team so hopefully we can make a cleaner solution in the future.


1700678011230.png (264.3 KiB)
· 4
5 |100000

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

Shinya O avatar image Shinya O commented ·

Thank you. Now I know how to check if the route search was successful. However, in certain regions (e.g. Japan), route searche fails no matter how many times I update it. In other regions (e.g. China) the route search is successful. Does this suggest that Japanese freight railways may not be registered on the routing server?

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Shinya O commented ·

There seem to be Japanese freight railways registered on the routing server:

1701097587870.png

japan_freight.fsm

It seems several of those paths aren't connected directly to each other in the mapping data, and you need to use intermediate points to switch paths.

0 Likes 0 ·
1701097587870.png (668.5 KiB)
japan-freight.fsm (2.0 MiB)
Phil BoBo avatar image Phil BoBo ♦♦ Phil BoBo ♦♦ commented ·

These routes seem to match up with the map at https://japanmap360.com/japan-train-map:

1701108891632.webp

Based on that website's information, these lines provide service for both passengers and freight.

0 Likes 0 ·
1701108891632.webp (103.3 KiB)
Show more comments