本文整理汇总了C#中ISpeciesCohortBoolArray类的典型用法代码示例。如果您正苦于以下问题:C# ISpeciesCohortBoolArray类的具体用法?C# ISpeciesCohortBoolArray怎么用?C# ISpeciesCohortBoolArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISpeciesCohortBoolArray类属于命名空间,在下文中一共展示了ISpeciesCohortBoolArray类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MarkCohortsForDeath
//---------------------------------------------------------------------
#region ISpeciesCohortsDisturbance members
/// <summary>
/// Mark which cohorts for a species are to be cut (harvested).
/// </summary>
public void MarkCohortsForDeath(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isKilled)
{
CohortSelector.Harvest(cohorts, isKilled);
int numKilled = 0;
for (int i = 0; i < isKilled.Count; i++)
{
if (isKilled[i])
{
cohortCounts.IncrementCount(cohorts.Species);
numKilled++;
}
}
if (isDebugEnabled)
{
if (numKilled > 0)
{
string ageList = "";
int i = 0;
foreach (ICohort cohort in cohorts)
{
if (isKilled[i])
ageList += string.Format(" {0}", cohort.Age);
i++;
}
log.DebugFormat(" Cut {0} :{1}", cohorts.Species.Name, ageList);
}
}
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:38,代码来源:WholeCohortCutter.cs
示例2: OldestOfSelectedSpecies
//---------------------------------------------------------------------
public void OldestOfSelectedSpecies(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isDamaged)
{
if (cohorts.Species == SelectedSpecies)
// Oldest is first cohort
isDamaged[0] = true;
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:9,代码来源:MockSpeciesCohortsDisturbance.cs
示例3: Harvest
//---------------------------------------------------------------------
/// <summary>
/// Selects which of a species' cohorts are harvested.
/// </summary>
public void Harvest(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
SelectCohorts.Method selectionMethod;
if (selectionMethods.TryGetValue(cohorts.Species, out selectionMethod))
selectionMethod(cohorts, isHarvested);
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:12,代码来源:MultiSpeciesCohortSelector.cs
示例4: All
//---------------------------------------------------------------------
/// <summary>
/// Selects all of a species' cohorts for harvesting.
/// </summary>
public static void All(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
//loop through all cohorts and mark as harvested
for (int i = 0; i < isHarvested.Count; i++)
isHarvested[i] = true;
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:12,代码来源:SelectCohorts.cs
示例5: AllExceptOldest
//---------------------------------------------------------------------
/// <summary>
/// Selects all of a species' cohorts for harvesting except the oldest.
/// </summary>
public static void AllExceptOldest(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
// Oldest is first (so start at i = 1 instead of i = 0)
for (int i = 1; i < isHarvested.Count; i++)
isHarvested[i] = true;
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:12,代码来源:SelectCohorts.cs
示例6: AllExceptYoungest
//---------------------------------------------------------------------
public void AllExceptYoungest(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isDamaged)
{
// Youngest is the last cohort (at index Count - 1)
for (int i = 0; i < (isDamaged.Count - 1); i++)
isDamaged[i] = true;
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:9,代码来源:MockSpeciesCohortsDisturbance.cs
示例7: AllOfSelectedSpecies
//---------------------------------------------------------------------
public void AllOfSelectedSpecies(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isDamaged)
{
if (cohorts.Species == SelectedSpecies) {
for (int i = 0; i < isDamaged.Count; i++)
isDamaged[i] = true;
}
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:10,代码来源:MockSpeciesCohortsDisturbance.cs
示例8: AllExceptYoungest
//---------------------------------------------------------------------
/// <summary>
/// Selects all of a species' cohorts for harvesting except the
/// youngest.
/// </summary>
public static void AllExceptYoungest(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
// Youngest is last.
int youngestIndex = isHarvested.Count - 1;
for (int i = 0; i < youngestIndex; i++)
isHarvested[i] = true;
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:14,代码来源:SelectCohorts.cs
示例9: SelectCohorts
//---------------------------------------------------------------------
/// <summary>
/// Selects which of a species' cohorts are harvested.
/// </summary>
public void SelectCohorts(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
int i = 0;
foreach (ICohort cohort in cohorts) {
AgeRange? notUsed;
if (agesAndRanges.Contains(cohort.Age, out notUsed))
isHarvested[i] = true;
i++;
}
}
开发者ID:LANDIS-II-Foundation,项目名称:Library-Site-Harvest,代码行数:15,代码来源:SpecificAgesCohortSelector.cs
示例10: SelectCohorts
//---------------------------------------------------------------------
/// <summary>
/// Selects which of a species' cohorts are harvested.
/// </summary>
public void SelectCohorts(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
int i = 0;
foreach (ICohort cohort in cohorts) {
if (ages.Contains(cohort.Age))
isHarvested[i] = true;
else {
foreach (AgeRange range in ranges) {
if (range.Contains(cohort.Age)) {
isHarvested[i] = true;
break;
}
}
}
i++;
}
}
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Disturbance,代码行数:23,代码来源:SpecificAgesCohortSelector.cs
示例11: Every2ndCohort
//---------------------------------------------------------------------
public void Every2ndCohort(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isDamaged)
{
int N = 2;
// Every Nth cohort, working from youngest to oldest
int youngestIndex = isDamaged.Count - 1;
for (int i = youngestIndex - (N - 1); i >= 0; i -= N)
isDamaged[i] = true;
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:11,代码来源:MockSpeciesCohortsDisturbance.cs
示例12: SelectCohorts
//---------------------------------------------------------------------
/// <summary>
/// Selects which of a species' cohorts are harvested.
/// </summary>
public void SelectCohorts(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
// TODO
throw new System.NotImplementedException();
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:11,代码来源:SpecificAgesCohortSelector.cs
示例13: Youngest
//---------------------------------------------------------------------
/// <summary>
/// Selects the youngest of a species' cohorts for harvesting.
/// </summary>
public static void Youngest(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
// Youngest is last.
isHarvested[isHarvested.Count - 1] = true;
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:11,代码来源:SelectCohorts.cs
示例14: Oldest
//---------------------------------------------------------------------
/// <summary>
/// Selects the oldest of a species' cohorts for harvesting.
/// </summary>
public static void Oldest(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
// Oldest is first.
isHarvested[0] = true;
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:11,代码来源:SelectCohorts.cs
示例15:
//---------------------------------------------------------------------
void ISpeciesCohortsDisturbance.Damage(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isDamaged)
{
cohortSelector.Harvest(cohorts, isDamaged);
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:7,代码来源:Prescription.cs
示例16: Damage
//---------------------------------------------------------------------
void ISpeciesCohortsDisturbance.Damage(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isDamaged)
{
Damage(cohorts, isDamaged);
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:7,代码来源:MockSpeciesCohortsDisturbance.cs
示例17: Harvest
//---------------------------------------------------------------------
/// <summary>
/// Selects which of a species' cohorts are harvested.
/// </summary>
public void Harvest(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
for (int i = 0; i < isHarvested.Count; i++)
isHarvested[i] = true;
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:11,代码来源:Clearcut.cs
示例18: SelectCohorts
//---------------------------------------------------------------------
/// <summary>
/// Selects which of a species' cohorts are harvested.
/// </summary>
public void SelectCohorts(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isHarvested)
{
for (int i = isHarvested.Count - N; i >= 0; i -= N)
isHarvested[i] = true;
}
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:11,代码来源:EveryNthCohort.cs
示例19: ClearCut
//---------------------------------------------------------------------
public void ClearCut(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isDamaged)
{
for (int i = 0; i < isDamaged.Count; i++)
isDamaged[i] = true;
}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:8,代码来源:MockSpeciesCohortsDisturbance.cs
示例20:
//---------------------------------------------------------------------
void ISpeciesCohortsDisturbance.MarkCohortsForDeath(ISpeciesCohorts cohorts,
ISpeciesCohortBoolArray isDamaged)
{
cohortSelector.Harvest(cohorts, isDamaged);
int cohortsDamaged = 0;
for (int i = 0; i < isDamaged.Count; i++) {
if (isDamaged[i]) {
//if this cohort is killed, update the damage table (for the stand of this site) with this species name
SiteVars.Stand[currentSite].UpdateDamageTable(cohorts.Species.Name);
//PlugIn.ModelCore.UI.WriteLine("Damaged: {0}.", cohorts.Species.Name);
//and increment the cohortsDamaged
cohortsDamaged++;
}
}
SiteVars.CohortsDamaged[currentSite] += cohortsDamaged;
}
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Disturbance,代码行数:20,代码来源:Prescription.cs
注:本文中的ISpeciesCohortBoolArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论