Demos

Defining the Project object

We start by defining the Project object.

using ProjectManagement

proj = Project(
    (
        start=0,
        a=PertBeta(1,2,3),
        b=PertBeta(10,20,30),
        c=PertBeta(100,200,600),
        finish=0,
    ),
    [
        :start => :a,
        :a => :b,
        :b => :c,
        :c => :finish,
    ]
)
Project{NamedTuple{(:start, :a, :b, :c, :finish), Tuple{Int64, PertBeta{Int64}, PertBeta{Int64}, PertBeta{Int64}, Int64}}}((start = 0, a = PertBeta{Int64}(a=1, b=2, c=3), b = PertBeta{Int64}(a=10, b=20, c=30), c = PertBeta{Int64}(a=100, b=200, c=600), finish = 0), [:start => :a, :a => :b, :b => :c, :c => :finish])

Visualizing the PERT Chart

visualize_chart(proj; fontsize=2.5)
finish0 c(100|200|600)250.0 b(10|20|30)20.0 a(1|2|3)2.0 start0

Critical Path

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

critical_path(proj)
[:start, :a, :b, :c, :finish] => 272.0

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)]
1-element Vector{Pair{Vector{Symbol}, Float64}}:
 [:start, :a, :b, :c, :finish] => 272.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)
271.59251855374004

julia> minimum(duration_samples)
116.03929534859233

julia> quantile(duration_samples, 0.25)
203.15117340935035

julia> median(duration_samples)
259.99645325798554

julia> quantile(duration_samples, 0.75)
328.38162798881655

julia> maximum(duration_samples)
598.5577531944376

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

density(proj)
Completed By -1000 -800 -600 -400 -200 0 200 400 600 800 1000 1200 1400 1600 1800 -800 -750 -700 -650 -600 -550 -500 -450 -400 -350 -300 -250 -200 -150 -100 -50 0 50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950 1000 1050 1100 1150 1200 1250 1300 1350 1400 1450 1500 1550 1600 -1000 0 1000 2000 -800 -750 -700 -650 -600 -550 -500 -450 -400 -350 -300 -250 -200 -150 -100 -50 0 50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950 1000 1050 1100 1150 1200 1250 1300 1350 1400 1450 1500 1550 1600 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.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.0050 -0.0045 -0.0040 -0.0035 -0.0030 -0.0025 -0.0020 -0.0015 -0.0010 -0.0005 0.0000 0.0005 0.0010 0.0015 0.0020 0.0025 0.0030 0.0035 0.0040 0.0045 0.0050 0.0055 0.0060 0.0065 0.0070 0.0075 0.0080 0.0085 0.0090 0.0095 0.0100 -0.010 -0.005 0.000 0.005 0.010 -0.0050 -0.0048 -0.0046 -0.0044 -0.0042 -0.0040 -0.0038 -0.0036 -0.0034 -0.0032 -0.0030 -0.0028 -0.0026 -0.0024 -0.0022 -0.0020 -0.0018 -0.0016 -0.0014 -0.0012 -0.0010 -0.0008 -0.0006 -0.0004 -0.0002 0.0000 0.0002 0.0004 0.0006 0.0008 0.0010 0.0012 0.0014 0.0016 0.0018 0.0020 0.0022 0.0024 0.0026 0.0028 0.0030 0.0032 0.0034 0.0036 0.0038 0.0040 0.0042 0.0044 0.0046 0.0048 0.0050 0.0052 0.0054 0.0056 0.0058 0.0060 0.0062 0.0064 0.0066 0.0068 0.0070 0.0072 0.0074 0.0076 0.0078 0.0080 0.0082 0.0084 0.0086 0.0088 0.0090 0.0092 0.0094 0.0096 0.0098 0.0100 Probability Density Completion Time PDF