question

Claire Krupp avatar image
0 Likes"
Claire Krupp asked Zahra Z commented

How to collect aggregate state statistics for People on an AStar network?

I am using the People Module to model many employees walking within a large plant. We need to find out how to measure congestion and compare layouts. I can get statistics on their walk-times using zones with partitions for their work locations (which is a label). That works very nicely.

But how do I find a way to measure congestion?

I would like to be able to show % Blocked when walking, but there does not seem to be a way to easily get the State of a Person. And the internal data from the AStar navigation is not available, so I can't get a numerical idea of what the heat map means in comparative terms.

Maybe I could use a calculated table to get a measure of how much the average walk time differs from the minimum, in % terms?

Any other ideas?

FlexSim 19.0.0
statisticsastar navigatorpeople module
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

·
Joshua S avatar image
1 Like"
Joshua S answered Zahra Z commented

You can access all the data of each node in the Astar network, and they have alot of useful data that you could pull from, especially total Traversals , which would give you an indication of the most trafficked areas.

While the model is running, you can access a node and it's data using the code below

treenode Node = Model.find("AStarNavigator>stats/extraData/4");
return getsdtvalue(Node, "totalTraversals");

astar-data.fsm


astar-data.fsm (66.3 KiB)
· 5
5 |100000

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

Claire Krupp avatar image Claire Krupp commented ·

Thanks @Joshua S , I will take a look at that.

If I read your code correctly, "...extraData/4" is referring to the 4th node in the network?

So if I want to know which nodes are busiest, and I have approx. 400 cols and 450 rows, I would have to use a loop to search each one to find the busiest areas? and the "totalBlockedTime" too.

Is there a quick command to do that?

0 Likes 0 ·
Claire Krupp avatar image Claire Krupp Claire Krupp commented ·

Another question: I see in the treenode for an individual Person, there is a node

"Person9/stats/state_current/profile" which has a table giving me the "blocked" time in row 4.

Can I access this in a statistics collector, and then I can add them up to give me a measure of congestion?

What is the syntax? I get very confused with the different ways that the statistics collectors work!

Sometimes it's "current.stats.state_current....."

and sometimes it's "getstat(data.rowValue, "Staytime", STAT_MIN, instance)"

Is there a comprehensive list in the manual of the standard labels/attributes, similar to the one you have for commands?

Thanks!

0 Likes 0 ·
Joshua S avatar image Joshua S Claire Krupp commented ·

@Claire K

Here is an example model to pull the stats you wanted from your Astar. Data is only stored for the nodes that were walked on and surrounding nodes, so it won't go through every node mapped out. Run the code during simulation to store everything in a table, and it will sort everything based on traversals with the highest traveled node at the bottom.

For gathering stats, both of those work, the first one "current.stats.state_current...." is going through the tree and uses dot syntax, the second one is a function, so it is more of a preference which one you want to use.

Under Help there is an API Reference, this might help.

a-star-mapping.fsm

1 Like 1 ·
a-star-mapping.fsm (31.3 KiB)
Show more comments

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.