Beispiel #1
0
 //Stop simulation button
 private void button3_Click(object sender, EventArgs e)
 {
     this.button2.Enabled = true;
     this.button3.Enabled = false;
     Rides                 = 0;
     IddleRides            = 0;
     MovedMass             = 0;
     NumberOfCreatedPeople = 0;
     foreach (FlowLayoutPanel pan in AwaitingPeopleContainer)
     {
         pan.Controls.Clear();
     }
     foreach (FlowLayoutPanel pan in ExitedPeopleContainer)
     {
         pan.Controls.Clear();
     }
     foreach (CheckBox chb in OuterActiveFloorButtons)
     {
         chb.Checked = false;
     }
     foreach (CheckBox chb in InnerActiveFloorButtons)
     {
         chb.Checked = false;
     }
     panel3.Location = new Point(155, 10 + 25 * (NumberOfFloors - 1));
     StopSimulation?.Invoke();
 }
Beispiel #2
0
 /// <summary>User is trying to stop all currently executing simulations.
 /// <param name="e">Event arguments.</param>
 protected void OnStopClicked(object o, EventArgs e)
 {
     if (StopSimulation != null)
     {
         EventArgs args = new EventArgs();
         StopSimulation.Invoke(this, args);
     }
 }
Beispiel #3
0
        public void ScheduleStop()
        {
            long       stopIn = 1000L;
            Simulation sim    = new Simulation();

            StopSimulation.Stop(sim, stopIn);
            Assert.AreEqual(0, sim.Run());
            Assert.AreEqual(stopIn, sim.Now);
            Assert.AreEqual(stopIn, sim.StopTime);
        }
Beispiel #4
0
        private void StopRunningSimulation(StopSimulation m)
        {
            Context.GetLogger().Info($"Stop Simulation {m.ProjectId}");

            _currentSimulation.Actor.Tell(m);
            ClearSimulation();
            Sender.Tell(new SimulationStopped {
                ProjectId = m.ProjectId
            });
            Become(FreeForSimulations);
        }
Beispiel #5
0
        public void ScheduleMultipleStops()
        {
            Simulation sim = new Simulation();

            for (int i = 0; i < 10; i++)
            {
                long stopIn = 1000L * i + 1000L;
                StopSimulation.Stop(sim, stopIn);
            }

            Assert.AreEqual(9, sim.Run());
            Assert.AreEqual(1000L, sim.Now);
            Assert.AreEqual(1000L, sim.StopTime);
        }
Beispiel #6
0
 /// <summary>User is trying to stop all currently executing simulations.</summary>
 /// <param name="o">Sender object.</param>
 /// <param name="e">Event arguments.</param>
 protected void OnStopClicked(object o, EventArgs e)
 {
     try
     {
         if (StopSimulation != null)
         {
             EventArgs args = new EventArgs();
             StopSimulation.Invoke(this, args);
         }
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
 private void StopButton_Click(object sender, EventArgs e)
 {
     StopSimulation?.Invoke();
 }