Exemple #1
0
        public void printColorRunChart(BackgroundWorker b)
        {
            if (!int.TryParse(this.tb_Steps.Text, out this.steps))
            {
                MessageBox.Show("Please insert a valid value to the steps box");
                b.CancelAsync();
                return;
            }
            UrnPolya.Urn a = this.selected_urn_process();
            if (a == null)
            {
                return;
            }
            a.simulation(steps, this.backgroundWorker2);
            if (a == null)
            {
                return;
            }
            double[,] result = a.getProportions();

            F_grafico f_grafico = new F_grafico(result, this.ColorsUsedList, steps + 1);

            f_grafico.ShowDialog();
        }
Exemple #2
0
        public void PrintChart(BackgroundWorker b)
        {
            if (!int.TryParse(this.tb_Steps.Text, out this.steps))
            {
                MessageBox.Show("Please insert a valid value to the steps box");
                b.CancelAsync();
                return;
            }
            if (!int.TryParse(this.tb_simulations.Text, out this.simulations))
            {
                MessageBox.Show("Please insert a valid value to the simulations box");
                b.CancelAsync();
                return;
            }
            UrnPolya.Urn a = this.selected_urn_process();
            if (a == null)
            {
                return;
            }
            double[,] r = UrnPolya.Urn.colors_AvarageRatio(a, steps, simulations, b);
            F_grafico f = new F_grafico(r, this.ColorsUsedList);

            f.ShowDialog();
        }