question

Alonso avatar image
0 Likes"
Alonso asked Joerg Vogel commented

Define number of boxes per Type

Good morning. One question, how can I define the number of boxes in a Row by color? Or if I have boxes each color with a Type, for example Type 1, Type 2 and Type 3. In this figure I have 3 boxes with 3 different colors, I want to limit the entry of boxes by 'color' model, how could I apply a condition for this? Thank you if anyone can help.


1734431253319.png

FlexSim 24.2.3
labelname
1734431253319.png (131.4 KiB)
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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel commented

You count your created items by incrementing labels or other node based structured values. If you reach your limit you can restrict available Types being assigned to. You can for example eliminate Type values in an Array of available Types.
Or you destroy created item Types instantly by script code or sending them into a sink.

Instead of counting up to a limit you can pull from a list until the value is not available anymore.

create_item_by_tokenlabel_val.fsm


· 2
5 |100000

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

Alonso avatar image Alonso commented ·

Hi @Joerg Vogel , thank you very much. One more question, would it be possible to do the same without processflow? I changed the example, Queue2 can only have 9 boxes, 3 of each color, the rest must wait in the Queue

3. I thought about putting a Label on the queue in Queue 2. Thank you.


New27.fsm

0 Likes 0 ·
new27.fsm (36.0 KiB)
Joerg Vogel avatar image Joerg Vogel Alonso commented ·
@Alonso, something like waiting in a source is not recommended. Better you create tokens upon events through your model. Any token source works with the process flow.

Doing this logic without process flow means you write source code in triggers. And believe me, this is something you don't want to do. For example Pull from list is a method of Flexscript List Class.

You can still do something totally different by by comparing values of a needed limits and current created types. This is something you can realize yourself. If you want to increment label values then you find templates in triggers supporting you in this. You should do this on your own, because it is an easy task and you get a practice of finding commands, properties and methods in the reference manual. You will need some time to understand what my model does. And it is necessary to understand it to adjust it yourself. Ask specific question about any problems you hve while you try to understand this model.

1 Like 1 ·