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

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

Patrick13
Not applicable
138 Views
7 Replies
Message 1 of 8

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

Patrick13
Not applicable

[ FlexSim 23.1.4 ]

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 🙂

0 Likes
Accepted solutions (1)
139 Views
7 Replies
Replies (7)
Message 2 of 8

support5CRPZ
Advocate
Advocate

@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?

email ID : support@flexsim.co.kr & support@simflex.co.kr
0 Likes
Message 3 of 8

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

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.

0 Likes
Message 4 of 8

Patrick13
Not applicable

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
Message 5 of 8

Patrick13
Not applicable

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
Message 6 of 8

moehlmann_fe
Enthusiast
Enthusiast

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
Message 7 of 8

Patrick13
Not applicable

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
Message 8 of 8

Jeanette_Fullmer
Community Manager
Community Manager

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