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