本文整理汇总了C#中ActiveSite类的典型用法代码示例。如果您正苦于以下问题:C# ActiveSite类的具体用法?C# ActiveSite怎么用?C# ActiveSite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActiveSite类属于命名空间,在下文中一共展示了ActiveSite类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Algorithm
public static bool Algorithm(ISpecies species,
ActiveSite site)
{
return Reproduction.SufficientLight(species, site) &&
Reproduction.Establish(species, site) &&
Reproduction.MaturePresent(species, site);
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:7,代码来源:NoDispersal.cs
示例2: AddWoody
/// <summary>
/// Adds some biomass for a species to the WOODY pools at a site.
/// </summary>
public static void AddWoody(double woodyBiomass,
ISpecies species,
ActiveSite site)
{
SiteVars.WoodyDebris[site].AddMass(woodyBiomass,
SpeciesData.WoodyDebrisDecay[species]);
}
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:10,代码来源:ForestFloor.cs
示例3: GrowCohorts
//---------------------------------------------------------------------
/// <summary>
/// Grows all cohorts at a site for a specified number of years. The
/// dead pools at the site also decompose for the given time period.
/// </summary>
public static void GrowCohorts(Landis.Library.BiomassCohorts.SiteCohorts cohorts,
ActiveSite site,
int years,
bool isSuccessionTimestep)
{
if (SiteVars.Cohorts[site] == null)
return;
for (int y = 1; y <= years; ++y)
{
SpeciesData.ChangeDynamicParameters(PlugIn.ModelCore.CurrentTime + y - 1);
SiteVars.ResetAnnualValues(site);
CohortBiomass.SubYear = y - 1;
CohortBiomass.CanopyLightExtinction = 0.0;
// SiteVars.LAI[site] = 0.0;
SiteVars.PercentShade[site] = 0.0;
SiteVars.LightTrans[site] = 1.0;
SiteVars.Cohorts[site].Grow(site, (y == years && isSuccessionTimestep));
SiteVars.WoodyDebris[site].Decompose();
SiteVars.Litter[site].Decompose();
}
}
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Succession,代码行数:31,代码来源:PlugIn.cs
示例4: AddNewCohort
//---------------------------------------------------------------------
public void AddNewCohort(ISpecies species,
ActiveSite site)
{
cohorts[site].AddNewCohort(species,
CohortBiomass.InitialBiomass(cohorts[site],
site, species));
}
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:8,代码来源:PlugIn.cs
示例5: MyAddNewCohort
//---------------------------------------------------------------------
public static void MyAddNewCohort(ISpecies species,
ActiveSite site)
{
Assert.IsTrue(speciesThatReproduce.Contains(species));
Assert.AreEqual(expectedSite, site);
actualSpecies_AddNewCohort.Add(species);
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:9,代码来源:Reproduction_Test.cs
示例6: AssignSiteToStand
//---------------------------------------------------------------------
/// <summary>
/// Assigns an active site to a particular stand.
/// </summary>
/// <param name="activeSite">
/// The active site that is being assigned to a stand.
/// </param>
/// <param name="mapCode">
/// The map code of the stand that the site is being assigned to.
/// </param>
public static void AssignSiteToStand(ActiveSite activeSite,
ushort mapCode)
{
double blockArea = (activeSite.SharesData ? Model.BlockArea : Model.Core.CellArea)
// Skip the site if its management area is not active.
if (SiteVars.ManagementArea[activeSite] == null)
return;
Stand stand;
//check if this stand is already in the dictionary
if (stands.TryGetValue(mapCode, out stand)) {
//if the stand is already in the dictionary, check if it is in the same management area.
//if it's not in the same MA, throw exception.
if (SiteVars.ManagementArea[activeSite] != stand.ManagementArea) {
throw new PixelException(activeSite.Location,
"Stand {0} is in management areas {1} and {2}",
stand.MapCode,
stand.ManagementArea.MapCode,
SiteVars.ManagementArea[activeSite].MapCode);
}
}
//valid site location which has not been keyed by the dictionary.
else {
//assign stand (trygetvalue set it to null when it wasn't found in the dictionary)
stand = new Stand(mapCode, blockArea);
//add this stand to the correct management area (pointed to by the site)
SiteVars.ManagementArea[activeSite].Add(stand);
stands[mapCode] = stand;
}
//add this site to this stand
stand.Add(activeSite);
}
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Disturbance,代码行数:46,代码来源:Stands.cs
示例7: Died
//---------------------------------------------------------------------
/// <summary>
/// Raises a Cohort.DeathEvent.
/// </summary>
public static void Died(object sender,
ICohort cohort,
ActiveSite site,
PlugInType disturbanceType)
{
if (DeathEvent != null)
DeathEvent(sender, new DeathEventArgs(cohort, site, disturbanceType));
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:13,代码来源:Cohort.cs
示例8: Algorithm
public static bool Algorithm(ISpecies species,
ActiveSite site)
{
return Reproduction.SufficientResources(species, site) &&
Reproduction.Establish(species, site) &&
//Reproduction.MaturePresent(species, site);
SiteVars.Cohorts[site].IsMaturePresent(species);
}
开发者ID:LANDIS-II-Foundation,项目名称:Library-Succession,代码行数:8,代码来源:NoDispersal.cs
示例9: MySeedingAlgorithm
//---------------------------------------------------------------------
public static bool MySeedingAlgorithm(ISpecies species,
ActiveSite site)
{
Assert.IsTrue(expectedSpecies.Contains(species));
Assert.AreEqual(expectedSite, site);
actualSpecies_SeedingAlg.Add(species);
return speciesThatReproduce.Contains(species);
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:10,代码来源:Reproduction_Test.cs
示例10: Establish
//public static bool Establish(double[,] establishment)
//---------------------------------------------------------------------
/// <summary>
/// Determines if a species can establish on a site.
/// </summary>
public static bool Establish(ISpecies species, ActiveSite site)
{
double establishProbability = 0; // Reproduction.GetEstablishProbability(species, site);
//return Landis.Model.GenerateUniform() < establishment;
return Model.Core.GenerateUniform() < establishProbability;
}
开发者ID:LANDIS-II-Foundation,项目名称:Library-Succession,代码行数:13,代码来源:ReproductionDefaults.cs
示例11: ComputeShade
//---------------------------------------------------------------------
public override byte ComputeShade(ActiveSite site)
{
byte shade = 0;
foreach (SpeciesCohorts speciesCohorts in cohorts[site]) {
ISpecies species = speciesCohorts.Species;
if (species.ShadeTolerance > shade)
shade = species.ShadeTolerance;
}
return shade;
}
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:11,代码来源:PlugIn.cs
示例12: SufficientResources
/// <summary>
/// The default method for determining if there is sufficient light at
/// a site for a species to germinate/resprout.
/// </summary>
public static bool SufficientResources(ISpecies species,
ActiveSite site)
{
byte siteShade = SiteVars.Shade[site];
bool sufficientLight;
sufficientLight = (species.ShadeTolerance <= 4 && species.ShadeTolerance > siteShade) ||
(species.ShadeTolerance == 5 && siteShade > 1);
// pg 14, Model description, this ----------------^ may be 2?
return sufficientLight;
}
开发者ID:LANDIS-II-Foundation,项目名称:Library-Succession,代码行数:14,代码来源:ReproductionDefaults.cs
示例13: AssignSiteToMgmtArea
//---------------------------------------------------------------------
/// <summary>
/// Assigns an active site to a particular management area.
/// </summary>
/// <param name="activeSite">
/// The active site that is being assigned to a management area.
/// </param>
/// <param name="mapCode">
/// The map code of the management area that the site is being assigned
/// to.
/// </param>
public static void AssignSiteToMgmtArea(ActiveSite activeSite,
ushort mapCode)
{
ManagementArea mgmtArea = mgmtAreas.Find(mapCode);
if (mgmtArea == null) {
if (! inactiveMgmtAreas.Contains(mapCode))
inactiveMgmtAreas.Add(mapCode);
}
else {
mgmtArea.OnMap = true;
SiteVars.ManagementArea[activeSite] = mgmtArea;
}
}
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Disturbance,代码行数:25,代码来源:ManagementAreas.cs
示例14: ActualSiteBiomass
//---------------------------------------------------------------------
/// <summary>
/// Computes the actual biomass at a site. The biomass is the total
/// of all the site's cohorts except young ones. The total is limited
/// to being no more than the site's maximum biomass less the previous
/// year's mortality at the site.
/// </summary>
public static double ActualSiteBiomass(SiteCohorts siteCohorts,
ActiveSite site,
out IEcoregion ecoregion)
{
int youngBiomass;
int totalBiomass = Cohorts.ComputeBiomass(siteCohorts, out youngBiomass);
double B_ACT = totalBiomass - youngBiomass;
int lastMortality = siteCohorts.PrevYearMortality;
ecoregion = Model.Core.Ecoregion[site];
B_ACT = Math.Min( B_MAX[ecoregion] - lastMortality, B_ACT);
return B_ACT;
}
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:21,代码来源:LivingBiomass.cs
示例15:
//---------------------------------------------------------------------
bool IFormOfReproduction.TryAt(ActiveSite site)
{
bool success = false;
BitArray selectedSpeciesAtSite = selectedSpecies[site];
for (int index = 0; index < speciesDataset.Count; ++index) {
if (selectedSpeciesAtSite.Get(index)) {
ISpecies species = speciesDataset[index];
if (PreconditionsSatisfied(species, site)) {
Reproduction.AddNewCohort(species, site);
success = true;
}
}
}
return success;
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:19,代码来源:FormOfReproduction.cs
示例16: AddLitter
//---------------------------------------------------------------------
/// <summary>
/// Adds some biomass for a species to the LITTER pools at a site.
/// </summary>
public static void AddLitter(double nonWoodyBiomass,
ISpecies species,
ActiveSite site)
{
IEcoregion ecoregion = PlugIn.ModelCore.Ecoregion[site];
double siteAET = (double)EcoregionData.AET[ecoregion];
//Calculation of decomposition rate for species litter cohort
// Decay rate from Meentemeyer 1978. Ecology 59: 465-472.
double leafKReg = (-0.5365 + (0.00241 * siteAET)) - (((-0.01586 + (0.000056 * siteAET)) * SpeciesData.LeafLignin[species] * 100));
// From Fan et al. 1998 Ecological Applications 8: 734-737:
//double leafKReg = ((0.10015 * siteAET - 3.44618) - (0.01341 + 0.00147 * siteAET) *
//SpeciesData.LeafLignin[species]) / 100;
//PlugIn.ModelCore.Log.WriteLine("Decay rate for {0} within {1} = {2}. LL = {3}.", species.Name, ecoregion.Name, leafKReg, SpeciesData.LeafLignin[species]);
double decayValue = leafKReg;
SiteVars.Litter[site].AddMass(nonWoodyBiomass, decayValue);
}
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:25,代码来源:ForestFloor.cs
示例17: ComputeActualANPP
//---------------------------------------------------------------------
private double ComputeActualANPP(ICohort cohort,
ActiveSite site,
int siteBiomass,
int prevYearSiteMortality)
{
growthReduction = CohortGrowthReduction.Compute(cohort, site, siteBiomass);
double growthShape = SpeciesData.GrowthCurveShapeParm[cohort.Species];
double cohortBiomass = cohort.Biomass;
double capacityReduction = 1.0;
if(SiteVars.CapacityReduction != null && SiteVars.CapacityReduction[site] > 0)
{
capacityReduction = 1.0 - SiteVars.CapacityReduction[site];
if(PlugIn.CalibrateMode)
PlugIn.ModelCore.Log.WriteLine("Yr={0}. Capacity Remaining={1:0.00}, Spp={2}, Age={3} B={4}.", (PlugIn.ModelCore.CurrentTime+SubYear), capacityReduction, cohort.Species.Name, cohort.Age, cohort.Biomass);
}
double maxBiomass = SpeciesData.B_MAX_Spp[cohort.Species][ecoregion] * capacityReduction;
double maxANPP = SpeciesData.ANPP_MAX_Spp[cohort.Species][ecoregion];
// Potential biomass, equation 3 in Scheller and Mladenoff, 2004
double potentialBiomass = Math.Max(1.0, maxBiomass - siteBiomass + cohortBiomass);
// Species can use new space from mortality immediately
// but not in the case of capacity reduction due to harvesting.
if(capacityReduction >= 1.0)
potentialBiomass = Math.Max(potentialBiomass, prevYearSiteMortality);
// Ratio of cohort's actual biomass to potential biomass
B_AP = cohortBiomass / potentialBiomass;
double indexC = CalculateCompetition(site, cohort);
if ((indexC <= 0.0 && cohortBiomass > 0) || indexC > 1.0)
{
PlugIn.ModelCore.Log.WriteLine("Error: Competition Index [{0:0.00}] is <= 0.0 or > 1.0", indexC);
PlugIn.ModelCore.Log.WriteLine("Yr={0}. SPECIES={1}, AGE={2}, B={3}", (PlugIn.ModelCore.CurrentTime + SubYear), cohort.Species.Name, cohort.Age, cohortBiomass);
throw new ApplicationException("Application terminating.");
}
// Ratio of cohort's potential biomass to maximum biomass. The
// ratio cannot be exceed 1.
double indexOldSchool = Math.Min(1.0, potentialBiomass / maxBiomass);
double initialMultiplier = (CanopyLightExtinction == 0.0 ? indexC : 1.0);
double indexLightC = initialMultiplier * Math.Exp(CanopyLightExtinction);
B_PM = indexLightC;
PlugIn.ModelCore.Log.WriteLine("indexC={0:0.00}, lightIndexC={1:0.00}, OldSchool={2:0.00}.", indexC, indexLightC, indexOldSchool);
// Actual ANPP: equation (4) from Scheller & Mladenoff, 2004.
// Constants k1 and k2 control whether growth rate declines with
// age. Set to default = 1.
//double actualANPP = maxANPP * Math.E * B_AP * Math.Exp(-1 * B_AP) * B_PM;
double actualANPP = maxANPP * Math.E * Math.Pow(B_AP, growthShape) * Math.Exp(-1 * Math.Pow(B_AP, growthShape)) * B_PM;
// Calculated actual ANPP can not exceed the limit set by the
// maximum ANPP times the ratio of potential to maximum biomass.
// This down regulates actual ANPP by the available growing space.
actualANPP = Math.Min(maxANPP * B_PM, actualANPP);
if (growthReduction > 0)
actualANPP *= (1.0 - growthReduction);
double LAIactual = SpeciesData.MAXLAI[cohort.Species] * actualANPP / maxANPP;
CanopyLightExtinction += (-1.0 * SpeciesData.LightExtinctionCoeff[cohort.Species] * LAIactual) * indexC;
if(PlugIn.CalibrateMode && PlugIn.ModelCore.CurrentTime > 0)
{
PlugIn.ModelCore.Log.WriteLine("Yr={0}. Calculate ANPPactual...", (PlugIn.ModelCore.CurrentTime+SubYear));
PlugIn.ModelCore.Log.WriteLine("Yr={0}. Spp={1}, Age={2}.", (PlugIn.ModelCore.CurrentTime+SubYear), cohort.Species.Name, cohort.Age);
PlugIn.ModelCore.Log.WriteLine("Yr={0}. MaxANPP={1}, MaxB={2:0}, Bsite={3}, Bcohort={4:0.0}.", (PlugIn.ModelCore.CurrentTime+SubYear), maxANPP, maxBiomass, (int) siteBiomass, cohort.Biomass);
PlugIn.ModelCore.Log.WriteLine("Yr={0}. B_PM={1:0.0}, B_AP={2:0.0}, actualANPP={3:0.0}, capacityReduction={4:0.0}.", (PlugIn.ModelCore.CurrentTime+SubYear), B_PM, B_AP, actualANPP, capacityReduction);
PlugIn.ModelCore.Log.WriteLine("Yr={0}. CanopyLightExtinction = {1:0.00}, LightTransmittance = {2:0.00}, LAIactual={3:0.0}.", (PlugIn.ModelCore.CurrentTime + SubYear), CanopyLightExtinction, B_PM, LAIactual);
}
return actualANPP;
}
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Succession,代码行数:80,代码来源:CohortBiomass.cs
示例18: CalculateCompetition
//---------------------------------------------------------------------
// New method for calculating competition limits.
// Iterates through cohorts, assigning each a competitive efficiency
private static double CalculateCompetition(ActiveSite site, ICohort cohort)
{
double competitionPower = 0.95;
double CMultiplier = Math.Max(Math.Pow(cohort.Biomass, competitionPower), 1.0);
double CMultTotal = CMultiplier;
//PlugIn.ModelCore.Log.WriteLine("Competition: spp={0}, age={1}, CMultiplier={2:0}, CMultTotal={3:0}.", cohort.Species.Name, cohort.Age, CMultiplier, CMultTotal);
foreach (ISpeciesCohorts speciesCohorts in SiteVars.Cohorts[site])
{
foreach (ICohort xcohort in speciesCohorts)
{
if (xcohort.Age+1 != cohort.Age || xcohort.Species.Index != cohort.Species.Index)
{
double tempMultiplier = Math.Max(Math.Pow(xcohort.Biomass, competitionPower), 1.0);
CMultTotal += tempMultiplier;
//PlugIn.ModelCore.Log.WriteLine("Competition: spp={0}, age={1}, CMultiplier={2:0}, CMultTotal={3:0}.", xcohort.Species.Name, xcohort.Age, tempMultiplier, CMultTotal);
}
}
}
double Cfraction = CMultiplier / CMultTotal;
//PlugIn.ModelCore.Log.WriteLine("Competition: spp={0}, age={1}, CMultiplier={2:0}, CMultTotal={3:0}, CI={4:0.00}.", cohort.Species.Name, cohort.Age, CMultiplier, CMultTotal, Cfraction);
return Cfraction;
}
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Succession,代码行数:28,代码来源:CohortBiomass.cs
示例19: CalculateCohortLight
//---------------------------------------------------------------------
// Added 10/5/09 - BRM
// Replaces CalculateCohortLAI
private static void CalculateCohortLight(ICohort cohort, double actualANPP, double newBiomass, ActiveSite site)
{
ISpecies species = cohort.Species;
double pctBioMaxLAI = SpeciesData.PctBioMaxLAI[species];
double cohortBiomass = newBiomass;
IEcoregion ecoregion = PlugIn.ModelCore.Ecoregion[site];
//double maxBiomass = SpeciesData.B_MAX_Spp[species][ecoregion];
double maxBiomass = EcoregionData.B_MAX[ecoregion];
double maxlai = SpeciesData.MAXLAI[species];
double LAIactual = 0;
double pctBiomass = (cohortBiomass / maxBiomass) * 100;
if (pctBiomass >= pctBioMaxLAI)
{
LAIactual = maxlai;
}
else
{
double slope = 100.0 / pctBioMaxLAI;
double pctLAI = pctBiomass * slope;
LAIactual = (pctLAI * maxlai) / 100;
}
double cohortLightExt = SpeciesData.LightExtinctionCoeff[species] * LAIactual;
double cohortLightTrans = Math.Exp(-1.0 * cohortLightExt);
SiteVars.LightTrans[site] *= cohortLightTrans; //Combine cohortLightTrans for all cohorts on the site
}
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Succession,代码行数:31,代码来源:CohortBiomass.cs
示例20: ComputeNonWoodyPercentage
//---------------------------------------------------------------------
/// <summary>
/// Computes the percentage of a cohort's standing biomass that is non-woody.
/// This method is designed for external calls that need to
/// estimate the amount of non-wood biomass.
/// </summary>
public Percentage ComputeNonWoodyPercentage(ICohort cohort,
ActiveSite site)
{
SiteCohorts siteCohorts = SiteVars.Cohorts[site];
double mortalityAge = ComputeAgeMortality(cohort);
//if(siteCohorts == null) return new Percentage(0.0);
double actualANPP = ComputeActualANPP(cohort, site, siteCohorts.TotalBiomass,
siteCohorts.PrevYearMortality);
// Age mortality is discounted from ANPP to prevent the over-
// estimation of mortality. ANPP cannot be negative.
actualANPP = Math.Max(0, actualANPP - mortalityAge);
return new Percentage(ComputeStandingLeafBiomass(actualANPP, cohort) / cohort.Biomass);
}
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Succession,代码行数:24,代码来源:CohortBiomass.cs
注:本文中的ActiveSite类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论