question

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

Average utilization of park points (Control Points)

I have a model using the AGV navigator with several parking locations. I am using the standard parking method with a few enhancements, and now I want to assess how often each parking location is in use.

The Control Point object does not seem to have any statistics collected. This is in the user manual:

1682699033764.png

but this does not seem to be true anymore (please update the manual!). There is no statistics icon on the properties and AllocationCount does not appear in the tree or anywhere else in the manual.

I have already discovered that you can't use subnodes.length to find out how many AGVs are at the location, but from another question on this site I found out how to use

Model.find(value.name + ">variables/allocations").subnodes.length

to tell me how many AGVs are allocated to the control point (value here is the control point in the list of parkPoints).

But this only gives the "contents" at that moment in time, and if I put it in a Statistics Collector I only get a chart showing what is there at that moment.

I tried installing the standard chart for Average Contents, but that uses getstat:

getstat(data.rowValue, "Content", STAT_AVERAGE, instance)

and this doesn't work for control points.


So how do I find out the average allocations through time, and what's the best way to chart it?

Do I need to create a table of tracked variables?

Thanks.


Also, please add this and the AllocationCount stat to your wishlist!



FlexSim 23.1.1
statisticscontrol pointallocations
1682699033764.png (12.1 KiB)
· 1
5 |100000

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

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Claire Krupp, was Jordan Johnson'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 unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Claire Krupp commented

Here is an example model that gets the Allocation Count statistic:

AllocationCountStatDemo.fsm

The most common stats are available through the stats property on the Object class:
https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Tree/Object.html#Property-stats

For any other stats, including AllocationCount, you have to use the getstat() command:

https://docs.flexsim.com/en/21.1/Reference/CodingInFlexSim/CommandReference/Commands.html#getstat

All that being said, our documentation doesn't help users draw the connection between the "Statistics" section for objects and using the getstat() command. I'll add an issue to the dev list to see if we can improve that somehow.

However, I don't think the allocation count statistic is what you really want. AGVs allocate from control point to control point as they travel. If the parking spot point is far away from the previous control point, all that time travelling to the point will count as "Utilized". In addition, an AGV can allocate the parking spot but not stop there. For example, an AGV might be on it's way to a parking spot, but then be redirected to another destination. In that case, it would pass over the parking spot without using it.

Here is an example model. It has the AGV Heuristic Parking flow. There are two stats collectors: one to show the utilization for each parking point and one to show a Gantt chart for each parking point. The both work by using events on reset or when the parking zone is entered/exited. It was quite a few steps to make, but shouldn't be too bad with an example:

AGVParkPointUtilDemo.fsm

I will add your request for an easier version of these charts to the dev list.


· 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.

Claire Krupp avatar image Claire Krupp commented ·

Thanks @Jordan Johnson those two charts are exactly what I need. It took me a while to understand the demo model and figure out how to reproduce it in my model, but I think I have it now. Adding the partitioned List and the Zone was pretty straightforward, but I would never have figured out the statistics collector fields on my own!

One more wrinkle - several of my parking CPs represent areas where more than one AGV can park, so the allocations can be up to 5. I will need to tweak the calculations to reflect a proportion of the MaxAllocations, instead of a 1, 0 switch. I'm thinking I could put an increment or decrement for the "NewState" label, and then divide by MaxAllocations in the trigger to get the percentage. Am I on the right track?

As far as using the stats property or the getstat() command, I have used those before, but I usually can pull up the Statistics in the Properties window, or look in the tree to find out which properties are available. The CP tree doesn't have any stats except for "routingConstraint", which is why I assumed the "AllocationCount" was not available.

1683206015542.png

Why is AllocationCount not listed? Am I looking in the wrong place?

Thanks again!

0 Likes 0 ·
1683206015542.png (20.0 KiB)
Jordan Johnson avatar image Jordan Johnson ♦♦ Claire Krupp commented ·

Here's an updated model. I changed the Utilization collector to use a Level tracked variable, and changed utilization to be the average level / max level (calculated from using the MaxAllocations property on the control point). I updated the Gantt chart as well, to try to show a blank if zero AGVs were present and a bar if 1 or more are present, but I'm not sure I did it quite right. The idea is to listen to the other stats collector and figure out whether the point is utilized from that.

agvparkpointutildemo_1.fsm

For your getstat() question, it can be difficult to find statistics. In some cases, the statistic node isn't present unless you require it. It looks like AllocationCount isn't present until the first allocation, and then it is removed on reset. That might be a bug, so I'll add it to the dev list.

The proper way to find the statistic node is to use a special function_s:

function_s(Model.find("ControlPoint3"), "assertStatistic", "AllocationCount")

That code will force the statistic node to be present and return a reference to the node itself.

0 Likes 0 ·
Claire Krupp avatar image Claire Krupp Jordan Johnson ♦♦ commented ·
Great! Thank you for your help.
0 Likes 0 ·

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.