Project Analysis

CPM (Critical Path Method)

OperationsResearchModels.solveMethod
solve(problem)

Arguments

  • problem::CpmProblem: The problem in type of CpmProblem.

Output

  • ::CpmResult: The object holds the results

Description

Calculates CPM (Critical Path Method) and reports the critical path for a given set of activities.

Example

julia> A = CpmActivity("A", 2);
julia> B = CpmActivity("B", 3);
julia> C = CpmActivity("C", 2, [A]);
julia> D = CpmActivity("D", 3, [B]);
julia> E = CpmActivity("E", 2, [B]);
julia> F = CpmActivity("F", 3, [C, D]);
julia> G = CpmActivity("G", 7, [E]);
julia> H = CpmActivity("H", 5, [E]);
julia> I = CpmActivity("I", 6, [G, F]);
julia> J = CpmActivity("J", 2, [C, D]);

julia> activities = [A, B, C, D, E, F, G, H, I, J];

julia> problem = CpmProblem(activities);

julia> result = solve(problem);

julia> result.pathstr
4-element Vector{String}:
 "B"
 "E"
 "G"
 "I"

 julia> result.path == [B, E, G, I]
true
source

CPM Activity

OperationsResearchModels.CPM.CpmActivityType
CpmActivity(name::String, time::Float64, dependencies)

Description

The object that represents an activity in CPM (Critical Path Method).

Arguments

  • name::String: The name of the activity.
  • time::Float64: The time of the activity.
  • dependencies: The dependencies of the activity in type of Vector{CpmActivity}.

Example

julia> A = CpmActivity("A", 2, []);

julia> B = CpmActivity("B", 3, []);

julia> C = CpmActivity("C", 2, [A, B]);
source

PERT (Project Evaluation and Review Technique)

OperationsResearchModels.solveMethod
solve(problem::PertProblem)::PertResult

Arguments

  • problem::PertProblem: The problem in type of PertProblem.

Example

julia> A = PertActivity("A", 1, 2, 3)
PertActivity("A", 1.0, 2.0, 3.0, PertActivity[])

julia> B = PertActivity("B", 3, 3, 3)
PertActivity("B", 3.0, 3.0, 3.0, PertActivity[])

julia> C = PertActivity("C", 5, 5, 5, [A, B])
PertActivity("C", 5.0, 5.0, 5.0, PertActivity[PertActivity("A", 1.0, 2.0, 3.0, PertActivity[]), PertActivity("B", 3.0, 3.0, 3.0, PertActivity[])])

julia> activities = [A, B, C]
3-element Vector{PertActivity}:
 PertActivity("A", 1.0, 2.0, 3.0, PertActivity[])
 PertActivity("B", 3.0, 3.0, 3.0, PertActivity[])
 PertActivity("C", 5.0, 5.0, 5.0, PertActivity[PertActivity("A", 1.0, 2.0, 3.0, PertActivity[]), PertActivity("B", 3.0, 3.0, 3.0, PertActivity[])])

julia> problem = PertProblem(activities);

julia> result = pert(activities)
PertResult(PertActivity[PertActivity("B", 3.0, 3.0, 3.0, PertActivity[]), PertActivity("C", 5.0, 5.0, 5.0, PertActivity[PertActivity("A", 1.0, 2.0, 3.0, PertActivity[]), PertActivity("B", 3.0, 3.0, 3.0, PertActivity[])])], 8.0, 0.0)

julia> result.mean
8.0

julia> result.stddev
0.0
source

PERT Activity

OperationsResearchModels.CPM.PertActivityType
PertActivity(name::String, o::Float64, m::Float64, p::Float64)::PertActivity

Description

The object that represents an activity in PERT (Program Evaluation and Review Technique).

Arguments

  • name::String: The name of the activity.
  • o::Float64: The optimistic time of the activity.
  • m::Float64: The most likely time of the activity.
  • p::Float64: The pessimistic time of the activity.
  • dependencies: The dependencies of the activity in type of Vector{PertActivity}.

Example

julia> A = PertActivity("A", 1, 2, 3);
julia> B = PertActivity("B", 3, 3, 4);
julia> C = PertActivity("C", 5, 6, 7, [A, B]);
source