Changing distribution parameters depending on days of the week
Distributions let you add variation to your simulation model. For timing especially they’re key. You don’t always want to use the same distribution for the whole simulation day though. For example, patients arrive at an ER at very different rates depending on the time of day and the day of the week. A Time Dependent Distribution is a really easy way to capture this in your simulation.
If it gets more complex than that, you can use Visual Logic Time Check.
Let’s say we’re simulating a factory where a machine operates at slower speeds on Thursdays and Fridays to allow maintenance to be carried out without disrupting the workflow.
First we’re going to create a distribution called distOperationTime which we will apply to the Assembly Activity’s Timing. Just add dummy values when creating this distribution as it’s going to be updated through Visual Logic.
Now go to Visual Logic > Time Check VL > Time Check Properties.
We want Simul8 to trigger the code every 8-hour day, which corresponds to 480 minutes.
Click on the On Time Check Logic button and write the IF/ELSE statement using the Set Distribution Parameters command:
Now our Assembly Activity will take an average of 15 minutes to operate on Thursdays and Fridays, and an average of 8 minutes during the other weekdays.