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


C# ICommunity类代码示例

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


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

示例1: SiteConditions

        public SiteConditions(ActiveSite site, ICommunity initialCommunity)
        {
            cohorts = new SiteCohorts();

            canopy = new Canopy();
            if (PlugIn.HasSiteOutput[site] == true)
            {
                siteoutput = new SiteOutput(site);
                estoutput = new EstablishmentOutput(site);
            }

            this.site = site;

            foreach (ISpecies spc in PlugIn.modelCore.Species)
            {
                deadcohortages[spc] = new List<int>();
            }

            uint key = ComputeKey(initialCommunity.MapCode, PlugIn.ModelCore.Ecoregion[site].MapCode);

            SiteConditions s = GetFromKey(key);

            if (s != null) return;

            //  If we don't have a sorted list of age cohorts for the initial
            //  community, make the list

            List<Landis.Library.AgeOnlyCohorts.ICohort> sortedAgeCohorts;
            if (!sortedCohorts.TryGetValue(initialCommunity.MapCode, out sortedAgeCohorts))
            {
                sortedAgeCohorts = PlugIn.RankCohortAgesOldToYoung(initialCommunity.Cohorts);
                sortedCohorts[initialCommunity.MapCode] = sortedAgeCohorts;
            }
            hydrology = new Hydrology(PlugIn.modelCore.Ecoregion[site]);
            forestfloor = new ForestFloor();
            cohorts = new SiteCohorts();
            establishment = new EstablishmentProbability(site);

            if (sortedAgeCohorts.Count == 0) return;

            //PlugIn.ModelCore.UI.WriteLine("Making Biomass Cohorts "+ site);
            BiomassSpinUp(sortedAgeCohorts, site);

            initialSites[key] = this;
            return;
        }
开发者ID:LANDIS-II-Foundation,项目名称:Extension-PnET-Succession,代码行数:46,代码来源:SiteConditions.cs

示例2: DefineConference

 private static Conference DefineConference(ICommunity community, Catalog catalog, string name, string imageUrl, DateTime startDate, DateTime endDate, string city)
 {
     var conference = community.AddFact(new Conference());
     var header = community.AddFact(new ConferenceHeader(catalog, conference));
     header.Name = name;
     header.ImageUrl = imageUrl;
     header.StartDate = startDate;
     header.EndDate = endDate;
     header.City = city;
     header.Address = "111 Main Street";
     header.HomePageUrl = "awesomefest.com";
     header.Description.SetString(
         "Awesomeness!! Go to AwesomeFest!!!",
         value => header.Description = value,
         community);
     return conference;
 }
开发者ID:michaellperry,项目名称:MyCon,代码行数:17,代码来源:ConferenceViewModelFactory.cs

示例3: Create

        public static ConferenceListViewModel Create(string environment, ICommunity community, ConferenceSelection conferenceSelection)
        {
            var catalog = community.AddFact(new Catalog(environment));

            if (LoadSampleData && !catalog.ConferenceHeaders.Ensure().Any())
            {
                DefineConference(
                    community,
                    catalog,
                    "Cowtown Code Camp 2013",
                    "http://cdn.marketplaceimages.windowsphone.com/v8/images/2a24b5e4-d79a-448e-8818-4040ff0d51a6?imageType=ws_icon_large",
                    new DateTime(2013, 3, 17),
                    new DateTime(2013, 3, 17),
                    "Fort Worth, TX");
                DefineConference(
                    community,
                    catalog,
                    "AwesomeFest 2014",
                    "http://files.g4tv.com/ImageDb3/284724_S/darth-vader-rock-guitarist.jpg",
                    new DateTime(2014, 2, 27),
                    new DateTime(2014, 2, 28),
                    "Allen, TX");
                var conference = DefineConference(
                    community,
                    catalog,
                    "That Conference 2013",
                    "http://www.thatconference.com/Images/mainLogo.png",
                    new DateTime(2013, 8, 16),
                    new DateTime(2013, 8, 19),
                    "Wisconsin Dells, WI");
                DefineConferenceSessions(community, conference);
            }

            Func<ConferenceHeader, ConferenceHeaderViewModel> makeConferenceHeaderViewModel =
                conferenceHeader =>
                    new ConferenceHeaderViewModel(conferenceHeader);

            return new ConferenceListViewModel(catalog, conferenceSelection, makeConferenceHeaderViewModel);
        }
