Пример #1
0
        private void startSimButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (eventDataGridView.Rows.Count == 0)
                {
                    MessageBox.Show("No CSV Loaded");
                    return;
                }
                DateTime startTimePicked = startTimePicker.Value;
                DateTime startTime       = new DateTime(startTimePicked.Year, startTimePicked.Month, startTimePicked.Day, 0, 0, 0);

                DateTime endTimePicked = endTimePicker.Value;
                DateTime endTime       = new DateTime(endTimePicked.Year, endTimePicked.Month, endTimePicked.Day, 23, 59, 0);

                if (DateTime.Compare(endTime, startTime) <= 0)
                {
                    throw new Exception("Start should be earlier than end");
                }

                simulator.setGoldenTime(Convert.ToDouble(goldenTimeText1.Text), Convert.ToDouble(goldenTimeText2.Text));
                simulator.updateEventsBtwRange(startTime, endTime);
                simulator.start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


            SimulationResult frm = new SimulationResult(this);

            frm.Show();
        }
Пример #2
0
        public Analysis(SimulationResult _form)
        {
            InitializeComponent();

            itemListBox.Items.AddRange(new object[] { "Number of Events", "Coverage Rate", "Rescue Success Rate", "Drone Arrival Rate", "Mean of Elapsed Time", "Standard Deviation of Elapsed Time", "Weather Problem" });
            resultForm = _form;
            addCombobox();
        }