private void DoPestDiseaseDamage(object sender, EventArgs e)
        {
            OrganBiomassRemovalType consumption = new OrganBiomassRemovalType();

            consumption.FractionLiveToRemove = Math.Max(1, ParentStage.TotalPopulation * RateOfOrganConsumptionPerIndividual.Value() * HostOrgan.Live.Wt);
            HostPlant.RemoveBiomass(HostOrgan.Name, "Graze", consumption);
        }
Exemplo n.º 2
0
        private void DoPestDiseaseDamage(object sender, EventArgs e)
        {
            OrganBiomassRemovalType consumption = new OrganBiomassRemovalType();
            double organWtConsumed = 0;

            if ((ParentPhase.Cohorts != null) && (HostPlant.IsAlive))
            {
                foreach (Cohort c in ParentPhase.Cohorts)
                {
                    ParentPhase.CurrentCohort         = c;
                    organWtConsumed                  += c.Population * OrganWtConsumptionPerIndividual.Value();
                    consumption.FractionLiveToRemove += Math.Max(1, organWtConsumed / HostOrgan.Live.Wt);
                }
                HostPlant.RemoveBiomass(HostOrgan.Name, "Graze", consumption);
            }
        }