Example #1
0
        public void OnUIRefresh(OSPABA.Simulation sim)
        {
            var simulacia = sim as simulation.VacCenterSimulation;

            if (casLabel.InvokeRequired)
            {
                GUIStatUpdateCallback d = new GUIStatUpdateCallback(OnUIRefresh);
                Invoke(d, new object[] { sim });
            }
            else
            {
                UpdateGUI();
            }
        }
Example #2
0
        public void OnFinish(OSPABA.Simulation sim)
        {
            var simulacia = sim as simulation.VacCenterSimulation;

            if (casLabel.InvokeRequired)
            {
                GUIStatUpdateCallback d = new GUIStatUpdateCallback(OnFinish);
                Invoke(d, new object[] { sim });
            }
            else
            {
                startPauseButton.Text = "Start";
                UpdateGUI();
                if (simulacia.AktualneParametreSimulacie.ZobrazenieZavislosti)
                {
                    _zobrazovanaKrivka.Points.Add(new OxyPlot.DataPoint(simulacia.AgentVysetrenia.PocetPracovnikov, simulacia.PriemernaDlzkaRaduVysetrenie.Mean()));
                    PrekresliGraf();
                }
            }
        }
Example #3
0
        public void OnReplicationStart(OSPABA.Simulation sim)
        {
            if (casLabel.InvokeRequired)
            {
                GUIStatUpdateCallback d = new GUIStatUpdateCallback(OnReplicationStart);
                Invoke(d, new object[] { sim });
            }
            else
            {
                tabulkaPacienti.Rows.Clear();

                double[] confidenceInterval;
                int      i          = 0;
                int      replikacia = _simulation.CurrentReplication + 1;
                tabulkaReplikacie.Rows[i++].Cells[1].Value = (replikacia).ToString();


                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.####}min", ((_simulation.PriemernyNadcas.Mean() / 60)));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.####}", (_simulation.PriemernaDlzkaRaduRegistracia.Mean()));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.####}s", (_simulation.PriemernyCasCakaniaRegistracia.Mean()));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.##}%", (_simulation.PriemerneVytazenieAdmin.Mean() * 100));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.####}", (_simulation.PriemernaDlzkaRaduVysetrenie.Mean()));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.####}s", (_simulation.PriemernyCasCakaniaVysetrenie.Mean()));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.##}%", (_simulation.PriemerneVytazenieDoktor.Mean() * 100));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.####}", (_simulation.PriemernaDlzkaRaduOckovanie.Mean()));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.####}s", (_simulation.PriemernyCasCakaniaOckovanie.Mean()));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.##}%", (_simulation.PriemerneVytazenieSestricka.Mean() * 100));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.####}", (_simulation.PriemernaDlzkaRaduStriekacky.Mean()));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.####}s", (_simulation.PriemernyCasCakaniaStriekacky.Mean()));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.##}", (_simulation.PriemernyPocetLudiVCakarni.Mean()));
                tabulkaReplikacie.Rows[i++].Cells[1].Value = string.Format("{0:0.##}s", (_simulation.PriemernaCakaciaDoba.Mean()));


                if (_simulation.CurrentReplication > 1)
                {
                    i = 1;
                    confidenceInterval = _simulation.PriemernyNadcas.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.####}", confidenceInterval[0] / 60)}, {string.Format("{0:0.####}", confidenceInterval[1] / 60)}>");

                    confidenceInterval = _simulation.PriemernaDlzkaRaduRegistracia.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.####}", confidenceInterval[0])}, {string.Format("{0:0.####}", confidenceInterval[1])}>");

                    confidenceInterval = _simulation.PriemernyCasCakaniaRegistracia.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.##}s", confidenceInterval[0])}, {string.Format("{0:0.##}s", confidenceInterval[1])}>");

                    confidenceInterval = _simulation.PriemerneVytazenieAdmin.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.##}", confidenceInterval[0] * 100)}, {string.Format("{0:0.##}", confidenceInterval[1] * 100)}>");

                    confidenceInterval = _simulation.PriemernaDlzkaRaduVysetrenie.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.####}", confidenceInterval[0])}, {string.Format("{0:0.####}", confidenceInterval[1])}>");

                    confidenceInterval = _simulation.PriemernyCasCakaniaVysetrenie.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.##}s", confidenceInterval[0])}, {string.Format("{0:0.##}s", confidenceInterval[1])}>");

                    confidenceInterval = _simulation.PriemerneVytazenieDoktor.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.##}", confidenceInterval[0] * 100)}, {string.Format("{0:0.##}", confidenceInterval[1] * 100)}>");

                    confidenceInterval = _simulation.PriemernaDlzkaRaduOckovanie.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.####}", confidenceInterval[0])}, {string.Format("{0:0.####}", confidenceInterval[1])}>");

                    confidenceInterval = _simulation.PriemernyCasCakaniaOckovanie.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.##}s", confidenceInterval[0])}, {string.Format("{0:0.##}s", confidenceInterval[1])}>");

                    confidenceInterval = _simulation.PriemerneVytazenieSestricka.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.##}", confidenceInterval[0] * 100)}, {string.Format("{0:0.##}", confidenceInterval[1] * 100)}>");

                    confidenceInterval = _simulation.PriemernaDlzkaRaduStriekacky.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.####}", confidenceInterval[0])}, {string.Format("{0:0.####}", confidenceInterval[1])}>");

                    confidenceInterval = _simulation.PriemernyCasCakaniaStriekacky.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.##}s", confidenceInterval[0])}, {string.Format("{0:0.##}s", confidenceInterval[1])}>");

                    confidenceInterval = _simulation.PriemernyPocetLudiVCakarni.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.##}", confidenceInterval[0])}, {string.Format("{0:0.##}", confidenceInterval[1])}>");

                    confidenceInterval = _simulation.PriemernaCakaciaDoba.ConfidenceInterval95;
                    tabulkaReplikacie.Rows[i++].Cells[2].Value = string.Format($"<{string.Format("{0:0.##}s", confidenceInterval[0])}, {string.Format("{0:0.##}s", confidenceInterval[1])}>");
                }
            }
        }