Search code examples
queueanylogic

Agents not leaving the queue before a transporter is free


in my model I have a queue were multiple agents from different sources come together to seize an transporter ( see picture). But now they leave immediately after they enter the queue to the seize transporter block. But I want to keep them in to queue until a transporter is free and then the first one in the queue should seize a transporter and so should move to the seize transporter block. How should I fix this?


Solution

  • There are several ways:

    1. After the queue, add a RestrictedArea elements to limit the number of agents in the Seize seizeTransporter4 element. In the queue, you can sort the agents.
    2. Instead of a queue element, use a Wait element, in which case you need to write the logic for extracting agents and sending them to seizeTransporter4 element.

    The second way is more flexible in terms of writing logic.