protected override void AppendSimulationResultsToOutput(SimulationResults <SirAgent, SirStateModel> resultSet)
        {
            lock (_fileLock)
            {
                var outputFile = File.AppendText(_outputFileName);

                if (!_headingHasBeenWritten)
                {
                    outputFile.WriteLine(resultSet.CsvHeading());
                    _headingHasBeenWritten = true;
                }

                outputFile.Write(resultSet.CsvString());
                outputFile.Close();
            }
        }
Beispiel #2
0
        protected override void AppendSimulationResultsToOutput(SimulationResults <Human, CovidStateModel> simulationResults)
        {
            lock (_fileLock)
            {
                Log.Verbose($"Saving results for Simulation {simulationResults.IterationNumber}");
                var outputFile = File.AppendText(_outputFileName);

                if (!_headingHasBeenWritten)
                {
                    outputFile.WriteLine(simulationResults.CsvHeading());
                    _headingHasBeenWritten = true;
                }

                outputFile.Write(simulationResults.CsvString());
                outputFile.Close();
            }
        }