/// <summary>
        /// Constructor for Dispersal: fills the list of available implementations of dispersal
        /// </summary>
        public Dispersal(Boolean DrawRandomly, string globalModelTimeStepUnit, MadingleyModelInitialisation modelInitialisation)
        {
            // Initialise the list of dispersal implementations
            Implementations = new SortedList<string, IDispersalImplementation>();

            // Add the basic advective dispersal implementation to the list of implementations
            AdvectiveDispersal AdvectiveDispersalImplementation = new AdvectiveDispersal(globalModelTimeStepUnit, DrawRandomly);
            Implementations.Add("basic advective dispersal", AdvectiveDispersalImplementation);

            // Add the basic advective dispersal implementation to the list of implementations
            DiffusiveDispersal DiffusiveDispersalImplementation = new DiffusiveDispersal(globalModelTimeStepUnit, DrawRandomly);
            Implementations.Add("basic diffusive dispersal", DiffusiveDispersalImplementation);

            // Add the basic advective dispersal implementation to the list of implementations
            ResponsiveDispersal ResponsiveDispersalImplementation = new ResponsiveDispersal(globalModelTimeStepUnit, DrawRandomly);
            Implementations.Add("basic responsive dispersal", ResponsiveDispersalImplementation);

            // Get the weight threshold below which organisms are dispersed planktonically
            PlanktonThreshold = modelInitialisation.PlanktonDispersalThreshold;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor for Dispersal: fills the list of available implementations of dispersal
        /// </summary>
        public Dispersal(Boolean DrawRandomly, string globalModelTimeStepUnit, MadingleyModelInitialisation modelInitialisation)
        {
            // Initialise the list of dispersal implementations
            Implementations = new SortedList <string, IDispersalImplementation>();

            // Add the basic advective dispersal implementation to the list of implementations
            AdvectiveDispersal AdvectiveDispersalImplementation = new AdvectiveDispersal(globalModelTimeStepUnit, DrawRandomly);

            Implementations.Add("basic advective dispersal", AdvectiveDispersalImplementation);

            // Add the basic advective dispersal implementation to the list of implementations
            DiffusiveDispersal DiffusiveDispersalImplementation = new DiffusiveDispersal(globalModelTimeStepUnit, DrawRandomly);

            Implementations.Add("basic diffusive dispersal", DiffusiveDispersalImplementation);

            // Add the basic advective dispersal implementation to the list of implementations
            ResponsiveDispersal ResponsiveDispersalImplementation = new ResponsiveDispersal(globalModelTimeStepUnit, DrawRandomly);

            Implementations.Add("basic responsive dispersal", ResponsiveDispersalImplementation);

            // Get the weight threshold below which organisms are dispersed planktonically
            PlanktonThreshold = modelInitialisation.PlanktonDispersalThreshold;
        }
        /// <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();
        }