user 22115
user 22115

Reputation: 1

How to restrict a queue size?

I am facing some problems in restricting the queue size at a particular station. So I have packaging station as a resource which is used 11 times i.e. I have 11 seize blocks seizing this resource. Now, I have orders coming in which contains multiple agents for example if one order arrives and it has say 10 parcels, so the order gets picked and then using enter function, these 10 parcels go to the packaging station. This is happening around 11 times in my model. Now, I want that if the queue at my packaging reaches some particular number then picking should stop. I tried few alternatives but couldn't reach the desired results. And each order has different number of parcels. I would be glad if anyone could help me with this?

Upvotes: 0

Views: 254

Answers (1)

Felipe
Felipe

Reputation: 9421

You can use a hold block that gets blocked when your queue reaches a number.

To do that you can do something on enter on the queue:

 if(self.size()>someNumber)
        hold.block();

then on the on exit of the queue you unblock it

hold.unblock();

Of course where to put the hold depends on the particular characteristics of your model

another option is to use restricted area... another option is to use another queue before the queue and set up your limited queue to a maximum number of agents another option is to use a wait block before the queue

so many ways...

Upvotes: 1

Related Questions