question

Patrick avatar image
0 Likes"
Patrick asked Jeanette F commented

Is it possible to add more than one label with triggers to the same item?

I would like to assign several labels (e.g. name, process time 1, process time 2, ...) to the same flowitem when creating a flowitem. So far I have only found the option to add more labels via another trigger, but these labels are then assigned independently of the labels assigned in the first trigger. It is important that I can assign a certain combination of labels to the individual flowitems.

Thanks in advance for the help :-)

FlexSim 23.1.4
labelstriggerscreating labels
· 3
5 |100000

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

David Seo avatar image David Seo commented ·

@Patrick

You can assign many labels to the same item in one trigger.

example name, ct1, ct2,...

What's the meaning of combination of labels?

0 Likes 0 ·
Patrick avatar image Patrick David Seo commented ·

Thanks for the feedback.

Yes I know that, however I would like to generate a lot of different products. Each product should be identifiable by a label "product". E.g. product A, product B, .... To each product I want to give specific information e.g. process time 1, process time 2, ..... The process time differs from product to product. How do I get a suitable assignment of the process times (as label) to the corresponding products?

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

Hi @Patrick, was Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Patrick commented

The number of options you can add to a trigger is not limited. You should be able to add multiple labels to an item within a single trigger.

1692771188766.png

If only certain combinations of labels are valid, you can either write those into a table, determine the row from which to read the values and then assign those to the item. Or you use a code snippet with if-conditions or a switch-statement to select the fitting values based on the randomly generated first label value.


1692771188766.png (9.4 KiB)
· 3
5 |100000

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

Patrick avatar image Patrick commented ·

Thanks for the answer. :-)

Exactly, only certain combination of values are valid. Is there no way to map this using a combination of triggers? Does this always have to be done via a table or code snippet?
Thanks in advance.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Patrick commented ·

Those combinations have to be defined somewhere. There are other ways to store this information than a table, but the table is likely the most convenient.

The code to assign them from a table would look something like this:

Table labelCombos = Table("LabelCombinations");
int row = duniform(1, labelCombos.numRows, getstream(current)); item.label1 = labelCombos[row][1]; item.label2 = labelCombos[row][2]; ...

The other method of assigning them one by one (first label is random, possible values for next labels always depend on combination up to that point) would require more code (probably switch-statements as mentioned earlier).

Which option is better/easier/faster will depend on the nature of the label combinations. If they follow straightforward rules, then a coding approach will be a good option. If they are more "arbitrary" the table will be faster than writing tons of rules in code.

0 Likes 0 ·
Patrick avatar image Patrick Felix Möhlmann commented ·

Ok thank you very much for your explanations.
I think I will try to implement it with a table.

Thanks for the support :-)

0 Likes 0 ·