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


C# ISiteVar类代码示例

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


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

示例1: Initialize

        //private static ISiteVar<Landis.Library.Biomass.Species.AuxParm<double>> defoliation; // Defoliation per site per species

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

        public static void Initialize()
        {
            //defoliation = PlugIn.ModelCore.Landscape.NewSiteVar<Landis.Library.Biomass.Species.AuxParm<double>>();

            outbreakVariables       = PlugIn.ModelCore.Landscape.NewSiteVar<Outbreak>();
            timeOfLastEvent         = PlugIn.ModelCore.Landscape.NewSiteVar<int>();
            //biomassRemoved          = PlugIn.ModelCore.Landscape.NewSiteVar<int>();
             
            //initialOutbreakProb     = PlugIn.ModelCore.Landscape.NewSiteVar<double>();
            cohorts                 = PlugIn.ModelCore.GetSiteVar<ISiteCohorts>("Succession.BiomassCohorts");
            if (cohorts == null)
            {
                cohorts = PlugIn.ModelCore.GetSiteVar<ISiteCohorts>("Succession.LeafBiomassCohorts");
            
            }
            
            cohortsPartiallyDamaged = PlugIn.ModelCore.Landscape.NewSiteVar<int>();
            
            SiteVars.TimeOfLastEvent.ActiveSiteValues = -10000;
            //SiteVars.InitialOutbreakProb.ActiveSiteValues = 0.0;

            //Initialize outbreaks:
            foreach (ActiveSite site in PlugIn.ModelCore.Landscape)
            {
                SiteVars.OutbreakVars = null;
            }

            if (cohorts == null)
            {
                string mesg = string.Format("Cohorts are empty.  Please double-check that this extension is compatible with your chosen succession extension.");
                throw new System.ApplicationException(mesg);
            }
            //PlugIn.ModelCore.RegisterSiteVar(defoliation, "Insect.Defoliation");

        }
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:39,代码来源:SiteVars.cs

示例2: Initialize

        //private static BaseCohortsSiteVar baseCohortsSiteVar;
        //---------------------------------------------------------------------
        public static void Initialize()
        {
            cohorts = PlugIn.ModelCore.Landscape.NewSiteVar<SiteCohorts>();

            ISiteVar<Landis.Library.AgeOnlyCohorts.ISiteCohorts> baseCohorts = Landis.Library.Succession.CohortSiteVar<Landis.Library.AgeOnlyCohorts.ISiteCohorts>.Wrap(cohorts);

            PlugIn.ModelCore.RegisterSiteVar(baseCohorts, "Succession.AgeCohorts");
        }
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:10,代码来源:SiteVars.cs

示例3: Initialize

        //private static ISiteVar<Library.AgeOnlyCohorts.SiteCohorts> baseCohorts;
        //private static BaseCohortsSiteVar baseCohortsSiteVar;
        //---------------------------------------------------------------------
        public static void Initialize()
        {
            cohorts = PlugIn.ModelCore.Landscape.NewSiteVar<ISiteCohorts>();
            //baseCohortsSiteVar = new BaseCohortsSiteVar(cohorts);

            //PlugIn.ModelCore.RegisterSiteVar(baseCohortsSiteVar, "Succession.AgeOnlyCohorts");
            PlugIn.ModelCore.RegisterSiteVar(cohorts, "Succession.AgeCohorts");
        }
开发者ID:YongLuo007,项目名称:Extensions-Succession,代码行数:11,代码来源:SiteVars.cs

