Demos

Defining the Project object

We start by defining the Project object.

using ProjectManagement

proj = Project(
    (
        start=0,
        short = PertBeta(0,1,2),
        long = PertBeta(10,20,200),
        finish=0,
    ),
    [
        :start .=> [:short, :long];
        [:short, :long] .=> :finish;
    ]
)
Project{NamedTuple{(:start, :short, :long, :finish), Tuple{Int64, PertBeta{Int64}, PertBeta{Int64}, Int64}}}((start = 0, short = PertBeta{Int64}(a=0, b=1, c=2), long = PertBeta{Int64}(a=10, b=20, c=200), finish = 0), [:start => :short, :start => :long, :short => :finish, :long => :finish])

Visualizing the PERT Chart

visualize_chart(proj; fontsize=4)
finish0 long(10|20|200)48.33 short(0|1|2)1.0 start0

Critical Path

We can compute the critical path and it's cost using the critical_path function.

critical_path(proj)
[:start, :long, :finish] => 48.333333333333336

We can compute all the path costs using path_durations. For example we can find the critical path and near critical paths as:

path_durations(proj)[1:min(3, end)]
2-element Vector{Pair{Vector{Symbol}, Float64}}:
  [:start, :long, :finish] => 48.333333333333336
 [:start, :short, :finish] => 1.0

Sampling Durations

Using that Project object we can sample possible durations of the project. Which allows for statistical analysis of possible outcomes.

julia> using Statistics

julia> duration_samples = rand(proj, 100_000);

julia> mean(duration_samples)
48.32665999733135

julia> minimum(duration_samples)
10.00249966677821

julia> quantile(duration_samples, 0.25)
25.396527495050762

julia> median(duration_samples)
41.86490990506205

julia> quantile(duration_samples, 0.75)
65.03962398127359

julia> maximum(duration_samples)
184.0989430376848

We can plot the distribution showing the probability density function for project completion duration.

density(proj)
Completed By -350 -300 -250 -200 -150 -100 -50 0 50 100 150 200 250 300 350 400 450 500 -300 -280 -260 -240 -220 -200 -180 -160 -140 -120 -100 -80 -60 -40 -20 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360 380 400 420 440 460 -500 0 500 -300 -290 -280 -270 -260 -250 -240 -230 -220 -210 -200 -190 -180 -170 -160 -150 -140 -130 -120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -0.025 -0.020 -0.015 -0.010 -0.005 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 -0.022 -0.020 -0.018 -0.016 -0.014 -0.012 -0.010 -0.008 -0.006 -0.004 -0.002 0.000 0.002 0.004 0.006 0.008 0.010 0.012 0.014 0.016 0.018 0.020 0.022 0.024 0.026 0.028 0.030 0.032 0.034 0.036 0.038 0.040 -0.04 -0.02 0.00 0.02 0.04 -0.020 -0.019 -0.018 -0.017 -0.016 -0.015 -0.014 -0.013 -0.012 -0.011 -0.010 -0.009 -0.008 -0.007 -0.006 -0.005 -0.004 -0.003 -0.002 -0.001 0.000 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.010 0.011 0.012 0.013 0.014 0.015 0.016 0.017 0.018 0.019 0.020 0.021 0.022 0.023 0.024 0.025 0.026 0.027 0.028 0.029 0.030 0.031 0.032 0.033 0.034 0.035 0.036 0.037 0.038 0.039 0.040 0.041 Probability Density Completion Time PDF