I have a question of assigning value to attributes. For example, I have 3 user defined attributes of an entity: color, shape, size. Value of each attribute based on their frequency.
color: 10% red, 30% white and 60% black
shape: 50% round and 50% squrare
size: 70% small and 30% regular
How can I create a source to random assign entity's attributes by their frequency?
And how can I randomly create a production plan base on these frequency?
Please let me know if anything not clear to you.
Solved! Go to Solution.
Hello Wendy Wang,
you can use the Variants Generator for this.
There you can define the attributes and the desired probability. It is also possible to define Constraints, combination of attributes which are not allowed.
Hope this will help
This should not be too hard to do on the enterance control of the source.
var rand: Integer := round(Z_Uniform(1, 0, 100)) if 10 > rand @.VectorGraphicsColor := makeRGBValue(255, 0, 0) elseif 10 <= rand AND rand < 40 @.VectorGraphicsColor := makeRGBValue(0, 128, 0) else @.VectorGraphicsColor := 0 end
Hopefuly the above code will give you some idea of what will be needed, this should set the color at roughly the pecentages that you have asked for, you will need to make similar blocks of code to then set the other values that you want (ensuring you get a new random number each time)
using the tool VariantsGenerator you can generate the frequency table for a Source object with MUselection “Random”. To load this tool click on Manage Class Library on the Home menu (tab Libraries).
The attached model for Plant Simulation 12.0 shows the solution for your question. You can also define constraints: For instance the variant “white”, “round”, “regular” can be impossible for any reason.
The type statistics of the Drain object can be used for the verification.