This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.
Labels_Routing
This model simulates 3 different types of a product that need to be sorted.
Model Specific Implementation
1. In the Flowitem Bin, create a label on the Textured Colored Box
called type.
2. Add a function to the OnExit trigger of the Source using the Set Label option. Edit the blue text to read as follows:
Object: Item
Label: "type"
Value: duniform(1,3).
3. Add another function to the OnExit trigger of the Source using
the Set Color by Value option. Edit the blue text to read as
follows:
Value: getlabelnum(item,"type"
case 1: colorred(item); break;
case 2: colorgreen(item); break;
case 3: coloryellow(item); break;
4. In the Queue,on the Flow tab, select Cases by Value from
the Send to Port list. The default parameters will work for this
model.
General Implementation
1. First, create a label on the class of flowitem that will be
generated by the Source in the model. Flowitem classes are found
in Tools > Flowitem Bin, and new labels can be created on the
flowitem using the Labels tab of its Properties window. Be
sure to give the new label an applicable name, and an initial value.
2. The specific value of the label on each flowitem can be set as
they leave the Source using the Set Label option of the OnExit
trigger.
3. The values assigned to each flowitem's label can be queried at
downstream objects in the model to help define the flow. The By
Expression and Cases by Value options in the Send To Port
field of an object are especially useful for this purpose.