More problems with unbounded distributions

More problems with unbounded distributions

jim_montgomery
Not applicable
1 View
8 Replies
Message 1 of 9

More problems with unbounded distributions

jim_montgomery
Not applicable

[ FlexSim HC 5.1.0 ]

hot-seat-queue-7.fsm

In this model, the activity times assigned to the label, “a_Reading_Time” are taken from theoretical distributions within a global table, “GT_Dictation_Time_wMin” based on hour of day and PCI. The “min” command, as I have written it (see Fig 1), had no effect on the values assigned to the labels.

Fig 1:

7278-3fso8.png

See results below from Patient History Exported Results (Fig 2).The value assigned label "a_Reading_Time" (column Y) should never go above 60 min, yet it does.

Fig 2:

7279-bqdvf.png

I also attempted to solve the problem using a custom User Command that seeks a value less than the minimum (See Fig 3), but I got the same results.

Fig 3:

7280-og1jx.png

Can you please tell me how to prevent my activity times from getting values higher than the prescribed minimums?

Thanks,

Jim

lou.keller@flexsim

cliff.king@flexsim

0 Likes
Accepted solutions (1)
2 Views
8 Replies
Replies (8)
Message 2 of 9

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

*The main issue was using the min command. The min and max commands are deprecated and you should use minof or maxof instead. Look at the comments below if you want further explanation.*

In Activity 110, where you set the readingTime label, you are pulling the value from the GT_Dictation_Time table and not the GT_Dictation_Time_wMin table.



Matthew Gillespie
FlexSim Software Developer

Message 3 of 9

jim_montgomery
Not applicable

hot-seat-queue-8.fsm

Hi Matthew.

Why do I get the same results (minimums are not being met) in the Patient History exported table after substituting the global table, "GT_Dictation_Time_wMin" ? See below label "a_Reading_Time":

7282-9fkbo.png

0 Likes
Message 4 of 9

Matthew_Gillespie
Autodesk
Autodesk

I don't know how you're getting those numbers. This is what I see:

7284-labels.png

Are you using custom fields?

Also if I display a Milestone-Milestone chart for Start_Read_Imaging_Study - Dication Signed then the average time is around 3.5. (You use the reading label for the processing time of activity 130)

7285-milestone.png



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 5 of 9

jim_montgomery
Not applicable

Yes, but did you sort the Patient History by a_Reading_Time and filter for specific PCIs?

Thanks,

Jim

0 Likes
Message 6 of 9

Matthew_Gillespie
Autodesk
Autodesk

You are using a deprecated function that has a known error. You should use minof instead of min. The issue with the min command is that the way C++ defines it is problematic when you pass it a function that changes value every time you evaluate it.

Instead of doing this:

double value1 = 10;
double value2 = random();

if(value1 < value2)
	return value1;
else
	return value2;

It does this:

if(10 < random())
	return 10;
else
	return random();

So even if the random number generated in the first comparison is less than 10, the number it returns is a new random number that may or may not be less than 10.

So use minof instead of min and save yourself a headache.



Matthew Gillespie
FlexSim Software Developer

Message 7 of 9

jim_montgomery
Not applicable

Thanks, Matthew. Substituting the command, "minof" in place of "min" in my global table fixed the problem.

Thanks,

Jim

0 Likes
Message 8 of 9

mischa_spelt
Advisor
Advisor

Although it is convenient to cut off the distribution using minof, also be aware that this may skew your statistics. A better way of doing it is usually something like

double r;
do {
  r = random();
} while(r > 10);

return r;

although you may be willing to accept this slight error in favor of being able to easily put the whole thing into a table cell.

0 Likes
Message 9 of 9

jim_montgomery
Not applicable

Thanks, Mischa. I will experiment with your recommendation also.

0 Likes