//---------------------------------------------------------------------

        int Landis.Library.DensityCohorts.IDisturbance.ReduceOrKillMarkedCohort(Landis.Library.DensityCohorts.ICohort cohort)
        {
            int reduction = 0;
            SpecificAgesCohortSelector specificAgeCohortSelector;

            if (partialCohortSelectors.TryGetValue(cohort.Species, out specificAgeCohortSelector))
            {
                uint removal;
                if (specificAgeCohortSelector.Selects(cohort, out removal))
                {
                    reduction = (int)(removal);
                }
            }
            if (reduction > 0)
            {
                cohortCounts.IncrementCount(cohort.Species);
                if (reduction < cohort.Treenumber)
                {
                    partialCohortCounts.IncrementCount(cohort.Species);
                }
            }

            Record(reduction, cohort);
            return(reduction);
        }
        //==========================================================================================================

        public static float computeMortalityRD(Landis.Library.DensityCohorts.ICohort cohort, int deadTrees)
        {
            ISpeciesDensity speciesDensity = SpeciesParameters.SpeciesDensity.AllSpecies[cohort.Species.Index];

            float tmp_term1 = (float)Math.Pow((cohort.Diameter / 25.4), 1.605);
            float tmp_term2 = 10000 / speciesDensity.MaxSDI;
            int   tmp_term3 = deadTrees;
            float deadRD    = tmp_term1 * tmp_term2 * tmp_term3 / (float)Math.Pow(EcoregionData.ModelCore.CellLength, 2);

            return(deadRD);
        }
        //---------------------------------------------------------------------

        /// <summary>
        /// Records the amount a cohort's biomass was cut (reduced).
        /// </summary>
        protected void Record(int reduction,
                              Landis.Library.DensityCohorts.ICohort cohort)
        {
            SiteBiomass.RecordHarvest(cohort.Species, reduction);
            if (isDebugEnabled)
            {
                log.DebugFormat("    {0}, age {1}, biomass {2} : reduction = {3}",
                                cohort.Species.Name,
                                cohort.Age,
                                cohort.Biomass,
                                reduction);
            }
        }
예제 #4
0
        public static void SpeciesSiteRD(Landis.Library.DensityCohorts.SpeciesCohorts speciesCohorts, ActiveSite site)
        {
            float siteRD = 0;

            ISpeciesDensity speciesDensity = SpeciesParameters.SpeciesDensity.AllSpecies[speciesCohorts.Species.Index];

            //foreach (Landis.Library.DensityCohorts.ICohort cohort in speciesCohorts)
            for (int s = 0; s < speciesCohorts.Count; s++)
            {
                Landis.Library.DensityCohorts.ICohort cohort = speciesCohorts[s];
                double tmp_term1 = Math.Pow((cohort.Diameter / 25.4), 1.605);
                float  tmp_term2 = 10000 / speciesDensity.MaxSDI;
                int    tmp_term3 = cohort.Treenumber;
                double tmp       = tmp_term1 * tmp_term2 * tmp_term3 / Math.Pow(EcoregionData.ModelCore.CellLength, 2);
                siteRD += (float)tmp;
            }

            SiteVars.SiteRD[site] = siteRD;
            //return siteRD;
        }