/// <summary>
        /// Constructor for Eating: fills the list of available implementations of eating
        /// </summary>
        public Eating(double cellArea, string globalModelTimeStepUnit)
        {
            // Initialize the list of eating implementations
            Implementations = new SortedList<string, IEatingImplementation>();

            // Add the revised herbivory implementation to the list of implementations
            RevisedHerbivory RevisedHerbivoryImplementation = new RevisedHerbivory(cellArea, globalModelTimeStepUnit);
            Implementations.Add("revised herbivory", RevisedHerbivoryImplementation);

            //Add the revised predation implementation to the list of implementations
            RevisedPredation RevisedPredationImplementation = new RevisedPredation(cellArea, globalModelTimeStepUnit);
            Implementations.Add("revised predation", RevisedPredationImplementation);
        }
Пример #2
0
        /// <summary>
        /// Constructor for Eating: fills the list of available implementations of eating
        /// </summary>
        public Eating(double cellArea, string globalModelTimeStepUnit)
        {
            // Initialize the list of eating implementations
            Implementations = new SortedList <string, IEatingImplementation>();

            // Add the revised herbivory implementation to the list of implementations
            RevisedHerbivory RevisedHerbivoryImplementation = new RevisedHerbivory(cellArea, globalModelTimeStepUnit);

            Implementations.Add("revised herbivory", RevisedHerbivoryImplementation);

            //Add the revised predation implementation to the list of implementations
            RevisedPredation RevisedPredationImplementation = new RevisedPredation(cellArea, globalModelTimeStepUnit);

            Implementations.Add("revised predation", RevisedPredationImplementation);
        }
        /// <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();
        }