question

Eric C2 avatar image
0 Likes"
Eric C2 asked Ben Wilson commented

SOURCE

Hi All,

What can I do to generate from a source two different kind of output?

I mean, I want to generate a first output from a source with one size and the next one with another size alternatively.

The first sould be 2x1x1 size and the next one 2,5x1,5x1, then the third one should be like the first and the fourth like the second and repeat this generation.

I know how to change the size using a trigger on Exit, but when I do that all the items are the same and they do not change the dimension.

Someone can help me?

Thank you.

FlexSim 21.0.1
sourceflexsim 21.0.1
· 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.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Eric C2, was jason.lightfoot's or Jörg Vogel's or Seung Yong Seo's answer helpful? If so, please click the red "Accept" button at the bottom one of their answers. 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 unaccept and comment back to reopen your question.

0 Likes 0 ·
Jason Lightfoot avatar image
2 Likes"
Jason Lightfoot answered Jason Lightfoot edited

You can use a schedule or sequence that repeats where you label each as type 1 and 2 and then in the creation trigger change the shape based on the type.

Or you can see if the number that you've output is even or odd and set the shape based on that.

Or you can set a label each time you create an item and test it at the next creation - so the label flips between two values, and then use that to determine the size to create.


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

Joerg Vogel avatar image Joerg Vogel commented ·

Or you have two output ports and you send items by round robin property to these two ports. On Exit you can set the size by case depending on the variable port.

1 Like 1 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Joerg Vogel commented ·

And then change the shape on exit rather than creation. Both outputs can be to the same object that the source feeds.

0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

Here my approach from comment

SendToPortRoundRobin_SizeBy2DLabelArray.fsm

I store the sizes of items in an array at label iSize in the source. It is a 2D array in the form

[[x1,y1,z1],[x2,y2,z2]] I get the first or second size value array by variable port of the On Exit trigger.


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
0 Likes"
David Seo answered

@Eric C2

You should solve TWO issue for your problem.

The first is round robbin item type when creation and the second is to change the size by the item type. I upload the sample the first issue solved And then I hope you will solve the second issue.

roundRobbin_Source.fsm

If you have any question about the model, let me know it.


5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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