question

Lou Keller avatar image
0 Likes"
Lou Keller asked Matthew Gillespie commented

How do you use labels to set parameters in a time-table look-up function?

In a certain model, the analyst would like to differentiate between the time MD's see patients based on two factors - the time of day and the PCI's distribution-driven, care time. In other words, all PCI's have their own distributions to draw from regarding general service times with the MD. These values are assigned to a patient label named, "MDProcess." And, the analyst would like the information contained in the MDProcess label used in a time-table to determine treatment time depending on the time of day. The questions are, 1) What information can be used as an hourly parameter in a time table? 2) What is the correct format for adding a label to the time table parameter? See the attached picture for visual support. Note that although the patient label contains a valid time, it is not transferred to the time table parameter and so the MD spends no time with the patient regardless of the time of day..

Also note that, "getlabelnum(patient, "MDProcess") doesn't work because of "patient," Nor does getlabelvalue.

FlexSim HC 5.1.0
labelslabel distribution parametersusing label values
label-question.jpg (157.8 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.

Lou Keller avatar image Lou Keller commented ·

@jbmontgomery

0 Likes 0 ·

1 Answer

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie commented

This doesn't work because the code has no idea what patient is when you call gettablevalue on one of the cells. You'll have to modify the code of the Based On Simulation Time pickoption to make this work. Right now the last line of code looks like this:

return gettablevalue(table, row*, col*);  *actually code to get the correct row or col

You could change the table to hold just the label names and change the code like this:

string labelName = gettablevalue(table, row*, col*);
return getlabel(patient, labelName);

Another possibility is to use the execute string function that lets you pass two things in:

string code = gettablestr(table, row*, col*);
return executestring(code, patient, patientlocation);

You would then use c for the patient, or i for the patient's location in your table:

getlabel(c, "MDProcess")
getlabel(i, "MDProcess")
· 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.

Lou Keller avatar image Lou Keller commented ·

Thanks Matthew. I've attached the model I've been working with so you can see the dynamics involved. The model is just a demo model designed to show a variety of functions to include the Cleaning Time Delay data display you helped with earlier.using-labels-lou.fsm

0 Likes 0 ·