リスク分析ツール
Contents
[
Hide
Show
]リスク分析の実行
.NET APIのAspose.Tasksは、プロジェクトデータファイルでリスク分析の実行をサポートしています。これは、異なる確率分布と相関をサポートするモンテカルロシミュレーションに基づいています。 Aspose.tasks.riskanalysis.riskanalyzerクラスを使用して、プロジェクトスケジュール(タスク期間と開始/終了日)に基づくリスク分析を実行できます。したがって、プロジェクトの終了日は、そのような分析の出力になる可能性があります。次の例は、この機能を段階的に示しています。
リスク分析の実行
分析設定の準備
1RiskAnalysisSettings settings = new RiskAnalysisSettings();
2
3// Set number of iterations for Monte Carlo simulation (the default value is 100).
4settings.IterationsCount = 200;
Identifying the Input of Analysis
1Project project = new Project("New Project.mpp");
2Task task = project.RootTask.Children.GetById(17);
3
4// Initialize a risk pattern
5RiskPattern pattern = new RiskPattern(task);
6
7// Select a distribution type for the random number generator to generate possible values from (only two types currently supported, namely normal and uniform)
8// For more details see here: https://en.wikipedia.org/wiki/Normal_distribution)
9pattern.Distribution = ProbabilityDistributionType.Normal;
10
11// Set the percentage of the most likely task duration which can happen in the best possible project scenario
12// The default value is 75, which means that if the estimated specified task duration is 4 days then the optimistic duration will be 3 days
13pattern.Optimistic = 70;
14
15// Set the percentage of the most likely task duration which can happen in the worst possible project scenario
16// The default value is 125, which means that if the estimated specified task duration is 4 days then the pessimistic duration will be 5 days.
17pattern.Pessimistic = 130;
18
19// Set a confidence level that correspond to the percentage of the time the actual values will be within optimistic and pessimistic estimates.
20// You can think of it as a value of standard deviation: the more uncertain about your estimates you are, the more the value of standard deviation used in random number generator is
21pattern.ConfidenceLevel = ConfidenceLevel.CL75;
22
23settings.Patterns.Add(pattern);
1// Analyze the project risks
2RiskAnalyzer analyzer = new RiskAnalyzer(settings);
3RiskAnalysisResult analysisResult = analyzer.Analyze(project);
Use the Results of the Analysis
1// Select the desired output (here we get early finish of the root task)
2RiskItemStatistics rootEarlyFinish = analysisResult.GetRiskItems(RiskItemType.EarlyFinish).Get(project.RootTask);
3Console.WriteLine("Expected value: {0}", rootEarlyFinish.ExpectedValue);
4Console.WriteLine("StandardDeviation: {0}", rootEarlyFinish.StandardDeviation);
5Console.WriteLine("10% Percentile: {0}", rootEarlyFinish.GetPercentile(10));
6Console.WriteLine("50% Percentile: {0}", rootEarlyFinish.GetPercentile(50));
7Console.WriteLine("90% Percentile: {0}", rootEarlyFinish.GetPercentile(90));
8Console.WriteLine("Minimum: {0}", rootEarlyFinish.Minimum);
9Console.WriteLine("Maximum: {0}", rootEarlyFinish.Maximum);
10analysisResult.SaveReport("AnalysisReport_out.pdf");
結論
Aspose.Tasks for .NET のリスク分析機能を使用すると、モンテカルロ法によってタスク期間の変動をシミュレーションし、プロジェクトスケジュールにおける不確実性を評価することができます。確率分布、タスク間の相関関係、分析設定などの入力パラメーターを構成することで、RiskAnalyzer
クラスはプロジェクトの終了日などの結果を予測できます。
この機能は、スケジュールリスクの定量的な分析が求められるプロジェクト計画ワークフローへの統合を目的としています。分析結果は、プロジェクトの意思決定を支援したり、スケジュールの信頼性に最も影響を与える可能性の高いタスクを特定したりするために活用できます。