1
votes

I'm simulating a model on Anylogic, composed by 4 blocks: source-queue-service-sink.

I have 3 classes of priority (low, medium, high) with which I have to organize the "priority-based" queue. So:

  • the 70% of the agents must be associated to the "high";
  • the 20% of the agents to the "medium";
  • the 10% of the agents to the "low".

And the queue should work like this: highs first, then mediums and lows at the end.

How can I do this? Should I work with arrays maybe?

1

1 Answers

1
votes

First you need to have a variable in your agent called priority... To associate randomly the priority, the default value of that variable should be:

uniform()<0.7 ? 3 : (uniform()<2/3 ? 2 : 1)

This means that 70% of the agents will have priority 3, 20% will have priority=2 and 10% will have priority=1

In your queue module in your properties, in the first advanced section you change queuing to "priority based" and select agent.priority as the priority as you see in the following image: priority

Then the queue will release the agents according to their priority... high priority first, low priority last.