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