コード例 #1
0
 protected virtual void OnDoPotentialPlantGrowth(object sender, EventArgs e)
 {
     // save current state
     if (parentPlant.IsEmerged)
     {
         StartLive.SetTo(Live);
     }
 }
コード例 #2
0
 private void KillLeavesUniformly(double fraction)
 {
     foreach (PerrenialLeafCohort L in Leaves)
     {
         Biomass Loss = new Biomass();
         Loss.SetTo(L.Live);
         Loss.Multiply(fraction);
         L.Dead.Add(Loss);
         L.Live.Subtract(Loss);
         L.AreaDead += L.Area * fraction;
         L.Area     *= (1 - fraction);
     }
 }
コード例 #3
0
ファイル: Cohorts.cs プロジェクト: lie112/ApsimX
        /// <summary>
        /// Kill all leaves by a given fraction.
        /// </summary>
        /// <param name="fraction">The fraction to be removed from the leaves.</param>
        public void KillLeavesUniformly(double fraction)
        {
            Biomass loss = new Biomass();

            LaiDead += Lai * fraction;
            foreach (PerennialLeafCohort leaf in leaves)
            {
                loss.SetTo(leaf.Live);
                loss.Multiply(fraction);
                dead.Add(loss);
                live.Subtract(loss);
                leaf.Dead.Add(loss);
                leaf.Live.Subtract(loss);
                leaf.AreaDead += leaf.Area * fraction;
                leaf.Area     *= (1 - fraction);
            }
            Lai *= (1 - fraction);
        }
コード例 #4
0
ファイル: PerennialLeaf.cs プロジェクト: her123/ApsimX
 private void KillLeavesUniformly(double fraction)
 {
     foreach (PerrenialLeafCohort L in Leaves)
     {
         Biomass Loss = new Biomass();
         Loss.SetTo(L.Live);
         Loss.Multiply(fraction);
         L.Dead.Add(Loss);
         L.Live.Subtract(Loss);
     }
 }