コード例 #1
0
 /// <summary>
 /// Reset this organ's state at emergence.
 /// </summary>
 /// <param name="emergingWt">The amount of emerging biomass (kg/ha).</param>
 /// <param name="developingWt">The amount of developing biomass (kg/ha).</param>
 /// <param name="matureWt">The amount of developing biomass (kg/ha).</param>
 /// <param name="deadWt">The amount of developing biomass (kg/ha).</param>
 public void ResetEmergence(double emergingWt, double developingWt, double matureWt, double deadWt)
 {
     EmergingTissue.ResetTo(emergingWt, emergingWt * NConcOptimum);
     DevelopingTissue.ResetTo(developingWt, developingWt * NConcOptimum);
     MatureTissue.ResetTo(matureWt, matureWt * NConcOptimum);
     DeadTissue.ResetTo(deadWt, deadWt * NConcOptimum);
 }
コード例 #2
0
 /// <summary>Computes the DM and N amounts turned over for all tissues.</summary>
 /// <param name="turnoverRate">The turnover rate for each tissue</param>
 public void CalculateTissueTurnover(double[] turnoverRate)
 {
     EmergingTissue.DoTissueTurnover(turnoverRate[0], DevelopingTissue, NConcOptimum);
     DevelopingTissue.DoTissueTurnover(turnoverRate[0], MatureTissue, NConcOptimum);
     MatureTissue.DoTissueTurnover(turnoverRate[0], DeadTissue, NConcOptimum);
     DeadTissue.DoTissueTurnover(turnoverRate[0], null, NConcMinimum);
 }
コード例 #3
0
        /// <summary>
        /// Reset this organ's state at emergence.
        /// </summary>
        /// <param name="emergingWt">The amount of emerging biomass (kg/ha).</param>
        /// <param name="developingWt">The amount of developing biomass (kg/ha).</param>
        /// <param name="matureWt">The amount of developing biomass (kg/ha).</param>
        /// <param name="deadWt">The amount of developing biomass (kg/ha).</param>
        public void ResetEmergence(double emergingWt, double developingWt, double matureWt, double deadWt)
        {
            EmergingTissue.Reset(emergingWt, emergingWt * NConcOptimum);
            DevelopingTissue.Reset(developingWt, developingWt * NConcOptimum);
            MatureTissue.Reset(matureWt, matureWt * NConcOptimum);
            DeadTissue.Reset(deadWt, deadWt * NConcOptimum);

            // Tissue states have changed so recalculate our states.
            CalculateStates();
        }
コード例 #4
0
        /// <summary>Set this organ's biomass state.</summary>
        /// <param name="emergingWt">The DM amount of emerging biomass (kg/ha).</param>
        /// <param name="emergingN">The amount of N in emerging biomass (kg/ha).</param>
        /// <param name="developingWt">The DM amount of developing biomass (kg/ha).</param>
        /// <param name="developingN">The amount of N in developing biomass (kg/ha).</param>
        /// <param name="matureWt">The DM amount of developing biomass (kg/ha).</param>
        /// <param name="matureN">The amount of N in developing biomass (kg/ha).</param>
        /// <param name="deadWt">The DM amount of developing biomass (kg/ha).</param>
        /// <param name="deadN">The amount of N in developing biomass (kg/ha).</param>
        public void SetBiomassState(double emergingWt, double emergingN,
                                    double developingWt, double developingN,
                                    double matureWt, double matureN,
                                    double deadWt, double deadN)
        {
            EmergingTissue.SetBiomass(emergingWt, emergingN);
            DevelopingTissue.SetBiomass(developingWt, developingN);
            MatureTissue.SetBiomass(matureWt, matureN);
            DeadTissue.SetBiomass(deadWt, deadN);

            // Tissue states have changed so recalculate our states.
            CalculateStates();
        }
コード例 #5
0
        /// <summary>Updates each tissue, make changes in DM and N effective.</summary>
        /// <returns>A flag whether mass balance was maintained or not</returns>
        public bool Update()
        {
            // save current state
            double previousDM = DMTotal;
            double previousN  = NTotal;

            // update all tissues
            EmergingTissue.Update();
            DevelopingTissue.Update();
            MatureTissue.Update();
            DeadTissue.Update();

            CalculateStates();

            // check mass balance
            bool dmIsOk = MathUtilities.FloatsAreEqual(previousDM + DMGrowth - DMDetached, DMTotal, 0.000001);
            bool nIsOk  = MathUtilities.FloatsAreEqual(previousN + NGrowth - NLuxuryRemobilised - NSenescedRemobilised - NDetached, NTotal, 0.000001);

            return(dmIsOk || nIsOk);
        }