question

Lucas Rodrigues avatar image
0 Likes"
Lucas Rodrigues asked Jordan Johnson commented

Arrival time distribution in source change by time of day

Hello,

How i can make my source change the distribution by time of day?

Eg:

08:00h:weibull( 0.116994, 25.088053, 0.876710, getstream(current))

09:00h: beta(0.199745, 9.597606, 0.535678, 1.057751, getstream(current)))

"By Time of Day" option do not allow distributions, right?

My initial solution was to create a source for each time of day and use a Timetable to control each one.

Can someone help?

Tks!

FlexSim 21.1.4
sourcedistributionsinterarrival timesby time of dayarrival time
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

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Jordan Johnson commented

As far as I can tell, the By Time of Day does allow expressions for each time. The code calls each value in the schedule as a function, so I think you can use that. However, I'm not sure that anything gets passed in to those functions, or that current is available. I think you'll need to change your expressions to something like:

  1. weibull( 0.116994, 25.088053, 0.876710, param(1))

If you want to pass the stream in, you'll need to modify the code from the pickoption to pass in the stream:

  1. if (hour >= 12)
  2. retval = nodefunction(rank(rank(data, (hour+1) - 12),2), getstream(current));
  3. else
  4. retval = nodefunction(rank(rank(data, hour+1),1), getstream(current));

Alternatively, you could take a similar approach using an Object Process Flow to define a source. The attached model has both options.

SourceDemo.fsm


sourcedemo.fsm (41.5 KiB)
· 2
5 |100000

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