What is the difference between People Settings and State Tables ?

What is the difference between People Settings and State Tables ?

leah_r
Not applicable
246 Views
5 Replies
Message 1 of 6

What is the difference between People Settings and State Tables ?

leah_r
Not applicable

[ FlexSim 23.2.1 ]

Hello !

I work on an operating room model.

I play a lot with object and patient states but I am not sure I'm doing it correctly.

For instance, I have this in the tree view (4 state profiles per operating room):

1695896351683.png

This in people settings:

1695896417011.png

I use code similar to this to change my OR's states during simulation:

string newState = "Waiting for Anest";
Object OR = patient.Locations;
if (patient.caseType == 1){
    OR.as(Object).stats.state(4).value = newState;
    }else{
        OR.as(Object).stats.state(4).value = newState + " (non-elective)";
        }

I have no state tables.


It feels a bit disorganized.

  • Could you please indicate what are the good practices to follow while working with states and state profile?
  • What is the difference between "people settings" and "state Tables"?
  • To what state profile are the people settings linked to?
  • What is the best way to add a state profile?
  • What is the best way to add a state?


EDIT : and how can I use the function setState() with custom states?


Thanks in advance!

Leah

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

jason_lightfoot_adsk
Autodesk
Autodesk

With respect to setState and general FlexSim (hence this is a comment, not an answer):

The object method setState uses numeric values as described here, and can accept a state profile number. You can see that there are 50 standard numerical states.

1 - STATE_IDLE
2 - STATE_PROCESSING
3 - STATE_BUSY
4 - STATE_BLOCKED
5 - STATE_GENERATING
6 - STATE_EMPTY
7 - STATE_COLLECTING .... etc.

These are defined as macros. If you want to use this method then you can also set up your own state macros as described in the link and also the state profiles eg:

#define HCSTATE_WAITINGFORANEST_ELECTIVE 1
#define HCSTATE_WAITINGFORANEST_NONELECTIVE 2
#define STATEPROFILE_HC 4

which would then should allow you to use something like:

location.setState(HCSTATE_WAITINGFORANEST_ELECTIVE, STATEPROFILE_HC)

This way all your state definitions are centralized and consistent, so for general FlexSim this might be a good practice, but it does rely on the state profile ranks being consistent and sometimes they are not.

Since the people module looks to be defined in a different way, all this probably doesn't apply and you may not be able to use the setState method, but I'll leave others to say what the best practice for that is.


Message 3 of 6

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

The People state dashboards look at the HC States state profile. The People Settings object is also tied to the HC States state profile and lets you configure whether each custom state counts as a Utilized state for Utilization calculations. So you usually just want to add custom states in the People Settings and then set the state of an object's HC States state profile.

Object obj = Model.find("OR1");
obj.stats.state("HC States").value = "Waiting for Anest";

You can add other state profiles to objects if you want, but then you need to manage that all yourself and you'd probably need to make your own stats collectors to make any state dashboards using those profiles.



Matthew Gillespie
FlexSim Software Developer

Message 4 of 6

leah_r
Not applicable

Thank you very much, this is so useful!

Could you please elaborate on this part: "you need to manage that all yourself and you'd probably need to make your own stats collectors to make any state dashboards using those profiles." ?

0 Likes
Message 5 of 6

Matthew_Gillespie
Autodesk
Autodesk

If you make a Average State chart for Location States that dashboard is displaying data from the HC States profile of the location objects in the model. The way it does this is with a Statistics Collector object that grabs the states of each individual object and puts them together into a table. Then a Calculated Table object takes that table and creates a new table of data with calculated percentages. The chart then uses that calculated table as the data to display.

If you double click on the LocationStates table in the People Statistics Tables section of the Toolbox and then click the Copy internal Statistics Collector button, it will add a copy of the statistics collector it uses to your toolbox.

1696018963632.png

You can open that up to see how it gets the data from the location's HC State profile.

1696019013094.png

To see the Calculated Table, select a Location States chart in a dashboard and in the Advanced panel click the Install button

1696019096937.png

This will add a new Calculated Table to your toolbox that will show you how the data is transformed from that gathered in the Statistics Collector into nice percentages.

1696019192315.png

If you have more questions about how to make your own charts from your own state profiles, please start a new question.



Matthew Gillespie
FlexSim Software Developer

Message 6 of 6

jason_lightfoot_adsk
Autodesk
Autodesk

Hi @Leah R, was Matthew Gillespie'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 comment back to reopen your question.

0 Likes