0

Currently, I have two delay blocks above each other, where one agent goes through one of the blocks and the other through the other one.

Screenshot of my model

But when I want exponentially distributed values with a mean of 120 seconds, They both need to have the same value always. So they are done at the same time.

Jaco-Ben Vosloo
  • 3,770
  • 2
  • 16
  • 33
  • Hi Jonah, welcome to SOF! Please add more details about your models (pieces of code or screenshots). Your question is not clear. – Yashar Ahmadov Jan 10 '22 at 16:21
  • Hi Yashar, I added a screenshot. My goal is to simulate 10 workers who are picking the orders. So they need the same delay as the time for picking, which needs to be exponentially distributed. When they are done picking they are send back to the match block to be matched with the next order... – Jonah van der Meide Jan 10 '22 at 16:35
  • Okay, so, what exactly is the problem? You want both the worker and picking agent to be delayed for exactly the same time? – Yashar Ahmadov Jan 10 '22 at 16:44
  • 1
    Hi Jonah, seems your model concept has to be a bit redefined. Try to steer only orders in your procees flow. Just two blocks will be needed Source+Service. And the Picker is a resource. So just create and define ResourcePool block and select it in a properties of Service. – yuriy pidvalny Jan 10 '22 at 16:53
  • Thanks yuriy, this helps a lot. the only problem is that in part of the process I have riders. Riders spend for example 5 minutes going to a place. And when they come back it takes 5 minutes aswell. But I only want 5 minutes to count to the process time of the order and the other 5 minutes the rider should remain idle until he/she is back and can take a new order. Is that possible with the service block aswell? – Jonah van der Meide Jan 10 '22 at 17:51

2 Answers2

0

Not questioning your probably bad design by not using resources, These are the steps to follow to ensure things happen at the exact same time:

1.Create a variable called seed of type long

2.create a cyclic event that runs every 1 minute and has the following code:

seed=(new Random()).nextLong();

3.In both blocks you will use the following code to calculate the exponential distribution:

exponential(120,0,new Random(seed))
Felipe
  • 8,311
  • 2
  • 15
  • 31
0

You simply need to have the two delay blocks use their own (but with the same seed) random object.

Start off by creating two identical random objects

enter image description here

And have each of the delay blocks use of them of them

enter image description here

Then the numbers they will sample will be the same for every sampling iteration.

See this post for a similar problem

Why do two flowcharts set up exactly the same end with different results every time the simulation is run even when I use a fixed seed?

Jaco-Ben Vosloo
  • 3,770
  • 2
  • 16
  • 33