// public Methods ------------------------------------------------------- /// <summary> /// Constructor. /// </summary> /// <param name="leafAppearance"></param> /// <param name="parameters"></param> public Culm(double leafAppearance, CulmParams parameters) { //plant = p; leafNoAtAppearance = leafAppearance; this.parameters = parameters; Initialize(); //doRegistrations(); }
/// <summary> /// Remove all then add the first culm (which is the main culm). /// Shouldn't be called once sown. /// </summary> public void Initialize() { Culms.Clear(); culmParams = new CulmParams() { LeafNoCorrection = leafNoCorrection, AX0 = aX0, NoSeed = noSeed, InitRate = initRate, AppearanceRate1 = appearanceRate1, AppearanceRate2 = appearanceRate2, AppearanceRate3 = appearanceRate3, NoRateChange = noRateChange1, NoRateChange2 = noRateChange2, LeafNoAtEmergence = leafNoAtEmergence, MinLeafNo = minLeafNo, MaxLeafNo = maxLeafNo, TTEmergToFI = ttEmergToFI, Density = plant?.SowingData?.Population ?? 0, DltTT = dltTT, AMaxS = aMaxSlope, AMaxI = aMaxIntercept, A0 = a0, A1 = a1, B0 = b0, B1 = b1, AMaxA = aMaxA, AMaxB = aMaxB, AMaxC = aMaxC, }; // Initialise Main Culms.Add(new Culm(0, culmParams)); tillersAdded = 0; supply = 0; demand = 0; tillers = 0.0; TTTargetFI = 0; //Culms[0]->initialize(); leafNo = Enumerable.Repeat(0d, 13).ToList(); //new List<double>(phenology.Phases.Count); leafNo[emergence] = leafNoAtEmergence.Value(); FinalLeafNo = 0; dltLeafNo = 0; tpla = 0; radiationValues = new List <double>(); NLeaves = 0; }