question

Courtney Seto avatar image
0 Likes"
Courtney Seto asked Matthew Gillespie commented

How do you set a start time condition on a patient track activity?

I would like to write a constraint so that a patient track activity can only be initiated during a specific time frame (8am-8pm). I am not sure how to model this in the "Activity Start Conditions" in the "Advanced Functions" tab in the patient track with an expression or flexscript code.

FlexSim HC 5.1.0
healthcareactivitystart timeadvanced functions
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

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

You can use the Based on Simulation Time pickoption that handles all the time checking code for you. This pickoption creates a global table and then reads a value from the appropriate cell based on the current time. When you choose the pickoption you'll see the following popup:

Here you configure the table and how many cells you want. The default settings will make a cell for each hour of the day and will generate a blank table like this:

The Activity Start Condition expects a true or false value, so enter a 1 when you want the activity to be able to start and a 0 when you don't want it.

Rather than using the Activity Start Condition I would probable use a Decision Point activity with the Based on Simulation Time pickoption in the Next Activity field to decide which activity to start based on the current time. In that case you'd fill out the table with the Activity ID's.


simtime.png (6.6 KiB)
table.png (7.8 KiB)
· 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.