question

yesid anacona avatar image
1 Like"
yesid anacona asked Dj Moens answered

Exponential input per hour of day SOURCE

I need to create exponential arrivals in minutes according to certain hours of the day

??

source
help-io1.jpg (18.1 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.

Joerg Vogel avatar image Joerg Vogel commented ·

Flexsim chooses randomly the next arrival time when an item leaves the source. If the chosen time to create an item is already in the next time or the second or third slot of your table, how should this time to be used? Should the item still be created. Should the source create an item at the beginning of the next time interval. These questions occur because the exponential function values exceed the 14th times of the mean.

0 Likes 0 ·
Mischa Spelt avatar image
2 Likes"
Mischa Spelt answered Mischa Spelt edited

In the past we used a technique called acceptance/rejection sampling.

The basic idea is to find a common frequency for all rows, for example, in your dataset, 5 min/client. You set your source to generate arrivals at this frequency, and then reject them with a probability proportional to the ratio between the actual frequency and the common frequency. So between 08:00 and 10:00 you would 6 times more arrivals than you want, so for each arrival, you let it through with probability 5/30 and reject it with probability 25/30. Then between 10:00 and 12:00 you accept the arrival with probability 5/60, between 12:00 and 17:00 with probability 5/100, etc. In FlexSim you can use uniform(0, 1) or a bernoulli for this.

We went through the exercise once of proving mathematically that for exponential distributions this gives correct statistics, and implementation is a bit of work the first time but is quite straightforward.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Dj Moens avatar image
3 Likes"
Dj Moens answered

Another option is generating all arrivals of one period at the same time. Than delay each arrival with a time sampled from a uniform distribution between 0 and the following time slot (for instance in a processor with high capacity). The inter-arrival times of the items arriving in the time slot will then also be exponential distributed. Advantage (or disadvantage) is that the number of arrivals within the time slot is fixed (!).

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.