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


C# Config.getValue方法代码示例

本文整理汇总了C#中Config.getValue方法的典型用法代码示例。如果您正苦于以下问题:C# Config.getValue方法的具体用法?C# Config.getValue怎么用?C# Config.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Config的用法示例。


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

示例1: go

        public void go()
        {
            Config config = new Config(projectConfigFileName);
            List<Project> statistics = new List<Project>();
            List<Event> events = EventInitializer.getEvents(config);
            Int32 targetRuns = config.getValue<Int32>("Runs");

            for (int i = 0; i < targetRuns; i++)
            {
                Project p = new Project(config);
                p.possibleEvents = events;

                Simulate(p);
                statistics.Add(p);
            }
            Analyze(statistics);
        }
开发者ID:pmcculler,项目名称:project-sim,代码行数:17,代码来源:Program.cs

示例2: Project

        public Project(Config c)
        {
            config = c;
            name = config.getValue<string>("Project");

            Int32 numWorkers = config.getValue<Int32>("Workers");
            for (int j = 0; j < numWorkers; j++)
                workers.Add(new Worker());
            SetupCommunications();
            SetupWork();
        }
开发者ID:pmcculler,项目名称:project-sim,代码行数:11,代码来源:Project.cs

示例3: getEvents

        public static List<Event> getEvents(Config config)
        {
            EventInitializer.config = config;
            List<Event> events = new List<Event>();
            daysPerYear = config.getValue<int>("Work Days Per Year");
            double baseChanceOfBereavement = config.getValue<double>("Bereavement Chance Per Year");
            double chanceOfBereavement = baseChanceOfBereavement / (double)daysPerYear;
            double baseChanceOfFamilyLeave = config.getValue<double>("Family Chance Per Year");
            double chanceOfFamilyLeave = baseChanceOfFamilyLeave / (double)daysPerYear;
            double baseChanceOfQuit = config.getValue<double>("Quit Chance Per Year");
            double chanceOfQuitLeave = baseChanceOfQuit / (double)daysPerYear;

            events.Add(new AbsenceEvent(eventChance("Sick Days Per Year"), total_absence, "out sick"));
            events.Add(new AbsenceEvent(eventChance("Vacation Days Per Year"), total_absence, "on vacation"));
            events.Add(new AbsenceEvent(eventChance("Extra Holiday Days Per Year"), total_absence, "on holiday"));

            events.Add(new LingeringEvent(chanceOfBereavement, total_absence, "grieving", config.getValue<int>("Bereavement Leave")));
            events.Add(new LingeringEvent(chanceOfFamilyLeave, total_absence, "babysitting", config.getValue<int>("Family Leave")));
            events.Add(new LingeringEvent(chanceOfQuitLeave, total_absence, "terminated", config.getValue<int>("Quit Leave")));

            // other event types:

            // Stress
            // transfers/quits
            return events;
        }
开发者ID:pmcculler,项目名称:project-sim,代码行数:26,代码来源:Project.cs


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