示例4: Initialize

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

        public static void Initialize()
        {
            outbreakVariables       = Model.Core.Landscape.NewSiteVar<Outbreak>();
            timeOfLastEvent         = Model.Core.Landscape.NewSiteVar<int>();
            biomassRemoved = Model.Core.Landscape.NewSiteVar<int>();
            neighborhoodDefoliation = Model.Core.Landscape.NewSiteVar<double>();
            initialOutbreakProb     = Model.Core.Landscape.NewSiteVar<double>();

            //Model.Core.RegisterSiteVar(SiteVars.DefoliationByYear, "Insect.GrowthReduction");
            Model.Core.GetSiteVar(SiteVars.WoodyDebris, "Succession.WoodyDebris");

            SiteVars.NeighborhoodDefoliation.ActiveSiteValues = 0.0;
            SiteVars.TimeOfLastEvent.ActiveSiteValues = -10000;
            SiteVars.InitialOutbreakProb.ActiveSiteValues = 0.0;
            //SiteVars.SumLastDefoliation.ActiveSiteValues = 0.0;
            //SiteVars.Disturbed.ActiveSiteValues = false;

            //Initialize outbreaks:
            foreach (ActiveSite site in Model.Core.Landscape)
            {
                SiteVars.OutbreakVars = null; //new Outbreak();
                //SiteVars.DefoliationByYear[site] = new Dictionary<int, double>();
            }


        }
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Disturbance,代码行数:28,代码来源:SiteVars.cs

示例5: Initialize

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

        public static void Initialize(ILandscapeCohorts cohorts)
        {
            //eventVar       = Model.Core.Landscape.NewSiteVar<Epidemic>(InactiveSiteMode.DistinctValues);
            timeOfLastBDA  = Model.Core.Landscape.NewSiteVar<int>();
            neighborResourceDom = Model.Core.Landscape.NewSiteVar<double>();
            siteResourceDomMod  = Model.Core.Landscape.NewSiteVar<double>();
            siteResourceDom     = Model.Core.Landscape.NewSiteVar<double>();
            vulnerability       = Model.Core.Landscape.NewSiteVar<double>();
            disturbed           = Model.Core.Landscape.NewSiteVar<bool>();
            //numberCFSconifersKilled = Model.Core.Landscape.NewSiteVar<int[]>();
            numberCFSconifersKilled = Model.Core.Landscape.NewSiteVar<Dictionary<int,int>>();
            
            SiteVars.TimeOfLastEvent.ActiveSiteValues = -10000;
            SiteVars.NeighborResourceDom.ActiveSiteValues = 0.0;
            SiteVars.SiteResourceDomMod.ActiveSiteValues = 0.0;
            SiteVars.SiteResourceDom.ActiveSiteValues = 0.0;
            SiteVars.Vulnerability.ActiveSiteValues = 0.0;
            
            foreach(ActiveSite site in Model.Core.Landscape)
                //SiteVars.NumberCFSconifersKilled[site] = new int[Model.Core.EndTime - Model.Core.StartTime + 1];
                SiteVars.NumberCFSconifersKilled[site] = new Dictionary<int, int>();
            
            // Added for v1.1 to enable interactions with CFS fuels extension.
            Model.Core.RegisterSiteVar(SiteVars.NumberCFSconifersKilled, "BDA.NumCFSConifers");
            Model.Core.RegisterSiteVar(SiteVars.TimeOfLastEvent, "BDA.TimeOfLastEvent");

        }
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:29,代码来源:SiteVars.cs

示例6: Initialize

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

        public static void Initialize()
        {
            eventVar        = Model.Core.Landscape.NewSiteVar<Event>(InactiveSiteMode.DistinctValues);
            timeOfLastEvent = Model.Core.Landscape.NewSiteVar<int>();
            severity        = Model.Core.Landscape.NewSiteVar<byte>();
            disturbed      = Model.Core.Landscape.NewSiteVar<bool>();
        }
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:9,代码来源:SiteVars.cs

