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.44118884367565
julia> minimum(duration_samples)
10.000805301965928
julia> quantile(duration_samples, 0.25)
25.532555497319635
julia> median(duration_samples)
42.0256140711256
julia> quantile(duration_samples, 0.75)
65.30991052519329
julia> maximum(duration_samples)
189.7314125013249
We can plot the distribution showing the probability density function for project completion duration.
density(proj)