How to tackle -ve values from distribution without impacting mean value?

How to tackle -ve values from distribution without impacting mean value?

rajankur6494
Collaborator Collaborator
373 Views
1 Reply
Message 1 of 2

How to tackle -ve values from distribution without impacting mean value?

rajankur6494
Collaborator
Collaborator

[ FlexSim 25.0.0 ]

Hi Team,

I observed that whenever lognormal distribution is throwing negative values, it is picking the 0 value for repair time which is not possible in real system.

1735323970666.png

I would like to filter the 0 values from the table. But my concern is that it will impact the mean value of distribution. What are the other ways to handle this problem?

Breakdown_Count_Reps.fsm

Thank you!

0 Likes
Accepted solutions (1)
374 Views
1 Reply
Reply (1)
Message 2 of 2

arunTTT2P
Collaborator
Collaborator
Accepted solution

Try avoiding -ve or zero values in the MTTR value by modifying the code using a while loop.

double repairTime = -1
while (repairTime <= 0) {
    repairTime = lognormalmeanstdev(84.13, 110.3, getstream(current));
}
return repairTime;

If this is not is acceptable try some minimum repair time when the repair time becomes less than or equal to zero.

double repairTime =lognormalmeanstdev(84.13, 110.3, getstream(current));
if(repairTime <=0)
{
   repairTime = minRepairTime;
}

Regards,

Arun KR

0 Likes