/// <summary> /// Constructor for Reproduction: fills the list of available implementations of reproduction /// </summary> public Reproduction(string globalModelTimeStepUnit, Boolean drawRandomly) { // Initialize the list of reproduction implementations Implementations = new SortedList<string, IReproductionImplementation>(); // Add the basic reproduction implementation to the list of implementations ReproductionBasic ReproductionImplementation = new ReproductionBasic(globalModelTimeStepUnit, drawRandomly); Implementations.Add("reproduction basic", ReproductionImplementation); }
/// <summary> /// Copy parameter values to a text file in the specified output directory /// </summary> /// <param name="outputDirectory">THe directory for outputs</param> public void CopyParameterValues(string outputDirectory) { // Create a stream write object to write the parameter values to StreamWriter sw = new StreamWriter(outputDirectory + "Parameters.txt"); // Write out the column headings sw.WriteLine("Ecological process\tParameter name\tParameter value"); // Create dummy instances of the ecological processes RevisedHerbivory DummyHerbivory = new RevisedHerbivory(0.0, _GlobalModelTimeStepUnit); RevisedPredation DummyPredation = new RevisedPredation(0.0, _GlobalModelTimeStepUnit); MetabolismEndotherm DummyEndoMetabolism = new MetabolismEndotherm(_GlobalModelTimeStepUnit); MetabolismEctotherm DummyEctoMetabolism = new MetabolismEctotherm(_GlobalModelTimeStepUnit); BackgroundMortality DummyBackgroundMortality = new BackgroundMortality(_GlobalModelTimeStepUnit); SenescenceMortality DummySenescenceMortality = new SenescenceMortality(_GlobalModelTimeStepUnit); StarvationMortality DummyStarvationMortality = new StarvationMortality(_GlobalModelTimeStepUnit); ReproductionBasic DummyReproduction = new ReproductionBasic(_GlobalModelTimeStepUnit, _DrawRandomly); DiffusiveDispersal DummyDiffusiveDispersal = new DiffusiveDispersal(_GlobalModelTimeStepUnit, _DrawRandomly); RevisedTerrestrialPlantModel DummyPlantModel = new RevisedTerrestrialPlantModel(); Activity DummyActivityModel = new Activity(); // Call the methods in these processes that write the parameter values out DummyHerbivory.WriteOutParameterValues(sw); DummyPredation.WriteOutParameterValues(sw); DummyEndoMetabolism.WriteOutParameterValues(sw); DummyEctoMetabolism.WriteOutParameterValues(sw); DummyBackgroundMortality.WriteOutParameterValues(sw); DummySenescenceMortality.WriteOutParameterValues(sw); DummyStarvationMortality.WriteOutParameterValues(sw); DummyReproduction.WriteOutParameterValues(sw); DummyDiffusiveDispersal.WriteOutParameterValues(sw); DummyPlantModel.WriteOutParameterValues(sw); DummyActivityModel.WriteOutParameterValues(sw); sw.Dispose(); }