public void Sim_DefectTime() { if (this.qualityloss <= 0) { Time_To_Defect = int.MaxValue; } else { int holder = (int)mtbql_dist.Sample(); this.Time_To_Defect = holder; } }
static void Main(string[] args) { double[,] array = new double[500000, 2]; double mtbf = 1.0 / 100; double mttr = 1.0 / 2; MathNet.Numerics.Distributions.Exponential mtbf_expon = new MathNet.Numerics.Distributions.Exponential(mtbf); MathNet.Numerics.Distributions.Exponential mttr_expon = new MathNet.Numerics.Distributions.Exponential(mttr); for (int i = 0; i < 500000; i++) { array[i, 0] = mtbf_expon.Sample(); array[i, 1] = mttr_expon.Sample(); } //Console.WriteLine(array.Average().ToString()); int j = 0; }
public void Sim_DownTime() { if (!this.mttr.HasValue || this.mttr == 0) { this.NextDownTime = 0; } else { int holder = (int)mttr_dist.Sample(); if (holder == 0) { holder = 1; } this.NextDownTime = holder; } }
public void Sim_UpTime() { if (!this.mtbf.HasValue || this.mtbf == 0) { this.ThisUpTime = int.MaxValue; } else { int holder = (int)mtbf_dist.Sample(); if (holder == 0) { holder = 1; } this.ThisUpTime = holder; } }
public void Sim_UpTime() { if (this.mtbf <= 0) { this.ThisUpTime = int.MaxValue; } else { int holder = (int)mtbf_dist.Sample(); if (holder <= 10) { holder = 10; } else if (holder >= 86400) { holder = 86400; } this.ThisUpTime = holder; } }