Skip to content

Commit 25be985

Browse files
committed
(#2) Add type docs for CpmProblem, CpmResult, PertProblem, PertResult
1 parent 782c777 commit 25be985

File tree

2 files changed

+103
-4
lines changed

2 files changed

+103
-4
lines changed

docs/src/project.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,64 @@
11
# Project Analysis
22

3+
### CPM Activity
4+
5+
```@docs
6+
OperationsResearchModels.CpmActivity
7+
```
8+
9+
10+
11+
## CpmProblem
12+
13+
```@docs
14+
OperationsResearchModels.CpmProblem
15+
```
16+
17+
318

419
## CPM (Critical Path Method)
20+
521
```@docs
622
OperationsResearchModels.solve(problem::CpmProblem)
723
```
824

9-
### CPM Activity
25+
26+
27+
## CpmResult
28+
1029
```@docs
11-
OperationsResearchModels.CpmActivity
30+
OperationsResearchModels.CpmResult
1231
```
1332

1433

34+
35+
### PERT Activity
36+
37+
```@docs
38+
OperationsResearchModels.PertActivity
39+
```
40+
41+
42+
43+
### PERT Problem
44+
45+
```@docs
46+
OperationsResearchModels.PertProblem
47+
```
48+
49+
50+
1551
## PERT (Project Evaluation and Review Technique)
52+
1653
```@docs
1754
OperationsResearchModels.solve(problem::PertProblem)
1855
```
1956

20-
### PERT Activity
57+
58+
59+
### PERT Result
60+
2161
```@docs
22-
OperationsResearchModels.PertActivity
62+
OperationsResearchModels.PertResult
2363
```
64+

src/cpm.jl

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,44 @@ struct CpmActivity
4141
dependencies::Vector{CpmActivity}
4242
end
4343

44+
"""
45+
CpmProblem
46+
47+
# Description
48+
49+
Represents a CPM (Critical Path Method) problem instance, containing the activities.
50+
51+
# Fields
52+
53+
- `activities::Vector{CpmActivity}`: A vector of activities in the CPM problem.
54+
"""
4455
struct CpmProblem
4556
activities::Vector{CpmActivity}
4657
end
4758

59+
60+
61+
"""
62+
CpmResult
63+
64+
# Description
65+
66+
Represents the result of a CPM (Critical Path Method) analysis, containing the critical path and its activities.
67+
68+
# Fields
69+
70+
- `pathstr::Vector{String}`: A vector of strings representing the names of the activities in the critical path.
71+
- `path::Vector{CpmActivity}`: A vector of activities representing the critical path.
72+
"""
4873
struct CpmResult
4974
pathstr::Vector{String}
5075
path::Vector{CpmActivity}
5176
end
5277

78+
79+
80+
81+
5382
"""
5483
PertActivity(name::String, o::Float64, m::Float64, p::Float64)::PertActivity
5584
@@ -79,10 +108,39 @@ struct PertActivity
79108
dependencies::Vector{PertActivity}
80109
end
81110

111+
112+
113+
114+
"""
115+
PertProblem
116+
117+
# Description
118+
119+
Represents a PERT (Program Evaluation and Review Technique) problem instance, containing the activities.
120+
121+
# Fields
122+
123+
- `activities::Vector{PertActivity}`: A vector of activities in the PERT problem.
124+
"""
82125
struct PertProblem
83126
activities::Vector{PertActivity}
84127
end
85128

129+
130+
131+
"""
132+
PertResult
133+
134+
# Description
135+
136+
Represents the result of a PERT (Program Evaluation and Review Technique) analysis, containing the critical path and its activities.
137+
138+
# Fields
139+
140+
- `path::Vector{PertActivity}`: A vector of activities representing the critical path.
141+
- `mean::Float64`: The mean duration of the critical path.
142+
- `stddev::Float64`: The standard deviation of the critical path.
143+
"""
86144
struct PertResult
87145
path::Vector{PertActivity}
88146
mean::Float64

0 commit comments

Comments
 (0)