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

        /// <summary>
        /// Cuts the cohorts at a site.
        /// </summary>
        public override void Cut(ActiveSite   site,
                                 CohortCounts cohortCounts)
        {
            if (isDebugEnabled)
            {
                log.DebugFormat("    {0} is cutting site {1}; cohorts are:",
                                GetType().Name,
                                site.Location);
                Debug.WriteSiteCohorts(log, site);
            }

            // Use age-only cohort selectors to harvest whole cohorts
            // Note: the base method sets the CurrentSite property, and resets
            // the counts to 0 before cutting.
            base.Cut(site, cohortCounts);

            // Then do any partial harvesting with the partial cohort selectors.
            this.cohortCounts = cohortCounts;
            SiteVars.Cohorts[site].ReduceOrKillBiomassCohorts(this);

            if (isDebugEnabled)
            {
                log.DebugFormat("    Cohorts after cutting site {0}:",
                                site.Location);
                Debug.WriteSiteCohorts(log, site);
            }
        }
 //---------------------------------------------------------------------
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 public PartialCohortCutter(Landis.Library.SiteHarvest.ICohortSelector cohortSelector,
     PartialCohortSelectors                     partialCohortSelectors,
     ExtensionType                              extensionType)
     : base(cohortSelector, extensionType)
 {
     this.partialCohortSelectors = new PartialCohortSelectors(partialCohortSelectors);
     partialCohortCounts = new CohortCounts();
 }
Beispiel #3
0
 /// <summary>
 /// Increment the counts for all the species.
 /// </summary>
 /// <param name="increments">
 /// The increment for each species.
 /// </param>
 public void IncrementCounts(CohortCounts increments)
 {
     foreach (ISpecies species in Model.Core.Species)
     {
         int increment = increments[species];
         counts[species] += increment;
         allSpecies      += increment;
     }
 }
 /// <summary>
 /// Increment the counts for all the species.
 /// </summary>
 /// <param name="increments">
 /// The increment for each species.
 /// </param>
 public void IncrementCounts(CohortCounts increments)
 {
     foreach (ISpecies species in Model.Core.Species)
     {
         int increment = increments[species];
         counts[species] += increment;
         allSpecies += increment;
     }
 }
 /// <summary>
 /// Cut cohorts at an individual site.
 /// </summary>
 public virtual void Cut(ActiveSite site,
     CohortCounts cohortCounts)
 {
     if (isDebugEnabled)
         log.DebugFormat("    {0} is cutting site {1}:",
                         GetType().Name,
                         site.Location);
     CurrentSite = site;
     this.cohortCounts = cohortCounts;
     cohortCounts.Reset();
     SiteVars.Cohorts[site].RemoveMarkedCohorts(this);
 }
        //---------------------------------------------------------------------
        public void ApplyTo(ActiveSite site)
        {
            if (isDebugEnabled)
                log.DebugFormat("    Applying LCC {0} to site {1}",
                                GetType().Name,
                                site.Location);

            // For now, we don't do anything with the counts of cohorts cut.
            CohortCounts cohortCounts = new CohortCounts();
            cohortCutter.Cut(site, cohortCounts);
            if (speciesToPlant != null)
                Reproduction.ScheduleForPlanting(speciesToPlant, site);
        }
Beispiel #7
0
 /// <summary>
 /// Cut cohorts at an individual site.
 /// </summary>
 public virtual void Cut(ActiveSite site,
                         CohortCounts cohortCounts)
 {
     if (isDebugEnabled)
     {
         log.DebugFormat("    {0} is cutting site {1}:",
                         GetType().Name,
                         site.Location);
     }
     CurrentSite       = site;
     this.cohortCounts = cohortCounts;
     cohortCounts.Reset();
     SiteVars.Cohorts[site].RemoveMarkedCohorts(this);
 }
        //---------------------------------------------------------------------
        public Prescription(string               name,
            IStandRankingMethod  rankingMethod,
            ISiteSelector        siteSelector,
            ICohortCutter        cohortCutter,
            Planting.SpeciesList speciesToPlant,
            int                  minTimeSinceDamage,
            bool                 preventEstablishment)
        {
            this.number = nextNumber;
            nextNumber++;

            this.name = name;
            this.rankingMethod = rankingMethod;
            this.siteSelector = siteSelector;
            this.cohortCutter = cohortCutter;
            this.speciesToPlant = speciesToPlant;
            this.minTimeSinceDamage = minTimeSinceDamage;
            this.preventEstablishment = preventEstablishment;

            cohortCounts = new CohortCounts();
        }