question

Mark S2 avatar image
0 Likes"
Mark S2 asked Mark S2 commented

Using eye dropper tool to get location current census statistic

Can someone please tell me how to reference the census of a simple object in 'codified' format. My best guess was to try using the eye dropper on "Current":


capture-flexsim.png


That didn't work...my next idea was to use a statistics collector:

Statistics collector --> Statistic by Object --> Object Statistics --> Object = Chairs2, Statistic = Content, Type = Current.

This seems so simple, but is just so frustrating.

What am I missing here?

The purpose of this is to combine the current census of a waiting line (I already know how to retrieve the census of a line) and a waiting area.

Thanks!

FlexSim 22.1.1
statistics collectorcensuseye dropper
capture-flexsim.png (43.6 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.

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Mark S2 commented

This value is already being collected by the Location Census History table and can be retrieved by using the getcensus() command:

getcensus(Model.find("Chairs1"))

The reason stats.content doesn't work is that a MultiLocation object is an object with a bunch of chairs inside it. The patients go into the chairs inside the waiting area object and thus don't increase the content of the waiting area itself. MultiLocations do, however, have a separate tracked variable that keeps track of their "total content" which you can access like this:

Model.find("Chairs1>stats/contentTotal").value
· 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.

Mark S2 avatar image Mark S2 commented ·

Ah darn I was close.

Thanks for this Matt -- next time I am going to search for what I am looking for in here:

https://docs.flexsim.com/en/22.1/Reference/CodingInFlexSim/CommandReference/Commands.html


0 Likes 0 ·
Mark S2 avatar image
0 Likes"
Mark S2 answered

Continued troubleshooting...

After adding the "content versus time" dashboard from the "Content vs Time" pin option below:


1650928043171.png


Bayers Lake COC Model Option 1 - Mobile Station Attempt_11.fsm

...the content does not change despite patients entering the location. What is going on here?

Thank again,


1650928043171.png (21.3 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.

James Rodgers1 avatar image
0 Likes"
James Rodgers1 answered Mark S2 commented

If by "codified" you mean "via code", I think this is what you're looking for:

Object chairs = Model.find("Chairs1");

int census = chairs.stats.content.value;

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

Mark S2 avatar image Mark S2 commented ·

Not quite, I am looking to combine those two lines of code together that will work in a stats collector:

I tried "Model.find("Chairs2").stats.content.value... but it didn't work.

1650920039910.png

0 Likes 0 ·
1650920039910.png (34.6 KiB)

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.