question

Dj Moens avatar image
4 Likes"
Dj Moens asked Phil BoBo commented

Many nodes make loading the model exremely slow

Hi,

We ran into an issue regarding network nodes. A model containing over 8100 nodes (90x90) takes an awfull long time, whereas a model with about 2500 (50x50) is still reasonable. Attached is a model that cretes a node grid you can use to test. It almost look like it takes quadratic more time as a funtion of the number of nodes instead of linear extra time as would expected..

Is there an internal issue that it takes that long for larger networks. And can it be resloved is there be a workaround?


Rgds

DJ

Testnode2500.fsm

FlexSim 20.0.7
flexsim 20.0.7networknodes
testnode2500.fsm (1.6 MiB)
· 8
5 |100000

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

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

My assumption is that you are talking about the time to calculate the distance table. The network navigator uses Dijkstra's algorithm to calculate the amount of time to get from each network node to each other network node and stores that in its distance table, so that it can quickly calculate travel paths when the model is running. Thus the size of that table is numNodes * numNodes, so if you are making a grid, then that's gridSize ^ 4.

If you are making a grid of nodes, why are you even using network nodes? If you want a grid of locations that can be used for traveling, use A*. A* is literally a grid.

0 Likes 0 ·
Dj Moens avatar image Dj Moens Phil BoBo ♦♦ commented ·

Sorry Phil,

Pressed sent too soon. It is loading of a saved model that takes very long.

Rgds

DJ

0 Likes 0 ·
Dj Moens avatar image Dj Moens Phil BoBo ♦♦ commented ·

It is not the issue of the grid, this was more of an example.

0 Likes 0 ·
Dj Moens avatar image Dj Moens Phil BoBo ♦♦ commented ·

Oh and Dijkstra also does not seem to be the issue as creating the paths reset and run is fast.

I expected the network that contains 4 times as many nodes to load just 4 times slower, but it is much more order 4^2 (16..?)

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

reset after creating 8100 nodes was really slow for me.

1 Like 1 ·
Show more comments
Show more comments

1 Answer

Phil BoBo avatar image
3 Likes"
Phil BoBo answered

I found the issue.

The problem is that the OnOpenModel scripts are explicitly calling optimizenetwork() in MAIN:/project/events/OnOpenModel/refresh stuff.

I'll take that line out for the next bugfix release (as the network itself is handling that in its own resetVariables and doesn't need to be explicitly called by the model open scripts.)

If you want to fix it in the meantime, you can make a module that replaces that node with a version without the optimizenetwork() call.

· 2
5 |100000

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

Dj Moens avatar image Dj Moens commented ·

thanks Phil

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Dj Moens commented ·

Thank you for bringing this to our attention.

0 Likes 0 ·