Project Analysis

CPM Activity

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

Description

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

Fields

  • 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

CpmProblem

OperationsResearchModels.CPM.CpmProblemType
CpmProblem(activities::Vector{CpmActivity})

Description

Represents a CPM (Critical Path Method) problem instance, containing the activities.

Fields

  • activities::Vector{CpmActivity}: A vector of activities in the CPM problem.
source

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

CpmResult

OperationsResearchModels.CPM.CpmResultType
CpmResult(pathstr::Vector{String}, path::Vector{CpmActivity})

Description

Represents the result of a CPM (Critical Path Method) analysis, containing the critical path and its activities.

Fields

  • pathstr::Vector{String}: A vector of strings representing the names of the activities in the critical path.
  • path::Vector{CpmActivity}: A vector of activities representing the critical path.
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).

Fields

  • 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

PERT Problem

OperationsResearchModels.CPM.PertProblemType
PertProblem(activities::Vector{PertActivity})

Description

Represents a PERT (Program Evaluation and Review Technique) problem instance, containing the activities.

Fields

  • activities::Vector{PertActivity}: A vector of activities in the PERT problem.
source

PERT (Project Evaluation and Review Technique)

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

Arguments

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

Output

  • ::PertResult: The object holds the results

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 Result

OperationsResearchModels.CPM.PertResultType
PertResult(path::Vector{PertActivity}, mean::Float64, stddev::Float64)

Description

Represents the result of a PERT (Program Evaluation and Review Technique) analysis, containing the critical path and its activities.

Fields

  • path::Vector{PertActivity}: A vector of activities representing the critical path.
  • mean::Float64: The mean duration of the critical path.
  • stddev::Float64: The standard deviation of the critical path.
source