コード例 #1
0
        public bool Run(int numberOfDays)
        {
            Log.Verbose($"Simulation {IterationNo} preparing environment");
            PrepareSimulation(numberOfDays);

            if (_hasBeenRun)
            {
                throw new InvalidOperationException("The simulation has already been run");
            }
            SimulationResults = new SimulationResults <TAgent, TMultiStateModel>(MultiStateModel, numberOfDays, StartDate, IterationNo, GenerateDailyRecordInstance);

            Iterate(numberOfDays);
            _hasBeenRun = true;

            Log.Verbose($"Simulation {IterationNo} finished running");

            return(_hasBeenRun);
        }
コード例 #2
0
 protected abstract void AppendSimulationResultsToOutput(SimulationResults <TAgent, TMultiStateModel> itemSimulationResults);