Reputation: 313
I have two variables in agent
The priority variable value set in source exit based on wither agent is handicap or not, as shown in the image below.
Now in the queue I set Queuing to priority base and set agent priority to agent.priority
. Shown in image below.
Note: Queue capacity is set to 10.
Now when I run the model and 10 agents enter I the queue, according to the priority handicap agents should be on the top of the queue but that is not happening. shown in the image below.
When the agents enter the delay after the queue, I also print their priorities on the console. The result is still the same, no priority is followed.
In the above image it is clear that they are not sorted based on priority. Why priority queue is not working?
Moreover, I also changed the Queuing to LIFO, queue showed the same result, showing zero effect on agents.
Upvotes: 0
Views: 112
Reputation: 9421
this happens because contrary to the intuitive idea that events happen in the order you see, they don't... Things occur in the following order:
So from the point of view of the queue, the priority for all agents is the same
Solution Instead of setting the priority value "on exit" do it on the "on at exit" action of the source block
Upvotes: 1