Using eye dropper tool to get location current census statistic

Using eye dropper tool to get location current census statistic

mark_s21
Not applicable
1,421 Views
5 Replies
Message 1 of 6

Using eye dropper tool to get location current census statistic

mark_s21
Not applicable

[ FlexSim 22.1.1 ]

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!

0 Likes
Accepted solutions (1)
1,422 Views
5 Replies
Replies (5)
Message 2 of 6

james_rodgers2Y29K
Advocate
Advocate

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;

0 Likes
Message 3 of 6

mark_s21
Not applicable

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
Message 4 of 6

mark_s21
Not applicable

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,

0 Likes
Message 5 of 6

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

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


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 6 of 6

mark_s21
Not applicable

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