how can I change the batch of 5 green objects that entered the queue "Cabin"

how can I change the batch of 5 green objects that entered the queue "Cabin"

LuisGaytan
Not applicable
38 Views
13 Replies
Message 1 of 14

how can I change the batch of 5 green objects that entered the queue "Cabin"

LuisGaytan
Not applicable

[ FlexSim 22.0.16 ]

changecolorbybatch.fsm

how can I change the batch of 5 green objects that entered the queue "Cabin", after they enter check if there are more greens in buffer 2, if there are no more greens change the color of the batch to black

0 Likes
Accepted solutions (1)
39 Views
13 Replies
Replies (13)
Message 2 of 14

natalie_white
Not applicable
Accepted solution

Hi @Luis Gaytan,

Based on your current model's logic, there will never be any green boxes in Buffer 2 because green items are moved from Buffer 1 to Cabin.

You can add a Change Visual activity to your process flow after your Batch activity to change the color.

Let me know if you have additional questions about this!


Message 3 of 14

LuisGaytan
Not applicable

I had forgotten to mention that the green is a priority to enter directly to the queue "cabin"

0 Likes
Message 4 of 14

natalie_white
Not applicable
Your current model is only sending greens to the queue "cabin." All the other colors stay in Buffer 2.
Message 5 of 14

LuisGaytan
Not applicable
How can I send all the colors to the queue cabin, with the condition that the batch has to be only of one color?, if is not the color of the batch then I send it to queue 2


0 Likes
Message 6 of 14

natalie_white
Not applicable

I don't understand what you want your model to do. Do you want the queue Cabin to send flow items off immediately, or every time a batch is complete?

Do you have an updated model? Or a drawing or flowchart showing what you're trying to achieve? This will help a lot.

0 Likes
Message 7 of 14

LuisGaytan
Not applicable

Yes, what i want to do is that the cabin enters objects of the same color and that when there are of another color, it enters to the buffers when the batch of five objets of the same color finish coming out if there is no longer the same color in buffers now it will change to the next color and batchers o five objects of the same next color enters the cabin but it'll no longer be the same color as the previous one.Tarea#2CambioDeColordeCabinaConZona_2.fsmflowchart.png

0 Likes
Message 8 of 14

jason_lightfootVL7B4
Autodesk
Autodesk

fyi - You seem to be referring to a zone by name that doesn't exist in "Decide: Buffer lleno?". But you don't need to use the zone to get the content of the buffer - you can just find the buffer and use buffer.subnodes.length.

Why do you have a connector from that decision going back to the source after a delay? Your source interarrival will generate more tokens to create items.

This seems over complex for something that is handled almost by default using port connections to objects and limiting the capacities of the queues/processors.

If you describe the process in terms of behavior it might be easier - eg.:

  • You have different coloured items that fill buffer 1 and then buffer2 when buffer1 is full.
  • The cabin will process same coloured items until it cannot find the same color at which point it will switch to another color and that processing them.

You don't say how many the cabin can process or how long they take.

Message 9 of 14

natalie_white
Not applicable

@Luis Gaytan,

I am attaching a model which uses process flow to create batches of 5 items of the same color in the cabin and then sets a new batch color based on the next created flow item coming from Buffer 1. (All other items go to Buffer 2.)

As Jason said, your model seems overly complex, but I may be missing some of what you want to achieve.

A couple points of confusion: Let's say your batch is finished and your new batch color is blue. Do you want to send the blue items in Buffer 2 to the cabin? If there are more than 5 blue items in buffer 2, do you want to send them all to the cabin or only 5 of them?

batchbycolor.fsm

Message 10 of 14

LuisGaytan
Not applicable
Yeah, that's it!. If there are more than 5 blue items in buffers, I want to release all the blue ones.
0 Likes
Message 11 of 14

natalie_white
Not applicable

Alright, I've made those changes to this example model.

To do this, I used a list instead of a batch. When I pull from the list, I can pull according to the Partition ID (which is the color). I can pull as many items as are available, but I only require 5.

Let me know if you have questions about this process flow or about using lists.

batchbycolor.fsm

Message 12 of 14

LuisGaytan
Not applicable
That's awesome @Natalie White!!! Good morning, do you know some way to get into the cabin the token that took the longest time in buffer 2? I'd like to learn more about this kind of logics.
0 Likes
Message 13 of 14

natalie_white
Not applicable

I will look into this for you! As per our site's best practices, can you ask this separately as a new question? I will reupload my answer to your question there.

Message 14 of 14

natalie_white
Not applicable

Previously, we were pulling items from a list by their partition. If you want to pull the item from Queue 2 that has been there the longest to start your new batch (regardless of its color), you can do that with a Query, but you need a list that is NOT partitioned. (See this post about how you can't pull from all partitions at once: https://answers.flexsim.com/questions/29526/pull-from-all-partitions.html)

In this example, your new batch is determined by the item that has been on Queue 2 for the longest amount of time (See Pull from List: Items on Buffer2 activity in your process flow. This is the activity that uses Query).

Because the Pull from List: Buffer 2 activity (which pulls the entire batch once there are at least 5 items available of the correct color) pulls an array, we need to use a subflow to move and destroy each object in the array. PullOldestItem.fsm