Agent parameters with percentages

88 Views Asked by At

I'm new to Anylogic. I am trying to simulate a component that is processed on a machine 1. Here:

  • 30% is cut in 10 mm, takes 10 minutes
  • 20% is cut in 20 mm, takes 5 minutes
  • 30% is cut in 30 mm, it takes 3 minutes.

I know that at Arena I would use the "Decide" and "Assign" module. In AnyLogic, I thought about putting the dimension as a parameter, but I don't know how to put the percentages. How can I model this system?

Thank you very much.

1

There are 1 best solutions below

0
On

Simple conditional statement in the Delay block's "duration" field like:

randomTrue(0.3) ? 10: randomTrue(0.2) ? 5 : 3

This assumes that you do not care about the actual cut of individuals but do random assignments. Depends on your model if this is a good assumption.

If not, you would need to store the cut in agents flowing through the block using a parameter myCut of type double. Then in the Delay block, you would check using:

agent.myCut == 10 ? 10 : agent.myCut == 20 ? 5 : 3

Also assumes you set the time units correct.