public SiteConditions(ActiveSite site, ICommunity initialCommunity) { cohorts = new SiteCohorts(); canopy = new Canopy(); if (PlugIn.HasSiteOutput[site] == true) { siteoutput = new SiteOutput(site); estoutput = new EstablishmentOutput(site); } this.site = site; foreach (ISpecies spc in PlugIn.modelCore.Species) { deadcohortages[spc] = new List <int>(); } uint key = ComputeKey(initialCommunity.MapCode, PlugIn.ModelCore.Ecoregion[site].MapCode); SiteConditions s = GetFromKey(key); if (s != null) { return; } // If we don't have a sorted list of age cohorts for the initial // community, make the list List <Landis.Library.AgeOnlyCohorts.ICohort> sortedAgeCohorts; if (!sortedCohorts.TryGetValue(initialCommunity.MapCode, out sortedAgeCohorts)) { sortedAgeCohorts = PlugIn.RankCohortAgesOldToYoung(initialCommunity.Cohorts); sortedCohorts[initialCommunity.MapCode] = sortedAgeCohorts; } hydrology = new Hydrology(PlugIn.modelCore.Ecoregion[site]); forestfloor = new ForestFloor(); cohorts = new SiteCohorts(); establishment = new EstablishmentProbability(site); if (sortedAgeCohorts.Count == 0) { return; } //PlugIn.ModelCore.UI.WriteLine("Making Biomass Cohorts "+ site); BiomassSpinUp(sortedAgeCohorts, site); initialSites[key] = this; return; }
public SiteConditions(ActiveSite site, ICommunity initialCommunity) { cohorts = new SiteCohorts(); canopy = new Canopy(); if (PlugIn.HasSiteOutput[site] == true) { siteoutput = new SiteOutput(site); estoutput = new EstablishmentOutput(site); } this.site = site; foreach (ISpecies spc in PlugIn.modelCore.Species) { deadcohortages[spc] = new List<int>(); } uint key = ComputeKey(initialCommunity.MapCode, PlugIn.ModelCore.Ecoregion[site].MapCode); SiteConditions s = GetFromKey(key); if (s != null) return; // If we don't have a sorted list of age cohorts for the initial // community, make the list List<Landis.Library.AgeOnlyCohorts.ICohort> sortedAgeCohorts; if (!sortedCohorts.TryGetValue(initialCommunity.MapCode, out sortedAgeCohorts)) { sortedAgeCohorts = PlugIn.RankCohortAgesOldToYoung(initialCommunity.Cohorts); sortedCohorts[initialCommunity.MapCode] = sortedAgeCohorts; } hydrology = new Hydrology(PlugIn.modelCore.Ecoregion[site]); forestfloor = new ForestFloor(); cohorts = new SiteCohorts(); establishment = new EstablishmentProbability(site); if (sortedAgeCohorts.Count == 0) return; //PlugIn.ModelCore.UI.WriteLine("Making Biomass Cohorts "+ site); BiomassSpinUp(sortedAgeCohorts, site); initialSites[key] = this; return; }