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