question

Manocher Djassemi avatar image
0 Likes"
Manocher Djassemi asked Joerg Vogel commented

ItemType set by Separator

I want to use a Separator to split an item into 5 items and set the ItemType and Color. When I use Set ItemType and Color in OnExit menu, it gives me the option duniform (1,5). When I run the model, the separator produces 3 of itemtype 1, 1 of itemtype 2 and 1of itemtype 4. I want to see all 5 itemtypes are produced every time. What is my option? Do I need to enter a flexscript at OnExit? Thanks

FlexSim 17.1.6
separator
· 1
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

duniform is a random statistical distribution. Please read in the command manual. The result is a random chosen discrete value in the range of low to high value. The option consist of setting the item type by an incremented label of the separator. You set the label OnEntry trigger to the value 1. OnExit you assign this label value as type to the item. Then you increment the label value by 1 in the OnExit trigger a picklist option.

0 Likes 0 ·

1 Answer

David Seo avatar image
0 Likes"
David Seo answered Joerg Vogel commented

@Manocher Djassemi

I made a sample model of your question. I made the separator connected five output port and custom script in the 'send to port' trigger.

I think you will be able to make the model to use one output port.

itemtypesetbyseparator.fsm


· 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.

Manocher Djassemi avatar image Manocher Djassemi commented ·

I applied Jorg's method, but still the separator produces one item type in 5 colors rather than 5 item types in 5 colors. See the Separator1 in the attached model. Is the code for incrementing label "itemcounter" correct?

0 Likes 0 ·
David Seo avatar image David Seo Manocher Djassemi commented ·

@Manocher Djassemi

I attached my upgraded model.

itemtypesetbyseparator2.fsm

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Manocher Djassemi commented ·

There are some mismatches in your triggers:

OnEntry: Object is current not item

OnExit: add a new action - Set Item Type

  • Object is item
  • Type use the Sampler tool (right) and choose the separator itself in the 3D View and pick current.itemcounter

you move this action on top of the list. The actions OnExit are:

  1. Set Itemtype
  2. Set Label increment Label at current
  3. Set Object Color
0 Likes 0 ·