How to create a label in Flexsim using By Percentage but the total number of one label of two is not more than 100pcs. Thank you in advance for your help.
How to create a label in Flexsim using By Percentage but the total number of one label of two is not more than 100pcs. Thank you in advance for your help.
You'll have to write some custom code for this. I would generate one value as normal, then generate another value until the sum of both doesn't exceed 100. One value is assigned to the current item, the other one is stored in a label on the source, so it can be assigned to the next item. If no stored value exists, a new value pair is generated.
In the example model I use an empirical distribution to generate the random values, so the code is less cluttered and hopefully easier to understand.
/**Custom Code*/ Object current = ownerobject(c); Object item = param(1); int rownumber = param(2); //row number of the schedule/sequence table // Make sure that source labels exist current.labels.assert("StoredValues", []).value; current.labels.assert("Index", 0).value; if(current.StoredValues.length == 0) { // No more stored values -> Create new ones and increment index double firstValue = Empirical("TestDistribution").get(getstream(current)); double secondValue = Empirical("TestDistribution").get(getstream(current)); while(firstValue + secondValue > 100) { // Keep rerolling until sum is not larger than 100 secondValue = Empirical("TestDistribution").get(getstream(current)); } // Update source labels current.StoredValues = [firstValue, secondValue]; current.Index += 1; } // Assign labels to item item.Value = current.StoredValues.shift(); item.PairID = current.Index; item.color = Color.byNumber(item.PairID);
Dear Felix,
thank you for your ideas in supporting me in my issue.
I think I did not put the question correctly.
Below is an example of a problem on the screen that needs to be solved.
Please take a look at it if you have a chance to help, I would be grateful.
Thank you in advance!
Sorry, but I don't see what the problem in your screenshot is. You have the pass/fail number, can thus calculate the failure rate and use it in the format you show.
It is possible to assign the label in a single expression using bernoulli(). Though that can only return numbers, not strings.
Felix, the problem is as follows:
When randomly generating repair items, when creating an item using the By Percentage function, 1658,0 items (51,95%) are generated. These items go to the Queue after creation. After reaching Queue I need to create a batch of 6 items to be sent to the next workcenter.
When 1658 repair items are generated, the number of batches is not an even number 1658/6 = 276,3 and I still have items on Queue that cannot be formed into a batch.
So the goal is to randomly generate a number of repair items close to 51,95% but still even number of items in the batch. For example 1656 pieces. In this case the number of batches will be 1656/6 = 276, and it will give the opportunity to form batches of all items and pass to the next work center.
Can we use another solution instead of the By Percentage function?
11 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved