Exemple #1
0
        } // end of BackGroundWorkerNonVisualizationProgressChanged

        #endregion

        #region BackGroundWorkerNonVisualizationRunWorkerCompleted

        void BackGroundWorkerNonVisualizationRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (SimulationModel.StopSimulation(CurrentTime))
            {
                ActionsAfterFinishingSimulationRun();
            } // end if
        }     // end of BackGroundWorkerNonVisualizationRunWorkerCompleted
Exemple #2
0
        } // end of ActionsAfterFinishingSimulationRun

        #endregion

        #region NonVisualizationLoop

        public void NonVisualizationLoop()
        {
            DateTime originalTimerTime = CurrentTime;

            while (BackgroundWorkerNonVisualization.CancellationPending == false &&
                   !SimulationModel.StopSimulation(CurrentTime))
            {
                DateTime newTime;
                bool     modelRunning = SimulationEngine.RunSingleStepSimulationModel(_currentTime, out newTime);

                if (modelRunning)
                {
                    BackgroundWorkerNonVisualization.ReportProgress(SimulationEngine.SimulationModel.GetSimulationProgress(newTime));
                    _currentTime = newTime;
                } // end if
            }     // end while
        }         // end of