本文整理汇总了C#中ISpecies类的典型用法代码示例。如果您正苦于以下问题:C# ISpecies类的具体用法?C# ISpecies怎么用?C# ISpecies使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISpecies类属于命名空间,在下文中一共展示了ISpecies类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddFoliageLitter
//---------------------------------------------------------------------
/// <summary>
/// Adds some biomass for a species to the foliar LITTER pools at a site.
/// </summary>
public static void AddFoliageLitter(double foliarBiomass,
ISpecies species,
ActiveSite site)
{
double inputDecayValue = 1.0; // Decay value is calculated for surface/soil layers (leaf/fine root),
// therefore, this is just a dummy value.
if(foliarBiomass > 0)
{
SiteVars.LitterfallC[site] += foliarBiomass * 0.47;
LitterLayer.PartitionResidue(
foliarBiomass,
inputDecayValue,
SpeciesData.LeafCN[species],
SpeciesData.LeafLignin[species],
OtherData.StructuralCN,
LayerName.Leaf,
LayerType.Surface,
site);
}
}
示例2: Default
//---------------------------------------------------------------------
/// <summary>
/// Default seed dispersal method.
/// </summary>
public static float Default(ISpecies species,
ActiveSite sourceSite,
ActiveSite destinationSite)
{
// TODO - Based on Brendan Ward's thesis
return 0.0f;
}
示例3: ProbabilityComputer
public ProbabilityComputer(ISpecies species)
{
effDist = species.EffectiveSeedDist;
maxDist = species.MaxSeedDist;
lambda1 = Math.Log((1-ratio)/effDist);
lambda2 = Math.Log(0.01)/maxDist;
}
示例4: AddNewCohort
//---------------------------------------------------------------------
public void AddNewCohort(ISpecies species,
ActiveSite site)
{
cohorts[site].AddNewCohort(species,
CohortBiomass.InitialBiomass(cohorts[site],
site, species));
}
示例5: Algorithm
public static bool Algorithm(ISpecies species,
ActiveSite site)
{
return Reproduction.SufficientLight(species, site) &&
Reproduction.Establish(species, site) &&
Reproduction.MaturePresent(species, site);
}
示例6: GetFWater
public static float GetFWater(ISpecies species, float pressurehead)
{
if (pressurehead < 0 || pressurehead > species.H4()) return 0;
else if (pressurehead > species.H3()) return 1 - ((pressurehead - species.H3()) / (species.H4() - species.H3()));
else if (pressurehead < species.H2()) return pressurehead / species.H2();
else return 1;
}
示例7: SpeciesCohorts
//---------------------------------------------------------------------
/// <summary>
/// Initializes a new instance with one young cohort (age = 1).
/// </summary>
public SpeciesCohorts(ISpecies species)
{
this.species = species;
this.ages = new List<ushort>();
this.isMaturePresent = false;
AddNewCohort();
}
示例8: AddFrassLitter
//---------------------------------------------------------------------
/// <summary>
/// Adds frass for a species to the foliar LITTER pools at a site.
/// Assumes that some of the N has been resorbed.
/// </summary>
public static void AddFrassLitter(double inputFrassBiomass, ISpecies species, ActiveSite site)
{
double inputDecayValue = 1.0; // Decay value is calculated for surface/soil layers (leaf/fine root),
// therefore, this is just a dummy value.
if (inputFrassBiomass > 0)
{
//SiteVars.LitterfallC[site] += defoliatedLeafBiomass * 0.47;
//double frassBiomass = Math.Max(0.0, OtherData.frassdepk * defoliatedLeafBiomass);
// Frass C added is a function of defoliated leaf biomass, but adjusted for the CN of litter and frass
// Any C lost is due to insect metabolism
double inputFrassC = inputFrassBiomass * 0.47;
double inputFrassN = inputFrassC / (double) SpeciesData.LeafLitterCN[species];
double actualFrassC = inputFrassN * (double) OtherData.CNratiofrass; // the difference between input and actual is C lost to insect metabolism
double actualFrassBiomass = actualFrassC / 0.47;
//PlugIn.ModelCore.UI.WriteLine("AddFrass.Month={0:0}, inputfrassN={1:0.000}, inputfrassbiomass={2:0.00}, actualfrassbiomass={3:0.00} ", Century.Month, inputFrassN, inputFrassBiomass, actualFrassBiomass);
SiteVars.FrassC[site] += actualFrassC;
LitterLayer.PartitionResidue(
actualFrassBiomass,
inputDecayValue,
OtherData.CNratiofrass,
0.1,
OtherData.StructuralCN,
LayerName.Leaf,
LayerType.Surface,
site);
}
}
示例9: InitialBiomass
//---------------------------------------------------------------------
/// <summary>
/// Computes the initial biomass for a cohort at a site.
/// </summary>
public static float[] InitialBiomass(ISpecies species, ISiteCohorts siteCohorts,
ActiveSite site)
{
IEcoregion ecoregion = PlugIn.ModelCore.Ecoregion[site];
double leafFrac = FunctionalType.Table[SpeciesData.FuncType[species]].FCFRACleaf;
double B_ACT = SiteVars.ActualSiteBiomass(site);
double B_MAX = SpeciesData.B_MAX_Spp[species][ecoregion];
// Initial biomass exponentially declines in response to
// competition.
double initialBiomass = 0.002 * B_MAX * Math.Exp(-1.6 * B_ACT / B_MAX);
initialBiomass = Math.Max(initialBiomass, 5.0);
double initialLeafB = initialBiomass * leafFrac;
double initialWoodB = initialBiomass - initialLeafB;
double[] initialB = new double[2]{initialWoodB, initialLeafB};
float[] initialWoodLeafBiomass = new float[2] { (float)initialB[0], (float)initialB[1] };
//PlugIn.ModelCore.UI.WriteLine("Yr={0},Mo={1}, InitialB={2:0.0}, InitBleaf={3:0.00}, InitBwood={4:0.00}. LeafFrac={5:0.0}", PlugIn.ModelCore.CurrentTime, month, initialBiomass, initialB[1], initialB[0], leafFrac);
//PlugIn.ModelCore.UI.WriteLine("Yr={0},Mo={1}, B_MAX={2:0.0}, B_ACT={3:0.00}", PlugIn.ModelCore.CurrentTime, month, B_MAX, B_ACT);
return initialWoodLeafBiomass;
}
示例10: AddFrassLitter
//---------------------------------------------------------------------
/// <summary>
/// Adds frass for a species to the foliar LITTER pools at a site.
/// Assumes that some of the N has been resorbed.
/// </summary>
public static void AddFrassLitter(double defoliatedLeafBiomass, ISpecies species, ActiveSite site)
{
double inputDecayValue = 1.0; // Decay value is calculated for surface/soil layers (leaf/fine root),
// therefore, this is just a dummy value.
if (defoliatedLeafBiomass > 0)
{
SiteVars.LitterfallC[site] += defoliatedLeafBiomass * 0.47;
double frassBiomass = Math.Max(0.0, OtherData.frassdepk * defoliatedLeafBiomass);
double frassBiomassC = frassBiomass * 0.47;
SiteVars.FrassC[site] += frassBiomassC;
LitterLayer.PartitionResidue(
frassBiomass,
inputDecayValue,
OtherData.CNratiofrass,
1.0,
1.0,
//OtherData.CNratiofrass,
LayerName.Leaf,
LayerType.Surface,
site);
}
}
示例11: InitialBiomass
//---------------------------------------------------------------------
/// <summary>
/// Computes the initial biomass for a cohort at a site.
/// </summary>
public static float[] InitialBiomass(ISpecies species, ISiteCohorts siteCohorts,
ActiveSite site)
{
IEcoregion ecoregion = PlugIn.ModelCore.Ecoregion[site];
double leafFrac = FunctionalType.Table[SpeciesData.FuncType[species]].FCFRACleaf;
double branchFraction = FunctionalType.Table[SpeciesData.FuncType[species]].FCFRACbranch;
//double Ndemand = 0.0;
double B_ACT = SiteVars.ActualSiteBiomass(site);
double B_MAX = SpeciesData.B_MAX_Spp[species][ecoregion];
// Initial biomass exponentially declines in response to
// competition.
double initialBiomass = 0.002 * B_MAX *
Math.Exp(-1.6 * B_ACT / B_MAX);
//Initial biomass is limited by nitrogen availability.
//initialBiomass *= SpeciesData.NLimits[species];
initialBiomass = Math.Max(initialBiomass, 5.0);
double initialLeafB = initialBiomass * leafFrac;
double initialBranchB = initialBiomass* branchFraction;
double initialWoodB = initialBiomass*(1 - leafFrac - branchFraction);
double[] initialB = new double[3] { initialWoodB, initialBranchB, initialLeafB };
//PlugIn.ModelCore.Log.WriteLine("Yr={0},Mo={1}, InitialB={2:0.0}, InitBleaf={3:0.00}, InitBwood={4:0.00}. LeafFrac={5:0.0}", PlugIn.ModelCore.CurrentTime, month, initialBiomass, initialB[1], initialB[0], leafFrac);
//PlugIn.ModelCore.Log.WriteLine("Yr={0},Mo={1}, B_MAX={2:0.0}, B_ACT={3:0.00}", PlugIn.ModelCore.CurrentTime, month, B_MAX, B_ACT);
float[] initialWoodLeafBiomass = new float[3] { (float)initialB[0], (float)initialB[1], (float)initialB[2] }; //wang?
return initialWoodLeafBiomass;
}
示例12: MyAddNewCohort
//---------------------------------------------------------------------
public static void MyAddNewCohort(ISpecies species,
ActiveSite site)
{
Assert.IsTrue(speciesThatReproduce.Contains(species));
Assert.AreEqual(expectedSite, site);
actualSpecies_AddNewCohort.Add(species);
}
示例13: Calculate_Establishment
public static double Calculate_Establishment(ISpecies Species, float PAR, float PressureHead)
{
double frad = Math.Pow(SubCanopyLayer.CumputeFrad(PAR, Species.HalfSat()), Species.EstRad());
double fwater = Math.Pow(SubCanopyLayer.GetFWater(Species, PressureHead), Species.EstMoist());
return frad * fwater;
}
示例14: ReproductionEvent
public ReproductionEvent(ILocation location, int generation, Type reproductionType, ISpecies mate, params ISpecies[] children)
: base(location, generation)
{
this.Mate = mate;
this.Offspring = new List<ISpecies>(children);
this.ReproductionType = reproductionType;
}
示例15: 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]);
}