//--------------------------------------------------------------------- /// <summary> /// Combines all young cohorts into a single cohort whose age is the /// succession timestep - 1 and whose biomass is the sum of all the /// biomasses of the young cohorts. /// </summary> /// <remarks> /// The age of the combined cohort is set to the succession timestep - /// 1 so that when the combined cohort undergoes annual growth, its /// age will end up at the succession timestep. /// <p> /// For this method, young cohorts are those whose age is less than or /// equal to the succession timestep. We include the cohort whose age /// is equal to the timestep because such a cohort is generated when /// reproduction occurs during a succession timestep. /// </remarks> public bool CombineYoungCohorts(int SuccessionTimeStep, int Year) { // Work from the end of cohort data since the array is in old-to- // young order. int youngCount = 0; float totalWoodC = 0; float totalFolC = 0; float totalRootC = 0; float totalNSC = 0; float totalfolshead = 0; bool leaf_on = false; for (int i = cohorts.Count - 1; i >= 0; i--) { Cohort c = cohorts[i]; if (c.Age <= SuccessionTimeStep) { youngCount++; totalWoodC += c.Wood; totalFolC += c.Fol; totalNSC += c.NSC; totalRootC += c.Root; leaf_on = c.Leaf_On; totalfolshead += c.FolShed; } else { break; } } if (youngCount > 1) { cohorts.RemoveRange(cohorts.Count - youngCount, youngCount); cohorts.Add(new Cohort(this.species, (ushort)(BiomassCohorts.Cohorts.SuccessionTimeStep - 1), totalFolC, totalfolshead, totalWoodC, totalNSC, totalRootC, Year, leaf_on)); return(true); } return(false); }
public int ReduceOrKillBiomassCohorts(Landis.Library.BiomassCohorts.IDisturbance disturbance) { int totalReduction = 0; for (int i = cohorts.Count - 1; i >= 0; i--) { int reduction = disturbance.ReduceOrKillMarkedCohort(cohorts[i]); if (reduction > 0) { totalReduction += reduction; if (reduction < cohorts[i].Biomass) { cohorts[i].Wood -= (ushort)reduction; } else { //cohorts[i].IsAlive = false; Cohort.Died(this, cohorts[i], disturbance.CurrentSite, disturbance.Type); cohorts.Remove(cohorts[i]); } } } return(totalReduction); }
//--------------------------------------------------------------------- public void AddNewCohort2(Cohort c) { this.cohorts.Add(c); }
public SubCanopyLayer(Cohort cohort, byte LayerIndex) { this.cohort = cohort; this.LayerIndex = LayerIndex; }
public Cohort(Cohort cohort, int IMAX) { SubCanopyLayers = new List<SubCanopyLayer>(); this.MaxBiomass = cohort.MaxBiomass; this.species = cohort.species; this.Age = cohort.Age; this.Wood = cohort.Wood; this.NSC = cohort.NSC; this.Root = cohort.Root; this.Fol = cohort.Fol; this.MaxBiomass = cohort.MaxBiomass; this.IsAlive = true; }
//--------------------------------------------------------------------- public Cohort(Cohort cohort) { this.species = cohort.Species; this.Age = cohort.age; this.Wood = cohort.wood; this.nsc = cohort.nsc; this.root = cohort.root; this.fol = cohort.fol; this.year_of_birth = cohort.year_of_birth;// this.folshed = cohort.folshed; }
//--------------------------------------------------------------------- public void AddNewCohort2(Cohort c) { //System.Console.WriteLine("AddNewCohort2\t" + c.Species.Name); this.cohorts.Add(c); }