I have 3 different labels going in to a processor. All 3 labels have different processing time for which, I have used values by case. Can anyone help me on how to divide one of the label processing times further more into percentage?

FlexSim 22.2.0

Comment

·
3

Hello @Kshitij Dhake,

You will need to edit the code to accomplish this. Can you attach your mode if you would like an example of how to accomplish this?

Here is the model. For label "three" .I want the cycle time to be 70 s for 50% of the how many "three" enter the processor and 160 for 30 % of the how many "three" enter the processor

processor-time.fsm
(27.2 KiB)

Hi @Kshitij Dhake, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. 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 comment back to reopen your question.

As Jeanette mentioned, you have to edit the code that determines the process time. In the example below I assumed that the missing 20% would be processed for the currently used value of 350s.

/**Custom Code*/

Object current = ownerobject(c); Object item = param(1); Variant value = item.Type; double retValue = 1; if (value == "one"){ retValue = 150;} if (value == "two"){ retValue = 100;} if (value == "three"){ double rand = uniform(0, 100, getstream(current)); if(rand < 50) { retValue = 70; } else if(rand < 80) { retValue = 160; } else { retValue = 350; } } return retValue;

processor-time-1.fsm
(27.4 KiB)

·
3

- (rand < 50) {
- retValue = 70;
- }
- else if(rand < 80) {
- retValue = 160;

does "rand<80" mean 20% ?

Those are cumulative values. "rand" is a random number between 0 and 100.

double rand = uniform(0, 100, getstream(current));

The first check asks if the number is smaller than 50 which will be true in 50% of the cases.

if(rand < 50)

The next check, that only happens if the number is larger than 50, asks if the number is smaller than 80. This will be true in 30% of all cases (50 < rand < 80).

else if(rand < 80)

Since there are only three cases, the last case doesn't need a condition, it simply takes all cases that haven't met a condition up to that point.

**5** 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.

- site links
- www.flexsim.com
- contact us
- blog
- archived forum