Esempio n. 1
0
 public void RemoveMarkedCohorts(ICohortDisturbance disturbance)
 {
     foreach (var i in all_species)
     {
         i.RemoveMarkedCohorts(disturbance);
     }
 }
Esempio n. 2
0
        //---------------------------------------------------------------------

        public void DamageBy(ICohortDisturbance disturbance)
        {
            //  Go through list of species cohorts from back to front so that
            //  a removal does not mess up the loop.
            for (int i = cohorts.Count - 1; i >= 0; i--)
            {
                cohorts[i].DamageBy(disturbance);
                if (cohorts[i].Count == 0)
                {
                    cohorts.RemoveAt(i);
                }
            }
        }
        void ISiteCohorts.RemoveMarkedCohorts(ICohortDisturbance disturbance)
        {
            /*
             * if (AgeOnlyDisturbanceEvent != null)
             * {
             *  AgeOnlyDisturbanceEvent(this, new Landis.Library.BiomassCohorts.DisturbanceEventArgs(disturbance.CurrentSite, disturbance.Type));
             * }
             */

            //FIXME - JSF
            //ReduceOrKillBiomassCohorts(new Landis.Library.BiomassCohorts.WrappedDisturbance(disturbance));
            ReduceOrKillDensityCohorts(disturbance);
        }
Esempio n. 4
0
 internal void RemoveMarkedCohorts(ICohortDisturbance disturbance)
 {
     for (int i = 0; i < agevector.Length; ++i)
     {
         if (agevector[i] > 0)
         {
             if (disturbance.MarkCohortForDeath(new Library.AgeOnlyCohorts.Cohort(Species, (ushort)i)))
             {
                 agevector[i] = 0;
             }
         }
     }
 }
Esempio n. 5
0
        //---------------------------------------------------------------------

        public virtual void RemoveMarkedCohorts(ICohortDisturbance disturbance)
        {
            //  Go through list of species cohorts from back to front so that
            //  a removal does not mess up the loop.

            for (int i = spp_cohorts.Count - 1; i >= 0; i--)
            {
                spp_cohorts[i].RemoveMarkedCohorts(disturbance);
                if (spp_cohorts[i].Count == 0)
                {
                    spp_cohorts.RemoveAt(i);
                }
            }
        }
Esempio n. 6
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Removes the cohorts which are damaged by a disturbance.
        /// </summary>
        public void RemoveMarkedCohorts(ICohortDisturbance disturbance)
        {
            //  Go backwards through list of ages, so the removal of an age
            //  doesn't mess up the loop.
            isMaturePresent = false;
            for (int i = ages.Count - 1; i >= 0; i--)
            {
                ICohort cohort = new Cohort(species, ages[i]);
                if (disturbance.MarkCohortForDeath(cohort))
                {
                    ages.RemoveAt(i);
                    Cohort.Died(this, cohort, disturbance.CurrentSite, disturbance.Type);
                }
                else if (ages[i] >= species.Maturity)
                {
                    isMaturePresent = true;
                }
            }
        }
        //---------------------------------------------------------------------

        /// <summary>
        /// Removes the cohorts which are damaged by a disturbance.
        /// </summary>
        public void RemoveMarkedCohorts(ICohortDisturbance disturbance)
        {
            //  Go backwards through list of ages, so the removal of an age
            //  doesn't mess up the loop.
            isMaturePresent = false;
            for (int i = ages.Count - 1; i >= 0; i--) {
                ICohort cohort = new Cohort(species, ages[i]);
                //Console.WriteLine("Cohort={0}.", cohort.Species.Name);
                //Console.WriteLine("disturbance={0}.", disturbance.ToString());
                if (disturbance.MarkCohortForDeath(cohort))
                {
                    ages.RemoveAt(i);
                    Cohort.Died(this, cohort, disturbance.CurrentSite, disturbance.Type);
                }
                else if (ages[i] >= species.Maturity)
                    isMaturePresent = true;
            }
        }
        //---------------------------------------------------------------------

        /// <summary>
        /// Removes the cohorts which are damaged by a disturbance.
        /// </summary>
        public void MarkCohortsForDeath(ICohortDisturbance disturbance)
        {
            //  Go backwards through list of ages, so the removal of an age
            //  doesn't mess up the loop.
            isMaturePresent = false;
            for (int i = ages.Count - 1; i >= 0; i--) {
                ICohort cohort = new Cohort(species, ages[i]);
                if (disturbance.RemoveCohort(cohort)) {
                    ages.RemoveAt(i);
                    Cohort.Died(this, cohort, disturbance.CurrentSite,
                                disturbance.Type);
                }
                else if (ages[i] >= species.Maturity)
                    isMaturePresent = true;
            }
        }
        //---------------------------------------------------------------------

        public void MarkCohortsForDeath(ICohortDisturbance disturbance)
        {
            //  Go through list of species cohorts from back to front so that
            //  a removal does not mess up the loop.
            for (int i = cohorts.Count - 1; i >= 0; i--) {
                cohorts[i].MarkCohortsForDeath(disturbance);
                if (cohorts[i].Count == 0)
                    cohorts.RemoveAt(i);
            }
        }
        //---------------------------------------------------------------------

        public virtual void RemoveMarkedCohorts(ICohortDisturbance disturbance)
        {
            //  Go through list of species cohorts from back to front so that
            //  a removal does not mess up the loop.

            for (int i = spp_cohorts.Count - 1; i >= 0; i--) {
                spp_cohorts[i].RemoveMarkedCohorts(disturbance);
                if (spp_cohorts[i].Count == 0)
                    spp_cohorts.RemoveAt(i);
            }
        }