/// <summary>Method that calculates parameters for leaf cohort to appear and then calls event so leaf calss can make cohort appear</summary> public void DoLeafTipAppearance() { TipToAppear += 1; CohortParams = new ApparingLeafParams() { }; CohortParams.CohortToAppear = TipToAppear; CohortParams.TotalStemPopn = TotalStemPopn; CohortParams.CohortAge = 0; CohortParams.FinalFraction = NextLeafProportion; if (LeafTipAppearance != null) { LeafTipAppearance.Invoke(this, CohortParams); } }
/// <summary>Method that calculates parameters for leaf cohort to appear and then calls event so leaf calss can make cohort appear</summary> public void DoLeafTipAppearance() { TipToAppear += 1; CohortParams = new ApparingLeafParams() { }; CohortParams.CohortToAppear = TipToAppear; CohortParams.TotalStemPopn = TotalStemPopn; // if ((Math.Truncate(LeafTipsAppeared) + 1) == leaf.InitialisedCohortNo) // CohortParams.CohortAge = (PotLeafTipsAppeared - TipToAppear) * phyllochron.Value(); // else // CohortParams.CohortAge = (LeafTipsAppeared - TipToAppear) * phyllochron.Value(); CohortParams.CohortAge = 0; CohortParams.FinalFraction = NextLeafProportion; if (LeafTipAppearance != null) { LeafTipAppearance.Invoke(this, CohortParams); } }
private void OnLeafTipAppearance(object sender, ApparingLeafParams CohortParams) { if (CohortsInitialised == false) throw new Exception("Trying to initialse new cohorts prior to InitialStage. Check the InitialStage parameter on the leaf object and the parameterisation of NodeAppearanceRate. Your NodeAppearanceRate is triggering a new leaf cohort before the initial leaves have been triggered."); if (CohortParams.CohortToAppear > InitialisedCohortNo) throw new Exception("MainStemNodeNumber exceeds the number of leaf cohorts initialised. Check primordia parameters to make sure primordia are being initiated fast enough and for long enough"); int i = CohortParams.CohortToAppear - 1; Leaves[i].CohortPopulation = CohortParams.TotalStemPopn; Leaves[i].Age = CohortParams.CohortAge; Leaves[i].DoAppearance(CohortParams.FinalFraction, CohortParameters); if (NewLeaf != null) NewLeaf.Invoke(); }