question

Eric C2 avatar image
0 Likes"
Eric C2 asked Eric C2 commented

queue by surface

Hi,

I'm trying to mange a queue by the surface of the items entering.

The model is the following.

I have two diferents items, one has a surface of 2 (label) and another one has a surface of 3.75 (label).

I'm trying to manage them from the processor into a queue that its total surface is 12.

What I want is that when the surface of the queue is empty or a little bit less than its capacity (12), the queue stop receiving new items, so I want to control its capacity depending on the entering items surface.

Is that possible in Flexim? How can I do that?

Thank you in advance.

FlexSim 21.0.0
queueflexsim 21.0.0
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jeanette F avatar image
0 Likes"
Jeanette F answered Eric C2 commented

You could use a list for the queue and when another item is ready to be sorted into the queue you can query the queue and make sure it has room.

This post contains some helpful pointer for how to sum a list and query it. Please also check out this (it is also referenced in the post).

· 6
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

In addition to @Jeanette F’s answer there are mechanisms in a list query with a SELECT clause to pull list entries and decrement list field values. Please refer to the chapter Using the SELECT clause. And further on there is also the General Tab option Track Number Fields Totals.

0 Likes 0 ·
Eric C2 avatar image Eric C2 commented ·

I have almost reach my target, but I don't know how to finish it.

I did the following.

I've created and item list of the products.

In the output of the processor I have click on send to port and push to my item list.

Then on the input of the queue I've checked on pull strategy and and pull from my item list with a query WHERE dimension < 12.

But this is not what I exactly want to do.

It should be the sum of the dimension label of the items entering on the queue less than 12, not the dimension of each individual item.


Do you know how to reach this code? 1.PNG

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ Eric C2 commented ·

Hello @Eric C2,

It sounds like you use the list in between the processor and queue. I would use the list for the Queue itself. Then you could sum the labels of the boxes that are in the queue to see if the next box would fit.

I used the following code in a Decide activity in a process flow to see if there was room for the current box trying to enter the Queue.

if (List("Dimensions").entries().length == 0){ //checks if list is empty
    return 1;
}
double sumvalue = Table.query("SELECT SUM(Surface) FROM Dimensions")[1][1]; 
// sums Surface values in list
if ((sumvalue + token.Surface) <= 12)// checks if new item can fit in Queue
    return 1;

return 2;

Reference this model to see the process flow.

Sum List.fsm

0 Likes 0 ·
sum-list.fsm (42.6 KiB)
Eric C2 avatar image Eric C2 commented ·

Thank you Jeanette, your model is useful and almost is what I want, there is just one difference.

In your model the operator get the products from queue 1 before it is full, I mean I need that the operator get the items from the queue 1 just when it is full and no can accept another item from the processor due its capacity. Do you know how to do it?

Thank you again for your kindly answer.

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ Eric C2 commented ·

Hello @Eric C2,

I updated the model so that the output port for the queue starts closed and is opened when it is full. The processor does not release the next item until the queue is empty again (you can alter this in the wait for activity if you intended it to do something different). The Queue output is closed again once the queue has been emptied.

Sum List.fsm

0 Likes 0 ·
sum-list.fsm (44.1 KiB)
Eric C2 avatar image Eric C2 commented ·

Thank you for the answer, it was really useful


0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.