示例7: Initialize

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

        public static void Initialize(ICore modelCore)
        {
            timeOfLastBDA = modelCore.Landscape.NewSiteVar<int>();
            neighborResourceDom = modelCore.Landscape.NewSiteVar<double>();
            siteResourceDomMod = modelCore.Landscape.NewSiteVar<double>();
            siteResourceDom = modelCore.Landscape.NewSiteVar<double>();
            vulnerability = modelCore.Landscape.NewSiteVar<double>();
            disturbed = modelCore.Landscape.NewSiteVar<bool>();
            numberCFSconifersKilled = modelCore.Landscape.NewSiteVar<Dictionary<int, int>>();
            timeOfNext = modelCore.Landscape.NewSiteVar<int>();

            SiteVars.TimeOfLastEvent.ActiveSiteValues = -10000;
            SiteVars.NeighborResourceDom.ActiveSiteValues = 0.0;
            SiteVars.SiteResourceDomMod.ActiveSiteValues = 0.0;
            SiteVars.SiteResourceDom.ActiveSiteValues = 0.0;
            SiteVars.Vulnerability.ActiveSiteValues = 0.0;
            SiteVars.TimeOfNext.ActiveSiteValues = 9999;

            cohorts = PlugIn.ModelCore.GetSiteVar<ISiteCohorts>("Succession.AgeCohorts");
            

            foreach (ActiveSite site in modelCore.Landscape)
                SiteVars.NumberCFSconifersKilled[site] = new Dictionary<int, int>();

            // Added for v1.1 to enable interactions with CFS fuels extension.
            modelCore.RegisterSiteVar(SiteVars.NumberCFSconifersKilled, "BDA.NumCFSConifers");
            modelCore.RegisterSiteVar(SiteVars.TimeOfLastEvent, "BDA.TimeOfLastEvent");

            //foreach (IAgent activeAgent in manyAgentParameters)
            //{
            //    string varName = activeAgent.AgentName + ".TimeToNext";
            //    modelCore.RegisterSiteVar(SiteVars.TimeToNext, varName);
            //}
            modelCore.RegisterSiteVar(SiteVars.TimeOfNext, "BDA.TimeOfNext");
        }
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Disturbance,代码行数:37,代码来源:SiteVars.cs

示例8: Initialize

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

        public static void Initialize()
        {
            mgmtAreas     = Model.Core.Landscape.NewSiteVar<ManagementArea>();
            stands        = Model.Core.Landscape.NewSiteVar<Stand>();
            prescriptions = Model.Core.Landscape.NewSiteVar<Prescription>();
            cohortsKilled = Model.Core.Landscape.NewSiteVar<int>();
        }
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Disturbance,代码行数:9,代码来源:SiteVars.cs

示例9: Initialize

 //---------------------------------------------------------------------
 public static void Initialize(ICore modelCore)
 {
     landUse = modelCore.Landscape.NewSiteVar<LandUse>();
     allowHarvest = new AllowHarvestSiteVar();
     Model.Core.RegisterSiteVar(allowHarvest, "LandUse.AllowHarvest");
     Landis.Library.BiomassHarvest.SiteVars.CohortsPartiallyDamaged = modelCore.Landscape.NewSiteVar<int>();
 }
开发者ID:LANDIS-II-Foundation,项目名称:Extension-Land-Use-Change,代码行数:8,代码来源:SiteVars.cs

示例10: Initialize

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

        public static void Initialize()
        {
            outbreakVariables       = PlugIn.ModelCore.Landscape.NewSiteVar<Outbreak>();
            timeOfLastEvent         = PlugIn.ModelCore.Landscape.NewSiteVar<int>();
            biomassRemoved          = PlugIn.ModelCore.Landscape.NewSiteVar<int>();
            //neighborhoodDefoliation = PlugIn.ModelCore.Landscape.NewSiteVar<double>();
            initialOutbreakProb     = PlugIn.ModelCore.Landscape.NewSiteVar<double>();
            cohorts                 = PlugIn.ModelCore.GetSiteVar<ISiteCohorts>("Succession.BiomassCohorts");
            cohortsPartiallyDamaged = PlugIn.ModelCore.Landscape.NewSiteVar<int>();
            insectName = PlugIn.ModelCore.Landscape.NewSiteVar<string>();

            //SiteVars.NeighborhoodDefoliation.ActiveSiteValues = 0.0;
            SiteVars.TimeOfLastEvent.ActiveSiteValues = -10000;
            SiteVars.InitialOutbreakProb.ActiveSiteValues = 0.0;
            SiteVars.InsectName.ActiveSiteValues = "";

            //Initialize outbreaks:
            foreach (ActiveSite site in PlugIn.ModelCore.Landscape)
            {
                SiteVars.OutbreakVars = null; //new Outbreak();
            }

            if (cohorts == null)
            {
                string mesg = string.Format("Cohorts are empty.  Please double-check that this extension is compatible with your chosen succession extension.");
                throw new System.ApplicationException(mesg);
            }

            PlugIn.ModelCore.RegisterSiteVar(SiteVars.TimeOfLastEvent, "BiomassInsects.TimeOfLastEvent");
            PlugIn.ModelCore.RegisterSiteVar(SiteVars.InsectName, "BiomassInsects.InsectName");

        }
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:34,代码来源:SiteVars.cs

