Вы находитесь на странице: 1из 3

Monte Carlo Simulation

Programming platform used: Microsoft Visual Studio 2019 Community Edition (Windows Form app using C#)
Additional Packages/Library Used: MathNet.Numerics (NuGet Package) for sampling of various distributions

Program Logic
Import excel sheet & adjust the data, add columns etc

Calculate paths from start till end

Start simulation loop

Get sample values based on the given distribution data (includes parameters conversion)

Calculate durations of each path

Check and fill total project duration

Save critical paths record

Calculate mean and standard deviation of the project duration Part i Result

Calculate and plot CDF of project duration

For a given duration, add function to return the probability that project duration will exceed Part ii Result

For each activity, using simulation data calculate probability if it belongs to critical path Part iii Result

Calculate FF of a given activity for every simulation

Calculate mean and St Dev from the list of free floats

Calculate and plot Free Float CDF Part iv Result

Program Execution: Program can be run from the .exe file present in the bin folder of the project or by debugging
in Visual Studio after importing the project
Program Limitations: Logic to auto calculate paths is incomplete. Paths have been added manually for the given
example. For Part iv, the graph display is not okay ONLY IF all values are zero (No free float). The table on the left
side of display confirms that values are fine and correct, it’s just the graph display limitation.
Result Part i:

Monte Carlo Simulation 1


2

Result Part ii:

Result Part iii:

Result Part iv:

Result Part v:
Result Part v:

Monte Carlo Simulation 2


3
Sample durations from given distribution and parameters Path Durations
Total
Sim. A B C D E F G H I ACFI BDFI BDGI BDH BEH
Dur.
1 14.5 25 44.8 24.4 58.9 26.3 8 24.1 55.6 141 131 113 73.5 108 141.2
2 17.6 29.8 43.2 10.89 47.1 21 19.5 20.5 59.4 141 121 120 61.1 97.4 141.3
3 16.8 16.3 44.9 14.24 63.8 22.2 9.14 14.5 57.4 141 110 97.1 45 94.6 141.3
4 10.1 46.1 46.7 6.92 49 24.5 11.4 25 58.3 140 136 123 78 120 139.6
5 18.5 16.8 45 37.57 34.5 19.9 12 22 62.2 146 137 129 76.4 73.2 145.6
6 10.3 22.7 47.5 2.48 37.8 20.5 15 13 59.2 138 105 99.4 38.1 73.5 137.6
7 7.4 23.8 47.1 15.45 54.7 22.2 12.9 18 60 137 121 112 57.3 96.5 136.7
8 16.1 20 41.7 11.09 47.2 21.6 8.81 9.27 59.9 139 113 99.9 40.4 76.5 139.2
9 12.2 21.5 42.8 15.89 29.5 20.6 9.96 18 64.9 141 123 112 55.4 69 140.5
10 15.1 33.9 42.6 0.87 52.8 24.2 12 23.8 60.7 143 120 107 58.6 111 142.5
11 10.6 16.1 41.9 3.89 48.7 19.8 15.1 12.4 57.9 130 97.7 92.9 32.4 77.2 130.2
12 9.52 17.4 43.7 12.68 42.1 22.7 6.97 20.1 63 139 116 100 50.2 79.6 138.9
13 12.5 17.4 44.1 27.02 57.6 23.6 8.47 8.69 57 137 125 110 53.1 83.7 137.2
14 16.8 29.1 44.5 55.35 53.9 20 7.06 8.01 59.6 141 164 151 92.4 91 164
15 9 22.7 40.9 5.53 36 20.5 8.71 16.1 55.8 126 105 92.7 44.3 74.8 126.2
16 7.68 14.4 45.3 34.92 40.4 21.2 8.77 21.9 62.2 136 133 120 71.2 76.6 136.3
17 9.23 16.1 41 18.11 68.4 19.1 11.8 27.9 62.9 132 116 109 62.1 112 132.2
18 17.6 25.8 41.4 18.06 17.6 23.2 15.9 19.7 53.9 136 121 114 63.5 63.1 136.1
19 16.4 36.9 44.2 2.68 46.6 22 16.4 45.3 64.9 148 127 121 84.9 129 147.5
20 17.7 14.3 42.3 3.45 34.7 19.2 14.3 14.6 60.5 140 97.4 92.5 32.3 63.5 139.7
21 11.5 17.9 44.1 14.41 34.2 22.9 15 14.3 55.1 134 110 103 46.6 66.4 133.6
22 8.1 15.1 42.2 30.28 52.4 22 5.77 18 60.6 133 128 112 63.4 85.5 132.9
23 13.8 33.8 38.9 15.56 44.8 23.2 9.96 30.3 60.3 136 133 120 79.6 109 136.2
24 17 42.3 41.4 3.12 58.4 19.4 19.3 26.5 60.2 138 125 125 71.9 127 138.1
25 7.22 23 46.9 135.3 61.9 18.5 15.6 4.84 58.1 131 235 232 163 89.8 234.8
26 12.3 22.7 43.1 14.56 52.5 22.1 14.6 21.4 58.2 136 118 110 58.7 96.6 135.7
27 12 51.4 40.5 7.07 35 23.1 11.4 11.9 57.8 133 139 128 70.3 98.2 139.4
28 7.08 35.9 46.3 62.8 30.7 21.6 13.6 15.9 61.5 137 182 174 115 82.5 181.8
29 16.6 6.94 46.8 13.01 35 22.4 11.9 34.8 59.1 145 102 91 54.8 76.8 144.9
30 13.1 31.8 48.9 0.08 47 19.7 22.4 14.8 58.3 140 110 113 46.7 93.7 140.1
31 11.9 31.8 41.3 24.67 59.3 23.2 10.4 24.7 62.9 139 143 130 81.2 116 142.6
32 16.3 22.5 44.1 40.45 27.7 20.5 12.6 17.9 57.7 139 141 133 80.8 68 141.2
33 13 28.9 40.2 34.92 57.8 21.1 8.33 19.7 56.9 131 142 129 83.5 106 141.7
34 14 13.5 45.6 24.44 53 21.9 10.8 29.7 56 138 116 105 67.6 96.2 137.6
35 9.64 24.4 42.5 109.6 58.5 22.5 13 10.6 61.8 137 218 209 145 93.5 218.3
36 16.8 26.9 44.6 33.53 41.8 20.8 16.1 27 58.3 140 140 135 87.4 95.7 140.4
37 9.56 26.6 43.9 16.19 53.8 26.3 14.1 14.2 64.7 144 134 122 57 94.6 144.4
38 9.81 23 46 36.46 43.1 21.7 15 21.7 58 135 139 132 81.2 87.8 139.1
39 5.32 15.4 39.2 25.7 36.5 22.2 12.4 7.53 55.7 122 119 109 48.6 59.4 122.4
40 17.3 24 43.3 108.7 48.2 21.8 6.12 13.8 58.6 141 213 197 146 85.9 212.9
41 5.05 17.4 43.1 25.47 52.3 22.3 10.1 16.8 59 129 124 112 59.6 86.5 129.4
42 7.84 22.4 40.6 7.85 46.2 19.4 19.3 11.7 65.8 134 115 115 41.9 80.2 133.6
43 10.6 24.6 44.3 53.52 15.1 20.5 8.03 12.9 56.9 132 156 143 91 52.6 155.5
44 14.7 21.1 44.4 67.57 38.8 21.1 8.55 26.8 58.3 139 168 156 116 86.7 168
45 6.01 30.8 42.1 28.22 23.1 21.9 14.5 11 59.3 129 140 133 70 64.9 140.2
46 8.85 23.8 46.9 23.98 41.8 22.8 9.55 13.2 66.6 145 137 124 61 78.8 145.1
47 7.37 42.2 41.9 67.77 66.1 22.7 9.4 11.3 62.5 135 195 182 121 120 195.1
48 13.7 18.5 48.6 27.43 13.6 24.4 18.6 21.3 57 144 127 122 67.2 53.3 143.7
49 8.27 28.3 45.7 50.59 70.8 22.1 13.1 19.2 58.6 135 160 151 98.1 118 159.6
50 10.9 13.8 43.3 55.63 48.2 23.6 12 17.4 55.2 133 148 137 86.9 79.4 148.2

Monte Carlo Simulation 3

Вам также может понравиться