Demos

Defining the Project object

We start by defining the Project object.

using ProjectManagement

proj = Project(
    (
        start=0,
        a=PertBeta(2,3,4),
        b=PertBeta(1,2,6),
        c=PertBeta(0,1,2),
        d=PertBeta(0,1,2),
        e=PertBeta(0,1,2),
        f=PertBeta(3.0, 6.5, 13.0),
        g=PertBeta(3.5, 7.5, 14.0),
        h=PertBeta(0, 1, 2),
        j=PertBeta(0, 1, 2),
        finish=0,
    ),
    [
        :start .=> [:a, :b, :c, :d];
        :a => :f;
        :b .=> [:f, :g];
        [:c, :d] .=> :e;
        :e .=> [:f, :g, :h];
        [:f, :g, :h] .=> :j;
        :j => :finish;
    ],
)
Project{NamedTuple{(:start, :a, :b, :c, :d, :e, :f, :g, :h, :j, :finish), Tuple{Int64, PertBeta{Int64}, PertBeta{Int64}, PertBeta{Int64}, PertBeta{Int64}, PertBeta{Int64}, PertBeta{Float64}, PertBeta{Float64}, PertBeta{Int64}, PertBeta{Int64}, Int64}}}((start = 0, a = PertBeta{Int64}(a=2, b=3, c=4), b = PertBeta{Int64}(a=1, b=2, c=6), c = PertBeta{Int64}(a=0, b=1, c=2), d = PertBeta{Int64}(a=0, b=1, c=2), e = PertBeta{Int64}(a=0, b=1, c=2), f = PertBeta{Float64}(a=3.0, b=6.5, c=13.0), g = PertBeta{Float64}(a=3.5, b=7.5, c=14.0), h = PertBeta{Int64}(a=0, b=1, c=2), j = PertBeta{Int64}(a=0, b=1, c=2), finish = 0), [:start => :a, :start => :b, :start => :c, :start => :d, :a => :f, :b => :f, :b => :g, :c => :e, :d => :e, :e => :f, :e => :g, :e => :h, :f => :j, :g => :j, :h => :j, :j => :finish])

Visualizing the PERT Chart

visualize_chart(proj; fontsize=2.5)
finish0 j(0|1|2)1.0 h(0|1|2)1.0 g(3.5|7.5|14.0)7.92 f(3.0|6.5|13.0)7.0 e(0|1|2)1.0 d(0|1|2)1.0 c(0|1|2)1.0 b(1|2|6)2.5 a(2|3|4)3.0 start0

Critical Path

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

critical_path(proj)
[:start, :b, :g, :j, :finish] => 11.416666666666668

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)]
3-element Vector{Pair{Vector{Symbol}, Float64}}:
     [:start, :b, :g, :j, :finish] => 11.416666666666668
     [:start, :a, :f, :j, :finish] => 11.0
 [:start, :c, :e, :g, :j, :finish] => 10.916666666666668

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)
12.570106893460276

julia> minimum(duration_samples)
6.827947171700752

julia> quantile(duration_samples, 0.25)
11.2868242774543

julia> median(duration_samples)
12.548466497972012

julia> quantile(duration_samples, 0.75)
13.8257159658889

julia> maximum(duration_samples)
19.70061714518004

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

density(proj)
Completed By -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 -26 -24 -22 -20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 -25 0 25 50 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 -0.26 -0.24 -0.22 -0.20 -0.18 -0.16 -0.14 -0.12 -0.10 -0.08 -0.06 -0.04 -0.02 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.50 -0.25 0.00 0.25 0.50 -0.25 -0.24 -0.23 -0.22 -0.21 -0.20 -0.19 -0.18 -0.17 -0.16 -0.15 -0.14 -0.13 -0.12 -0.11 -0.10 -0.09 -0.08 -0.07 -0.06 -0.05 -0.04 -0.03 -0.02 -0.01 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.50 Probability Density Completion Time PDF