示例11: Initialize

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

        public static void Initialize(ICore modelCore)
        {
            timeOfLastBDA  = modelCore.Landscape.NewSiteVar<int>();
            neighborResourceDom = modelCore.Landscape.NewSiteVar<double>();
            siteResourceDomMod = modelCore.Landscape.NewSiteVar<double>();
            siteResourceDom = modelCore.Landscape.NewSiteVar<double>();
            vulnerability = modelCore.Landscape.NewSiteVar<double>();
            disturbed = modelCore.Landscape.NewSiteVar<bool>();
            numberCFSconifersKilled = modelCore.Landscape.NewSiteVar<Dictionary<int, int>>();
            timeOfNext = modelCore.Landscape.NewSiteVar<int>();
            agentName = modelCore.Landscape.NewSiteVar<string>();
            biomassInsectsAgent = modelCore.Landscape.NewSiteVar<string>();


            SiteVars.TimeOfLastEvent.ActiveSiteValues = -10000;
            SiteVars.NeighborResourceDom.ActiveSiteValues = 0.0;
            SiteVars.SiteResourceDomMod.ActiveSiteValues = 0.0;
            SiteVars.SiteResourceDom.ActiveSiteValues = 0.0;
            SiteVars.Vulnerability.ActiveSiteValues = 0.0;
            SiteVars.TimeOfNext.ActiveSiteValues = 9999;
            SiteVars.AgentName.ActiveSiteValues = "";

            cohorts = PlugIn.ModelCore.GetSiteVar<ISiteCohorts>("Succession.AgeCohorts");

            foreach(ActiveSite site in modelCore.Landscape)
                SiteVars.NumberCFSconifersKilled[site] = new Dictionary<int, int>();

            // Added for v1.1 to enable interactions with CFS fuels extension.
            modelCore.RegisterSiteVar(SiteVars.NumberCFSconifersKilled, "BDA.NumCFSConifers");
            modelCore.RegisterSiteVar(SiteVars.TimeOfLastEvent, "BDA.TimeOfLastEvent");
            modelCore.RegisterSiteVar(SiteVars.AgentName, "BDA.AgentName");
            // Added to enable interactions with other extensions (Presalvage harvest)
            modelCore.RegisterSiteVar(SiteVars.TimeOfNext, "BDA.TimeOfNext");

        }
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:37,代码来源:SiteVars.cs

示例12: Initialize

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

        public static void Initialize()
        {

            fuelType     = Model.Core.Landscape.NewSiteVar<int>();
            decidFuelType   = Model.Core.Landscape.NewSiteVar<int>();
            percentConifer  = Model.Core.Landscape.NewSiteVar<int>();
            percentHardwood = Model.Core.Landscape.NewSiteVar<int>();
            percentDeadFir  = Model.Core.Landscape.NewSiteVar<int>();
            
            timeOfLastHarvest       = Model.Core.GetSiteVar<int>("Harvest.TimeOfLastEvent");
            harvestPrescriptionName = Model.Core.GetSiteVar<string>("Harvest.PrescriptionName");
            harvestCohortsKilled    = Model.Core.GetSiteVar<int>("Harvest.CohortsDamaged");
            
            timeOfLastFire          = Model.Core.GetSiteVar<int>("Fire.TimeOfLastEvent");
            fireSeverity            = Model.Core.GetSiteVar<byte>("Fire.Severity");
            
            timeOfLastWind          = Model.Core.GetSiteVar<int>("Wind.TimeOfLastEvent");
            windSeverity            = Model.Core.GetSiteVar<byte>("Wind.Severity");
            
            numberDeadFirCohorts    = Model.Core.GetSiteVar<Dictionary<int,int>>("BDA.NumCFSConifers");

            Model.Core.RegisterSiteVar(SiteVars.FuelType, "Fuels.CFSFuelType");
            Model.Core.RegisterSiteVar(SiteVars.DecidFuelType, "Fuels.DecidFuelType");
            Model.Core.RegisterSiteVar(SiteVars.PercentConifer, "Fuels.PercentConifer");
            Model.Core.RegisterSiteVar(SiteVars.PercentHardwood, "Fuels.PercentHardwood");
            Model.Core.RegisterSiteVar(SiteVars.PercentDeadFir, "Fuels.PercentDeadFir");
        }
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:29,代码来源:SiteVars.cs

