public void RunOneFrame() { framesRuned++; for (int i = 0; i < NoRobots; i++) { Robots[i].UpdatePositionAndClean(Room, random); } int tC = Room.numCleanedTiles(); int tT = Room.TilesNo; decimal cov = (decimal)tC / tT * 100; covarage = Convert.ToInt32(cov); visualForm.Invalidate(); }
private void Simulate_Click_1(object sender, EventArgs e) { visualForm = new Visual(); sim = new Simulator((int)numericUpDown1.Value, (int)numericUpDown4.Value, (int)numericUpDown2.Value, (int)numericUpDown3.Value, (int)numericUpDown5.Value, (int)numericUpDown6.Value, visualForm); if (sim.NoTrials <= 1) { visualForm.Width = sim.Room.Width + 18; visualForm.Height = sim.Room.Height + 40; visualForm.Show(this); MoveChildForm(); visualForm.Invalidate(); timer1.Enabled = true; } else { sim.RunSimulation(); richTextBox1.Text = sim.PrintData(); } }