//--------------------------------------------------------------------- ///<summary> // Go through all active sites and damage them. Mortality should occur the year FOLLOWING an active year. ///</summary> public static void Mortality(IInsect insect) { //PlugIn.ModelCore.UI.WriteLine(" {0} mortality. StartYear={1}, StopYear={2}, CurrentYear={3}.", insect.Name, insect.OutbreakStartYear, insect.OutbreakStopYear, PlugIn.ModelCore.CurrentTime); foreach (ActiveSite site in PlugIn.ModelCore.Landscape) { PartialDisturbance.ReduceCohortBiomass(site); if (insect.BiomassRemoved[site] > 0) { //PlugIn.ModelCore.UI.WriteLine(" Biomass removed at {0}/{1}: {2}.", site.Location.Row, site.Location.Column, SiteVars.BiomassRemoved[site]); SiteVars.TimeOfLastEvent[site] = PlugIn.ModelCore.CurrentTime; } } }
//--------------------------------------------------------------------- ///<summary> // Go through all active sites and damage them. Mortality should occur the year FOLLOWING an active year. ///</summary> public static void Mortality(IInsect insect) { // PlugIn.ModelCore.UI.WriteLine(" {0} mortality. StartYear={1}, StopYear={2}, CurrentYear={3}.", insect.Name, insect.OutbreakStartYear, insect.OutbreakStopYear, PlugIn.ModelCore.CurrentTime); foreach (ActiveSite site in PlugIn.ModelCore.Landscape) { //Try zeroing out biomass removed here @ start of each defoliation mortality year. Remove if doesn't work. if (SiteVars.BiomassRemoved[site] > 0) { SiteVars.BiomassRemoved[site] = 0; } //PlugIn.ModelCore.UI.WriteLine(" Reducing cohort biomass for {0}...", insect.Name); PartialDisturbance.ReduceCohortBiomass(site); //PartialDisturbance.AddPartialMortalityToWoodyDebris(site); if (SiteVars.BiomassRemoved[site] > 0) { // PlugIn.ModelCore.UI.WriteLine(" Biomass removed at {0}/{1}: {2}.", site.Location.Row, site.Location.Column, SiteVars.BiomassRemoved[site]); SiteVars.TimeOfLastEvent[site] = PlugIn.ModelCore.CurrentTime; } } }
//--------------------------------------------------------------------- static PartialDisturbance() { singleton = new PartialDisturbance(); }