示例13: Initialize

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

        public static void Initialize()
        {

            outbreakVariables       = PlugIn.ModelCore.Landscape.NewSiteVar<Outbreak>();
            timeOfLastEvent         = PlugIn.ModelCore.Landscape.NewSiteVar<int>();

            cohorts = PlugIn.ModelCore.GetSiteVar<ISiteCohorts>("Succession.BiomassCohorts");

            
            cohortsPartiallyDamaged = PlugIn.ModelCore.Landscape.NewSiteVar<int>();
            
            SiteVars.TimeOfLastEvent.ActiveSiteValues = -10000;

            //Initialize outbreaks:
            foreach (ActiveSite site in PlugIn.ModelCore.Landscape)
            {
                SiteVars.OutbreakVars = null;
            }

            if (cohorts == null)
            {
                string mesg = string.Format("Cohorts are empty.  Please double-check that this extension is compatible with your chosen succession extension.");
                throw new System.ApplicationException(mesg);
            }

        }
开发者ID:LANDIS-II-Foundation,项目名称:Extensions-Disturbance,代码行数:28,代码来源:SiteVars.cs

示例14: Initialize

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

        public static void Initialize(ICore modelCore)
        {
            core = modelCore;
            modelCore.Log.WriteLine("Inside Initialize method !!!");
            ecoregions     = modelCore.Landscape.NewSiteVar<IFireRegion>();
            eventVar       = modelCore.Landscape.NewSiteVar<Event>(InactiveSiteMode.DistinctValues);
            timeOfLastFire = modelCore.Landscape.NewSiteVar<int>();
            severity = modelCore.Landscape.NewSiteVar<byte>();
            disturbed = modelCore.Landscape.NewSiteVar<bool>();

            cohorts = modelCore.GetSiteVar<SiteCohorts>("Succession.Cohorts");
            
            // Enable interactions with (almost) any fire extension:
            modelCore.RegisterSiteVar(SiteVars.Severity, "Fire.Severity");
            

            //Initialize TimeSinceLastFire to the maximum cohort age:
            foreach (ActiveSite site in modelCore.Landscape) 
            {
                // Test to make sure the cohort type is correct for this extension
                if (site.Location.Row == 1 && site.Location.Column == 1 && !SiteVars.Cohorts[site].HasAge())
                {
                    throw new System.ApplicationException("Error in the Scenario file:  Incompatible extensions; Cohort age data required for this extension to operate.");
                }

                //UI.WriteLine("Inside foreach loop.  Site R/C = {0}/{1} !!!", site.Location.Row, site.Location.Column);
                ushort maxAge = Library.BaseCohorts.Util.GetMaxAge(cohorts[site]);
                //ushort maxAge = Library.Cohort.AgeOnly.Util.GetMaxAge(SiteVars.Cohorts[site]);
                //UI.WriteLine("Assigned maxAge");
                timeOfLastFire[site] = modelCore.StartTime - maxAge;
            }
        }
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:34,代码来源:SiteVars.cs

示例15: InitializeTimeOfLastDisturbances

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

        public static void InitializeTimeOfLastDisturbances()
        {
            timeOfLastWind  = Model.Core.GetSiteVar<int>("Wind.TimeOfLastEvent");
            timeOfLastFire  = Model.Core.GetSiteVar<int>("Fire.TimeOfLastEvent");
            timeOfLastHarvest  = Model.Core.GetSiteVar<int>("Harvest.TimeOfLastEvent");

        }
开发者ID:pjbitterman,项目名称:Extensions-Disturbance,代码行数:9,代码来源:SiteVars.cs


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