本文整理汇总了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);
}
示例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();
}
示例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;
}