private void button1_Click(object sender, EventArgs e) { simulation = new WorldSimulation(); drawing = new DrawService(simulation.WorldSize); sw = Stopwatch.StartNew(); simulation.RunSimulation(); sw.Stop(); var time = sw.ElapsedMilliseconds; simulation.statistic.AlgorithmTime = time; var table = drawing.ConstructDataTable(simulation.allAgents); this.worldView.DataSource = table; for (int i = 0; i < worldView.ColumnCount; i++) { worldView.Columns[i].Width = width; } MessageBox.Show($"Simulation is completed."); }