In anylogic index function, how can I use triangular distribution or any other random int?

37 Views Asked by At

I'm making a container terminal simulation. discription of the sequence

When the ship arrives to the port by 'sourceDeliveryShips1', delay happens as the ship unloads. When unloading, I want to use the inject function to create different numbers as each ship arrives. unloading's inject function

In unloading1-Delay > Actions > On Enter, I wrote this code. sourceContainers1.inject((int) Math.floor(triangular(150, 200, 300)));

However, there is error when I start the simulation. error image

Please help me... Is there any other way I can make random numbers of the ships' containers?

It works fine when I use int like : sourceContainers1.inject(100); But I want to make the number 100 change every time a ship arrives.

I tried changing the code to

sourceContainers1.inject((int) Math.round(triangular(150, 200, 300)));

sourceContainers1.inject((int) uniform_discr(70,90));

But nothing seems to work..

0

There are 0 best solutions below