Page 1 of 1

Queue Capacity

Posted: Thursday 07 June, 2018 - 16:25
by Yfke
Hi!

I would like to simulate in 3D. When the capacity of my queues is equal or smaller than 10, I can see all the product in the queue. That is what I want.
But if I change my queue capacity to more than 10, I can only see one product in the queue. I need to change the queue capacity to more than 10, because otherwise I got a lot of other problems within my model. Does anyone know, how I can solve this?

I hope someone can help me, thanks in advance!

Kind regards,
Yfke

Re: Queue Capacity

Posted: Thursday 07 June, 2018 - 16:51
by HarryBunnik
Ha Yfke,

Yes, that is a measure to speed up the animation. However, I agree it would be nice if you have a bit more control over it.

For the moment you can solve it using the following code on the entry- and exit trigger of the queue. With this code, you are placing the products yourself (which the queue is up to 10 products doing itself).

ForAtomLayerUnder(
c,
Do(
Setcs(a) {active atom, so the one currently selected in the loop. Note that after referring to another atom, the active shifts focus!},

SetLoc(
xSize(c) - xSize(c)/Att([Capacity], c) * GetRank(cs), {x-location}
0.5 * ySize(c) - 0.5 * ySize(cs), {y-location}
0,
cs
)
)
)


Here you loop every time a product enters or leaves the queue over the content of the queue and locate it again. This is necessary since every time a product leaves, all products have to move a position. With the x-location (based on the length of the queue and the capacity of it) you have to subtract it from the length of the product to start placing it from the right. If you skip this "xSize(c) -", products are placed from the left.

I also added a small example model.
Queue3D.mod
(15.64 KiB) Downloaded 525 times
I hope this helps you further,

Gr. Harry

Re: Queue Capacity

Posted: Thursday 07 June, 2018 - 17:13
by Yfke
Thank you Harry! :D