Пример #1
0
        //---------------------------------------------------------------------

        public void CohortPartialMortality(object sender, Landis.Library.BiomassCohorts.PartialDeathEventArgs eventArgs)
        {
            ExtensionType disturbanceType = eventArgs.DisturbanceType;
            ActiveSite    site            = eventArgs.Site;

            Landis.Library.BiomassCohorts.ICohort cohort = eventArgs.Cohort;

            double fractionPartialMortality = (double)eventArgs.Reduction / (double)cohort.Biomass;
            //PlugIn.ModelCore.UI.WriteLine("   BIOMASS SUCCESSION PARTIAL MORTALITY START: species={0}, age={1}, biomass={2}, fraction_mortality={3:0.00}.", cohort.Species.Name, cohort.Age, cohort.Biomass, fractionPartialMortality);

            int nonWoody = cohort.ComputeNonWoodyBiomass(site);
            int woody    = (cohort.Biomass - nonWoody);

            int foliarInput = (int)((double)nonWoody * fractionPartialMortality);
            int woodInput   = (int)((double)woody * fractionPartialMortality);

            if (disturbanceType.IsMemberOf("disturbance:harvest") || disturbanceType.IsMemberOf("disturbance:fire"))
            {
                AgeOnlyDisturbances.PoolPercentages cohortReductions = AgeOnlyDisturbances.Module.Parameters.CohortReductions[disturbanceType];

                foliarInput = AgeOnlyDisturbances.Events.ReduceInput(foliarInput, cohortReductions.Foliar);
                woodInput   = AgeOnlyDisturbances.Events.ReduceInput(woodInput, cohortReductions.Wood);
            }

            ForestFloor.AddWoody(woodInput, cohort.Species, site);
            ForestFloor.AddLitter(foliarInput, cohort.Species, site);

            //PlugIn.ModelCore.UI.WriteLine("       BIOMASS SUCCESSION PARTIAL MORTALITY SUMMARY: Cohort Partial Mortality: species={0}, age={1}, disturbance={2}.", cohort.Species.Name, cohort.Age, disturbanceType);
            //PlugIn.ModelCore.UI.WriteLine("           InputB/TotalB:  Foliar={0:0.00}/{1:0.00}, Wood={2:0.0}/{3:0.0}.", foliarInput, nonWoody, woodInput, woody);

            return;
        }
        //---------------------------------------------------------------------

        public void CohortPartialMortality(object sender, Landis.Library.BiomassCohorts.PartialDeathEventArgs eventArgs)
        {
            ExtensionType disturbanceType = eventArgs.DisturbanceType;
            ActiveSite    site            = eventArgs.Site;

            Landis.Library.BiomassCohorts.ICohort cohort = eventArgs.Cohort;

            float fractionPartialMortality = (float)eventArgs.Reduction;

            //PlugIn.ModelCore.UI.WriteLine("Cohort experienced partial mortality: species={0}, age={1}, wood_biomass={2}, fraction_mortality={3:0.0}.", cohort.Species.Name, cohort.Age, cohort.WoodBiomass, fractionPartialMortality);

            AgeOnlyDisturbances.PoolPercentages cohortReductions = AgeOnlyDisturbances.Module.Parameters.CohortReductions[disturbanceType];

            int nonWoody = cohort.ComputeNonWoodyBiomass(site);
            int woody    = (cohort.Biomass - nonWoody);

            int foliar = (int)(nonWoody * fractionPartialMortality);
            int wood   = (int)(woody * fractionPartialMortality);

            int foliarInput = AgeOnlyDisturbances.Events.ReduceInput(foliar, cohortReductions.Foliar);
            int woodInput   = AgeOnlyDisturbances.Events.ReduceInput(wood, cohortReductions.Wood);

            ForestFloor.AddWoody(woodInput, cohort.Species, site);
            ForestFloor.AddLitter(foliarInput, cohort.Species, site);

            //PlugIn.ModelCore.UI.WriteLine("EVENT: Cohort Partial Mortality: species={0}, age={1}, disturbance={2}.", cohort.Species.Name, cohort.Age, disturbanceType);
            //PlugIn.ModelCore.UI.WriteLine("       Cohort Reductions:  Foliar={0:0.00}.  Wood={1:0.00}.", cohortReductions.Foliar, cohortReductions.Wood);
            //PlugIn.ModelCore.UI.WriteLine("       InputB/TotalB:  Foliar={0:0.00}/{1:0.00}, Wood={2:0.0}/{3:0.0}.", foliarInput, foliar, woodInput, wood);

            return;
        }
Пример #3
0
        //---------------------------------------------------------------------

        public static void SiteDisturbed(object sender,
                                         DisturbanceEventArgs eventArgs)
        {
            ExtensionType   disturbanceType = eventArgs.DisturbanceType;
            PoolPercentages poolReductions  = Module.Parameters.PoolReductions[disturbanceType];

            ActiveSite site = eventArgs.Site;

            SiteVars.WoodyDebris[site].ReduceMass(poolReductions.Wood);
            SiteVars.Litter[site].ReduceMass(poolReductions.Foliar);
        }
Пример #4
0
        public static void CohortDied(object sender,
                                      DeathEventArgs eventArgs)
        {
            ExtensionType   disturbanceType  = eventArgs.DisturbanceType;
            PoolPercentages cohortReductions = Module.Parameters.CohortReductions[disturbanceType];

            ICohort    cohort   = (Landis.Library.BiomassCohorts.ICohort)eventArgs.Cohort;
            ActiveSite site     = eventArgs.Site;
            int        nonWoody = cohort.ComputeNonWoodyBiomass(site);
            int        woody    = (cohort.Biomass - nonWoody);

            int nonWoodyInput = ReduceInput(nonWoody, cohortReductions.Foliar);
            int woodyInput    = ReduceInput(woody, cohortReductions.Wood);

            //ForestFloor.AddBiomass(woodyInput, nonWoodyInput, cohort.Species, site);
            ForestFloor.AddWoody(woodyInput, cohort.Species, site);
            ForestFloor.AddLitter(nonWoodyInput, cohort.Species, site);
        }
 //---------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /*        public PercentageTable(IDictionary<ExtensionType, PoolPercentages> percentages,
                        PoolPercentages                          defaultPercentages)
 {
     this.percentages = percentages;
     this.defaultPercentages = defaultPercentages;
 }*/
 //---------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 public PercentageTable()
 {
     this.percentages = new Dictionary<ExtensionType, PoolPercentages>();
     this.defaultPercentages = new PoolPercentages();
 }
        //---------------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance.
        /// </summary>

/*        public PercentageTable(IDictionary<ExtensionType, PoolPercentages> percentages,
 *                             PoolPercentages                          defaultPercentages)
 *      {
 *          this.percentages = percentages;
 *          this.defaultPercentages = defaultPercentages;
 *      }*/
        //---------------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        public PercentageTable()
        {
            this.percentages        = new Dictionary <ExtensionType, PoolPercentages>();
            this.defaultPercentages = new PoolPercentages();
        }