开发者ID:michaellperry,项目名称:MyCon,代码行数:39,代码来源:ConferenceViewModelFactory.cs

示例4: DefineConferenceSessions

        private static void DefineConferenceSessions(ICommunity community, Conference conference)
        {
            var developer = community.AddFact(new Track(conference));
            developer.Name = "Developer";

            var michael = community.AddFact(new Speaker(conference));
            michael.Name = "Michael L Perry";
            michael.ImageUrl = "http://qedcode.com/extras/Perry_Headshot_Medium.jpg";
            michael.Contact = "@michaellperry";
            michael.Bio.SetString(
                "Software is math. Michael L Perry has built upon the works of mathematicians like Bertrand Meyer, James Rumbaugh, and Donald Knuth to develop a mathematical system for software development. He has captured this system in a set of open source projects, Update Controls and Correspondence. As a Principal Consultant at Improving Enterprises, he applies mathematical concepts to building scalable and robust enterprise systems. You can find out more at qedcode.com.",
                v => michael.Bio = v,
                community);

            var provable = community.AddFact(new Session(michael));
            provable.Title = "4 Ways to Prevent Code Abuse";
            provable.Description.SetString(
                "Your code is right. Other people are just using it wrong!" +
                "Learn 4 simple techniques to prevent people from using your code incorrectly. We'll apply those techniques to a class in the .NET Framework that is really easy to get wrong. By the time we're done, you'll have to try really hard to mess it up." +
                "Some APIs will throw exceptions when you get something wrong. That's not helpful! I'll show you how to write an API that guides you toward correct code. It won't even compile unless you get it right." +
                "These 4 techniques are built into the C# language today, so take advantage of them! Everybody on your team will thank you. And you'll spend less time fixing their bugs.",
                v => provable.Description = v,
                community);

            community.AddFact(new SessionTrack(provable, developer, new List<SessionTrack>()));

            var eight = community.AddFact(new Time(conference));
            eight.StartTime = new DateTime(2013, 7, 12, 8, 0, 0, DateTimeKind.Local);

            var room100 = community.AddFact(new Room(conference));
            room100.RoomNumber = "100";

            var room100AtEight = community.AddFact(new Slot(eight, room100));

            community.AddFact(new SessionSlot(provable, room100AtEight, new List<SessionSlot>()));
        }
开发者ID:michaellperry,项目名称:MyCon,代码行数:36,代码来源:ConferenceViewModelFactory.cs

示例5: InitializeSite

 //---------------------------------------------------------------------
 protected override void InitializeSite(ActiveSite site,
     ICommunity initialCommunity)
 {
     cohorts[site] = new SiteCohorts(initialCommunity.Cohorts);
 }
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:6,代码来源:PlugIn.cs

示例6: InitializeSite

        //---------------------------------------------------------------------
        protected override void InitializeSite(ActiveSite site,
                                               ICommunity initialCommunity)
        {
            InitialBiomass initialBiomass = InitialBiomass.Compute(site, initialCommunity);
            SiteVars.Cohorts[site] = InitialBiomass.Clone(initialBiomass.Cohorts); //.Clone();

            SiteVars.SurfaceDeadWood[site]       = initialBiomass.SurfaceDeadWood.Clone();
            SiteVars.SurfaceStructural[site]     = initialBiomass.SurfaceStructural.Clone();
            SiteVars.SurfaceMetabolic[site]      = initialBiomass.SurfaceMetabolic.Clone();

            SiteVars.SoilDeadWood[site]          = initialBiomass.SoilDeadWood.Clone();
            SiteVars.SoilStructural[site]        = initialBiomass.SoilStructural.Clone();
            SiteVars.SoilMetabolic[site]         = initialBiomass.SoilMetabolic.Clone();

            SiteVars.SOM1surface[site]           = initialBiomass.SOM1surface.Clone();
            SiteVars.SOM1soil[site]              = initialBiomass.SOM1soil.Clone();
            SiteVars.SOM2[site]                  = initialBiomass.SOM2.Clone();
            SiteVars.SOM3[site]                  = initialBiomass.SOM3.Clone();

            SiteVars.MineralN[site]              = initialBiomass.MineralN;
            SiteVars.CohortLeafC[site]           = initialBiomass.CohortLeafC;
            SiteVars.CohortLeafN[site]           = initialBiomass.CohortLeafN;
            SiteVars.CohortWoodC[site]           = initialBiomass.CohortWoodC;
            SiteVars.CohortWoodN[site]           = initialBiomass.CohortWoodN;
        }
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Succession,代码行数:26,代码来源:PlugIn.cs

