本文整理汇总了C#中Stand.ResetBiomassRemoved方法的典型用法代码示例。如果您正苦于以下问题:C# Stand.ResetBiomassRemoved方法的具体用法?C# Stand.ResetBiomassRemoved怎么用?C# Stand.ResetBiomassRemoved使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stand
的用法示例。
在下文中一共展示了Stand.ResetBiomassRemoved方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteLogEntry
//---------------------------------------------------------------------
public void WriteLogEntry(ManagementArea mgmtArea, Stand stand)
{
int damagedSites = 0;
int cohortsDamaged = 0;
int cohortsKilled = 0;
int standPrescriptionNumber = 0;
double biomassRemoved = 0.0;
double biomassRemovedPerHa = 0.0;
//ModelCore.UI.WriteLine("BiomassHarvest: PlugIn.cs: WriteLogEntry: mgmtArea {0}, Stand {1} ", mgmtArea.Prescriptions.Count, stand.MapCode);
foreach (ActiveSite site in stand) {
//set the prescription name for this site
if (BaseHarvest.SiteVars.Prescription[site] != null)
{
standPrescriptionNumber = BaseHarvest.SiteVars.Prescription[site].Number;
BaseHarvest.SiteVars.PrescriptionName[site] = BaseHarvest.SiteVars.Prescription[site].Name;
BaseHarvest.SiteVars.TimeOfLastEvent[site] = modelCore.CurrentTime;
}
cohortsDamaged += SiteVars.CohortsPartiallyDamaged[site];
cohortsKilled += BaseHarvest.SiteVars.CohortsDamaged[site];
if (SiteVars.CohortsPartiallyDamaged[site] > 0 || BaseHarvest.SiteVars.CohortsDamaged[site] > 0)
{
damagedSites++;
//Conversion from [g m-2] to [Mg ha-1] to [Mg]
biomassRemoved += SiteVars.BiomassRemoved[site] / 100.0 * modelCore.CellArea;
}
}
totalSites[standPrescriptionNumber] += stand.SiteCount;
totalDamagedSites[standPrescriptionNumber] += damagedSites;
totalCohortsDamaged[standPrescriptionNumber] += cohortsDamaged;
totalCohortsKilled[standPrescriptionNumber] += cohortsKilled;
//csv string for log file, contains species kill count
string species_count = "";
/*
//if this is the right species match, add it's count to the csv string
foreach (ISpecies species in modelCore.Species) {
bool assigned = false;
//loop through dictionary of species kill count
foreach (KeyValuePair<string, int> kvp in stand.DamageTable) {
if (species.Name == kvp.Key) {
assigned = true;
species_count += "," + kvp.Value;
totalSpeciesCohorts[standPrescriptionNumber, species.Index] += kvp.Value;
}
}
if (!assigned) {
//put a 0 there if it's not assigned (because none were found in the dictionary)
species_count += ",0";
totalSpeciesCohorts[standPrescriptionNumber, species.Index] += 0;
}
}
*/
//now that the damage table for this stand has been recorded, clear it!!
stand.ClearDamageTable();
//if this is the right species match, add it's count to the csv string
foreach (ISpecies species in modelCore.Species)
{
int biomassRemovedGramsPerMeterSquared = stand.GetBiomassRemoved(species);
double biomassRemovedMgrams = biomassRemovedGramsPerMeterSquared / 100.0 * Model.Core.CellArea;
species_count += "," + biomassRemovedMgrams;
}
stand.ResetBiomassRemoved();
//write to log file:
biomassRemovedPerHa = biomassRemoved / (double) damagedSites / modelCore.CellArea;
// Biomass Harvest is only interested in events that remove biomass, but
// Biomass Development may have prescriptions that don't remove biomass
// (e.g., easement prescriptions). So, we log the event regardless if
// any biomass was removed or not.
//if(biomassRemoved <= 0.0)
// return;
log.WriteLine("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9:0.000},{10:0.000},{11},{12}{13}",
modelCore.CurrentTime,
mgmtArea.MapCode,
stand.PrescriptionName,
stand.MapCode,
stand.EventId,
stand.Age,
stand.HarvestedRank,
stand.SiteCount,
damagedSites,
biomassRemoved, // Mg
biomassRemovedPerHa, // Mg/ha
cohortsDamaged,
cohortsKilled,
species_count);
}