I have a process to move a picking agent and a product through the same delay block

68 Views Asked by At

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.

2

There are 2 best solutions below

0
Jaco-Ben Vosloo On BEST ANSWER

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?

0
Felipe On

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))