예제 #1
0
        private void Method_MonteKarlo(object sender, RoutedEventArgs e)
        {
            try
            {
                MonteKarlo monteKarlo = new MonteKarlo(projects[0].Lambdas, 100000000);
                projects[0].Results.Clear();
                projects[0].Results.Add(new MeanTimeToFailure(monteKarlo.MeanTimeToFailure));
                projects[0].Results.Add(new FailureRate(monteKarlo.FailureRate));
                projects[0].Results.Add(new ProbabilityOfNoFailure(monteKarlo.FailureRate, 10000));
                GridProp.ItemsSource = projects[0].Results;

                GridProp.Items.Refresh();
            }catch (ArgumentNullException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void Method_MonteKarlo(object sender, RoutedEventArgs e)
 {
     try
     {
         MonteKarlo monteKarlo = new MonteKarlo(Projects[0].Lambdas, Convert.ToInt32(100 * Math.Pow(10, Accuracy)), Projects[0].Property[3].Value);
         Projects[0].Results.Clear();
         Projects[0].Results.Add(new MeanTimeToFailure(monteKarlo.MeanTimeToFailure));
         Projects[0].Results.Add(new FailureRate(monteKarlo.FailureRate));
         Projects[0].Results.Add(new ProbabilityOfNoFailure(monteKarlo.FailureRate, (long)Projects[0].Property[2].Value));
         Projects[0].Results.Add(new GammaPercentTimeToFailure(monteKarlo.GammaPercentTimeToFailure));
         GridProp.ItemsSource = Projects[0].Property.Concat(Projects[0].Results);
         ;
         SerieFunc = GraphicView.GraphicView.Reliability(monteKarlo.FailureRate);
         SerieHis  = GraphicView.GraphicView.Histograma(Projects[0].Lambdas);
         LabelsHis = new ObservableCollection <string>(Projects[0].Elements.Select((el) => { return(el.Designation); }));
         Formatter = value => Math.Pow(10, value).ToString("N");
         ReliabilityGrid.Visibility = Visibility.Visible;
         DataContext = this;
         GridProp.Items.Refresh();
     }catch (ArgumentNullException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }