当前位置: 首页>>代码示例>>C#>>正文


C# ActiveSite类代码示例

本文整理汇总了C#中ActiveSite的典型用法代码示例。如果您正苦于以下问题:C# ActiveSite类的具体用法?C# ActiveSite怎么用?C# ActiveSite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ActiveSite类属于命名空间,在下文中一共展示了ActiveSite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的ActiveSite类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。