/// <summary> /// Add a tiller. /// </summary> /// <param name="leafAtAppearance"></param> /// <param name="Leaves"></param> /// <param name="fractionToAdd"></param> private void AddTiller(double leafAtAppearance, double Leaves, double fractionToAdd) { double fraction = 1; if (FertileTillerNumber - tillersAdded < 1) { fraction = FertileTillerNumber - tillersAdded; } // get number of tillers // add fractionToAdd // if new tiller is neded add one // fraction goes to proportions double tillerFraction = culms.Culms.Last().Proportion; //tillerFraction +=fractionToAdd; fraction = tillerFraction + fractionToAdd - Math.Floor(tillerFraction); //a new tiller is created with each new leaf, up the number of fertileTillers if (tillerFraction + fractionToAdd > 1) { Culm newCulm = new Culm(leafAtAppearance); //bell curve distribution is adjusted horizontally by moving the curve to the left. //This will cause the first leaf to have the same value as the nth leaf on the main culm. //T3&T4 were defined during dicussion at initial tillering meeting 27/06/12 //all others are an assumption //T2 = 3 Leaves //T3 = 4 Leaves //T4 = 5 leaves //T5 = 6 leaves //T6 = 7 leaves newCulm.CulmNo = culms.Culms.Count; newCulm.CurrentLeafNo = 0; //currentLeaf); newCulm.VertAdjValue = culms.MaxVerticalTillerAdjustment.Value() + (tillersAdded * culms.VerticalTillerAdjustment.Value()); newCulm.Proportion = fraction; newCulm.FinalLeafNo = culms.Culms[0].FinalLeafNo; //newCulm.calcLeafAppearance(); newCulm.UpdatePotentialLeafSizes(areaCalc as ICulmLeafArea); calcLeafAppearance(newCulm); //newCulm.calculateLeafSizes(); culms.Culms.Add(newCulm); } else { culms.Culms.Last().Proportion = fraction; } tillersAdded += fractionToAdd; }
/// <summary> /// Add a tiller. /// </summary> void InitiateTiller(int tillerNumber, double fractionToAdd, double initialLeaf) { double leafNoAtAppearance = 1.0; // DEBUG parameter? double nTillersPresent = culms.Culms.Count - 1; Culm newCulm = new Culm(leafNoAtAppearance); newCulm.CulmNo = tillerNumber; newCulm.CurrentLeafNo = initialLeaf; newCulm.VertAdjValue = culms.MaxVerticalTillerAdjustment.Value() + (tillersAdded * culms.VerticalTillerAdjustment.Value()); newCulm.Proportion = fractionToAdd; newCulm.FinalLeafNo = culms.Culms[0].FinalLeafNo; //newCulm.calcLeafAppearance(); newCulm.UpdatePotentialLeafSizes(areaCalc as ICulmLeafArea); //newCulm.calculateLeafSizes(); culms.Culms.Add(newCulm); }