//--------------------------------------------------------------------- /// <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); } if (partialCohortCounts.AllSpecies > 0) { SiteVars.CohortsPartiallyDamaged[site] = partialCohortCounts.AllSpecies; } partialCohortCounts.Reset(); }
//--------------------------------------------------------------------- /// <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(); }
//--------------------------------------------------------------------- /// <summary> /// A new Stand Object, given a map code /// </summary> public Stand(uint mapCode) { this.mapCode = mapCode; this.siteLocations = new List <Location>(); this.activeArea = Model.Core.CellArea; this.mgmtArea = null; this.neighbors = new List <Stand>(); this.ma_neighbors = new List <Stand>(); //new list for neighbors not in this management area this.yearAgeComputed = Model.Core.StartTime; this.setAsideUntil = Model.Core.StartTime; this.timeLastHarvested = -1; this.DamageTable = new CohortCounts(); this.rejectedPrescriptionNames = new List <string>(); }
//--------------------------------------------------------------------- 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); } }
//--------------------------------------------------------------------- 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(); }
/// <summary> /// Update the damage_table for this stand /// </summary> /// <param name="siteCounts"> /// The number of cohorts cut for each species at the site that was /// just harvested. /// </param> public void UpdateDamageTable(CohortCounts siteCounts) { DamageTable.IncrementCounts(siteCounts); }