AnswerHub Upload Issue
Our AnswerHub community currently has a bug that prevents you from attaching your model or other files to your questions. AnswerHub is aware of this issue and they are working on a fix. Until we receive their patch, you can upload your models and other files to FlexSim's file share site. Include the file name in your question so that we know which upload to reference.

question

Francisco T avatar image
0 Likes"
Francisco T asked Joerg Vogel answered

trigger for source

Hello everyone! I would like to know what trigger or label I should use so that my source first generates a type 1 resource, then one of type 2 and so on, because if I use the duniform or any of the statistical distributions that appear the resources are generated with values of 1.42, 1.58, etc. and I want them to have exact type values such as 1 or 2. And I also need to know how to make the source give it a specific color according to the type, I know it is a very general question but I can't get it and I already saw All the videos about that on the internet. Thank you!

labelssourceresourcetriggers
5 |100000

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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered

On the source add an On Creation trigger and then use the Set Item Type and Color pickoption. This option defaults to using duniform(1,3) which will randomly set the item’s Type label to 1,2, or 3. It then sets the color according to its Type value.

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
0 Likes"
Joerg Vogel answered

The statistical distributions starting with a "d" character in there name indicate, that they return integer values (discrete values).

  • duniform( ..)
  • dempirical(..)

if you open a trigger in one of 3D objects' properties, you can add by the green cross icon picklist options. They are predefined source code templates.

One of them is the option "Set Label and Color".
Earlier version called this "Set Type and Color". The default setting sets the Label Type and assign a color to the Object item by the result of Value

duniform(1,3,getstream(current))   

The statistical distribution duniform returns an integer value from the range [1..3] randomly choosen by random generator with seed values of getstream(current).

This integer value will be the value of the label and chooses a color of default array [red, green, blue, yellow, ..] by the index number.

Maybe you try to watch basic FlexSim videos, even if they outdated by now, they still give you a grip on the mechanisms in this simulation tool.


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.