コード例 #1
0
		//---------------------------------------------------------------------

		/// <summary>
		/// Does the appropriate forms of reproduction at a site.
		/// </summary>
		public static void Do(ActiveSite site)
		{
			bool serotinyOccurred = false;
			for (int index = 0; index < speciesDataset.Count; ++index) {
				if (serotiny[site].Get(index)) {
					ISpecies species = speciesDataset[index];
					if (SufficientLight(species, site) && Establish(species, site)) {
						AddNewCohort(species, site);
						serotinyOccurred = true;
					}
				}
			}
			serotiny[site].SetAll(false);

			bool speciesResprouted = false;
			if (! serotinyOccurred) {
				for (int index = 0; index < speciesDataset.Count; ++index) {
					if (resprout[site].Get(index)) {
						ISpecies species = speciesDataset[index];
						if (SufficientLight(species, site) &&
						    	(Random.GenerateUniform() < species.VegReprodProb)) {
							AddNewCohort(species, site);
							speciesResprouted = true;
						}
					}
				}
			}
			resprout[site].SetAll(false);

			if (! serotinyOccurred && ! speciesResprouted)
				seeding.Do(site);
		}
コード例 #2
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Does the appropriate forms of reproduction at a site.
        /// </summary>
        public static void Do(ActiveSite site)
        {
            if (site.SharesData)
            {
                int blockColumn = site.BroadScaleLocation.Column;
                if (site.LocationInBlock == location_1_1)
                {
                    //  First site in block, so try other forms of reproduction
                    //  besides seeding.  If no of these are successful, then
                    //  consider seeding.
                    bool speciesReproduced = TryPlantingThenSerotinyAndResprouting(site);
                    if (!speciesReproduced)
                    {
                        trySeeding[blockColumn] = true;
                        hasSeeded[blockColumn].SetAll(false);
                    }
                    else
                    {
                        trySeeding[blockColumn] = false;
                    }
                }

                //  For any site in a block, try seeding if enabled.
                if (trySeeding[blockColumn])
                {
                    seeding.Do(site, hasSeeded[blockColumn]);
                }
            }
            else
            {
                // active site has unique data index, so do the steps in the
                // single-scale version of LANDIS-II
                bool speciesReproduced = TryPlantingThenSerotinyAndResprouting(site);
                if (!speciesReproduced)
                {
                    seeding.Do(site);
                }
            }
        }
コード例 #3
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Does the appropriate forms of reproduction at a site.
        /// </summary>
        public static void Do(ActiveSite site)
        {
            bool serotinyOccurred = false;

            for (int index = 0; index < speciesDataset.Count; ++index)
            {
                if (serotiny[site].Get(index))
                {
                    ISpecies species = speciesDataset[index];
                    if (SufficientLight(species, site) && Establish(species, site))
                    {
                        AddNewCohort(species, site);
                        serotinyOccurred = true;
                        if (isDebugEnabled)
                        {
                            log.DebugFormat("site {0}: {1} post-fire regenerated",
                                            site.Location, species.Name);
                        }
                    }
                    else
                    {
                        if (isDebugEnabled)
                        {
                            log.DebugFormat("site {0}: {1} post-fire regen failed: {2}",
                                            site.Location, species.Name,
                                            !sufficientLight ? "insufficient light"
                                                              : "didn't establish");
                        }
                    }
                }
            }
            serotiny[site].SetAll(false);

            bool speciesResprouted = false;

            if (!serotinyOccurred)
            {
                for (int index = 0; index < speciesDataset.Count; ++index)
                {
                    if (resprout[site].Get(index))
                    {
                        ISpecies species = speciesDataset[index];
                        if (SufficientLight(species, site) &&
                            (Util.Random.GenerateUniform() < species.VegReprodProb))
                        {
                            AddNewCohort(species, site);
                            speciesResprouted = true;
                            if (isDebugEnabled)
                            {
                                log.DebugFormat("site {0}: {1} resprouted",
                                                site.Location, species.Name);
                            }
                        }
                        else
                        {
                            if (isDebugEnabled)
                            {
                                log.DebugFormat("site {0}: {1} resprouting failed: {2}",
                                                site.Location, species.Name,
                                                !sufficientLight ? "insufficient light"
                                                                  : "random # >= probability");
                            }
                        }
                    }
                }
            }
            resprout[site].SetAll(false);

            if (!serotinyOccurred && !speciesResprouted)
            {
                seeding.Do(site);
            }
        }