예제 #1
0
        /// <summary>
        /// Constructor Metabolism: fills the list of available implementations of metabolism
        /// </summary>
        public Metabolism(string globalModelTimeStepUnit)
        {
            // Initialise the list of metabolism implementations
            Implementations = new SortedList<string, IMetabolismImplementation>();

            // Add the basic endotherm metabolism implementation to the list of implementations
            MetabolismEndotherm MetabolismEndothermImplementation = new MetabolismEndotherm(globalModelTimeStepUnit);
            Implementations.Add("basic endotherm", MetabolismEndothermImplementation);

            // Add the basic ectotherm metabolism implementation to the list of implementations
            MetabolismEctotherm MetabolismEctothermImplementation = new MetabolismEctotherm(globalModelTimeStepUnit);
            Implementations.Add("basic ectotherm", MetabolismEctothermImplementation);
        }
        /// <summary>
        /// Constructor Metabolism: fills the list of available implementations of metabolism
        /// </summary>
        public Metabolism(string globalModelTimeStepUnit)
        {
            // Initialise the list of metabolism implementations
            Implementations = new SortedList <string, IMetabolismImplementation>();

            // Add the basic endotherm metabolism implementation to the list of implementations
            MetabolismEndotherm MetabolismEndothermImplementation = new MetabolismEndotherm(globalModelTimeStepUnit);

            Implementations.Add("basic endotherm", MetabolismEndothermImplementation);

            // Add the basic ectotherm metabolism implementation to the list of implementations
            MetabolismEctotherm MetabolismEctothermImplementation = new MetabolismEctotherm(globalModelTimeStepUnit);

            Implementations.Add("basic ectotherm", MetabolismEctothermImplementation);
        }
        /// <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();
        }