} // end of BackGroundWorkerNonVisualizationProgressChanged #endregion #region BackGroundWorkerNonVisualizationRunWorkerCompleted void BackGroundWorkerNonVisualizationRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (SimulationModel.StopSimulation(CurrentTime)) { ActionsAfterFinishingSimulationRun(); } // end if } // end of BackGroundWorkerNonVisualizationRunWorkerCompleted
} // 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