示例7: InitializeSite

 //---------------------------------------------------------------------
 protected override void InitializeSite(ActiveSite site,
                                        ICommunity initialCommunity)
 {
     siteconditions[site] = new SiteConditions(site, initialCommunity);
 }
开发者ID:LANDIS-II-Foundation,项目名称:Extension-PnET-Succession,代码行数:6,代码来源:PlugIn.cs

示例8: InitializeSite

 //---------------------------------------------------------------------
 protected override void InitializeSite(ActiveSite site,
     ICommunity initialCommunity)
 {
     InitialBiomass initialBiomass = InitialBiomass.Compute(site, initialCommunity);
     cohorts[site] = initialBiomass.Cohorts.Clone();
     Dead.Pools.Woody[site] = initialBiomass.DeadWoodyPool;
     Dead.Pools.NonWoody[site] = initialBiomass.DeadNonWoodyPool;
 }
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:9,代码来源:PlugIn.cs

示例9: InitializeSite

        //---------------------------------------------------------------------
        protected override void InitializeSite(ActiveSite site,
                                               ICommunity initialCommunity)
        {
            InitialBiomass initialBiomass = InitialBiomass.Compute(site, initialCommunity);

            SiteVars.Cohorts[site] = initialBiomass.Cohorts.Clone();
            SiteVars.WoodyDebris[site] = initialBiomass.DeadWoodyPool.Clone();
            SiteVars.Litter[site] = initialBiomass.DeadNonWoodyPool.Clone();
        }
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Succession,代码行数:10,代码来源:PlugIn.cs

示例10: Compute

        //---------------------------------------------------------------------
        /// <summary>
        /// Computes the initial biomass at a site.
        /// </summary>
        /// <param name="site">
        /// The selected site.
        /// </param>
        /// <param name="initialCommunity">
        /// The initial community of age cohorts at the site.
        /// </param>
        public static InitialBiomass Compute(ActiveSite site,
            ICommunity initialCommunity)
        {
            IEcoregion ecoregion = Model.Core.Ecoregion[site];
            uint key = ComputeKey(initialCommunity.MapCode, ecoregion.MapCode);
            InitialBiomass initialBiomass;
            if (initialSites.TryGetValue(key, out initialBiomass))
                return initialBiomass;

            //  If we don't have a sorted list of age cohorts for the initial
            //  community, make the list
            List<AgeCohort.ICohort> sortedAgeCohorts;
            if (! sortedCohorts.TryGetValue(initialCommunity.MapCode, out sortedAgeCohorts)) {
                sortedAgeCohorts = SortCohorts(initialCommunity.Cohorts);
                sortedCohorts[initialCommunity.MapCode] = sortedAgeCohorts;
            }

            SiteCohorts cohorts = MakeBiomassCohorts(sortedAgeCohorts, site);
            initialBiomass = new InitialBiomass(cohorts,
                                                Dead.Pools.Woody[site],
                                                Dead.Pools.NonWoody[site]);
            initialSites[key] = initialBiomass;
            return initialBiomass;
        }
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:34,代码来源:InitialBiomass.cs

示例11: InitializeSite

 //---------------------------------------------------------------------
 protected override void InitializeSite(ActiveSite site,
     ICommunity initialCommunity)
 {
     SiteVars.Cohorts[site] = new SiteCohorts(initialCommunity.Cohorts);
     /*if (SiteVars.Cohorts[site].HasAge())
     {
         //UI.WriteLine("System Error");
         throw new System.InvalidOperationException("Incompatible extensions given in the scenario file:  Age data required for this extension to operate.");
     }*/
 }
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:11,代码来源:PlugIn.cs

