Exemplo n.º 1
0
        protected void SimulateOneTimestep()
        {
            if (isDebugEnabled)
            {
                log.DebugFormat("Starting DemographicSeeding.Algorithm.SimulateOneTimestep() ...");
            }

            foreach (ActiveSite site in Model.Core.Landscape)
            {
                int x = site.Location.Column - 1;
                int y = site.Location.Row - 1;

                // seedling count high enough to be considered a cohort by the
                // SimOneTimestep method.
                int cohortThresholdPlus1 = seedingData.cohort_threshold + 1;

                foreach (ISpecies species in Model.Core.Species)
                {
                    int s = species.Index;
                    int a = seedingData.all_species[s].reproductive_age_steps - 1;
                    if (a < 0)
                    {
                        a = 0;
                    }
                    int seedlingCount = 0;
                    if (Reproduction.MaturePresent(species, site))
                    {
                        // This will cause SimOneTimestep to consider the
                        // species as reproductive at this site.
                        seedlingCount = cohortThresholdPlus1;
                    }
                    seedingData.cohorts[s][x][y][a] = seedlingCount;
                }
            }

            if (isDebugEnabled)
            {
                log.DebugFormat("  Calling seedingData.SimOneTimeStep() ...");
            }
            seedingData.SimOneTimeStep();

            if (isDebugEnabled)
            {
                log.DebugFormat("Exiting SimulateOneTimestep()");
            }
        }