示例12: InitializeSite

        protected override void InitializeSite(ActiveSite site,
                                               ICommunity initialCommunity)
        {
            if (m == null)
            {
                m = new MyClock(PlugIn.ModelCore.Landscape.ActiveSiteCount);
            }

            m.Next();
            m.WriteUpdate();

            //float EstimatedTotalTime = (float)(100.0 / Percentage * (sw.ElapsedMilliseconds / 1000.0));
            //Console.Write("\rInitialization progress {0}% Elapsed time {1} Estimated total time {2}   ", System.String.Format("{0:0.00}", Percentage), Math.Round(sw.ElapsedMilliseconds / 1000F, 0), Math.Round(EstimatedTotalTime, 0));

            SiteCohorts identicalsitecohort = GetFromKey(initialCommunity.MapCode, PlugIn.ModelCore.Ecoregion[site].MapCode, site);

            // Create new sitecohorts
            if(SiteOutputNames.ContainsKey(site))
            {
                sitecohorts[site] = new SiteCohorts(StartDate,
                                                   site,
                                                   initialCommunity,
                                                    SiteOutputNames[site]);

            }
            else if (identicalsitecohort != null)
            {
                // Copy existing site data
                sitecohorts[site] = new SiteCohorts(identicalsitecohort, site);
            }
            // Create new sitecohorts
            else
            {
                sitecohorts[site] = new SiteCohorts(StartDate,
                                                    site,
                                                    initialCommunity);

            }
            CanopyLAImax[site] = sitecohorts[site].CanopyLAImax;
            WoodyDebris[site] = sitecohorts[site].WoodyDebris;
            Litter[site] = sitecohorts[site].Litter;
            SubCanopyParMaxGrowingSeason[site] = sitecohorts[site].SubCanopyParMAX;
            WaterMaxGrowingSeason[site] = sitecohorts[site].WaterMAX;
        }
开发者ID:LANDIS-II-Foundation,项目名称:Extension-PnET-Succession,代码行数:44,代码来源:PlugIn.cs

示例13: ComputeInitialBiomass

        //---------------------------------------------------------------------
        /// <summary>
        /// Computes the initial biomass at a site.
        /// </summary>
        /// <param name="site">
        /// The selected site.
        /// </param>
        /// <param name="initialCommunity">
        /// The initial community of age cohorts at the site.
        /// </param>
        public static InitialBiomass ComputeInitialBiomass(ActiveSite site,
                                             ICommunity initialCommunity)
        {
            InitialBiomass initialBiomass;

            IEcoregion ecoregion = PlugIn.ModelCore.Ecoregion[site];
            uint key = ComputeKey(initialCommunity.MapCode, ecoregion.MapCode);

            if (initialSites.TryGetValue(key, out initialBiomass) && HasSiteOutput[site]==false)
            {
                CanopyBiomass.CanopyLAImax[site] = initialBiomass.canopylaimax;
                CanopyBiomass.CanopyLAI[site] = initialBiomass.canopylai;
                Hydrology.Water[site] = initialBiomass.water;
                Hydrology.AnnualTranspiration[site] = initialBiomass.annualtrans;
                CanopyBiomass.SubCanopyPAR[site] = initialBiomass.subcanopypar;
                return initialBiomass;
            }

            //  If we don't have a sorted list of age cohorts for the initial
            //  community, make the list

            List<Landis.Library.AgeOnlyCohorts.ICohort> sortedAgeCohorts;
            if (!sortedCohorts.TryGetValue(initialCommunity.MapCode, out sortedAgeCohorts))
            {
                sortedAgeCohorts = PlugIn.RankCohortAgesOldToYoung(initialCommunity.Cohorts);
                sortedCohorts[initialCommunity.MapCode] = sortedAgeCohorts;
            }

            if (sortedAgeCohorts.Count == 0) return null;

            ISiteCohorts cohorts = MakeBiomassCohorts(sortedAgeCohorts, site);

            initialBiomass = new InitialBiomass(cohorts,
                                                ForestFloor.WoodyDebris[site],
                                                ForestFloor.Litter[site],
                                                Hydrology.Water[site],
                                                Hydrology.AnnualTranspiration[site],
                                                CanopyBiomass.CanopyLAI[site],
                                                CanopyBiomass.CanopyLAImax[site],
                                                CanopyBiomass.SubCanopyPAR[site]);

            initialSites[key] = initialBiomass;
            return initialBiomass;
        }
开发者ID:LANDIS-II-Foundation,项目名称:Extension-PnET-Succession,代码行数:54,代码来源:InitialBiomass.cs

示例14: Add

        //---------------------------------------------------------------------

        public void Add(ICommunity community)
        {
            communities.Add(community.MapCode, community);
        }
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:6,代码来源:Dataset.cs

示例15: InitializeSite

        //---------------------------------------------------------------------

        protected override void InitializeSite(ActiveSite site,
                                               ICommunity initialCommunity)
        {
        }
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:6,代码来源:NullSuccession.cs


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