Skip to content

Commit de37ede

Browse files
committed
update documentation
1 parent 362be40 commit de37ede

5 files changed

Lines changed: 52 additions & 6 deletions

File tree

docs/src/assignment.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
## Assignment Problem
1+
## Assignment Problem Solver
2+
23
```@docs
34
OperationsResearchModels.solve(a::AssignmentProblem)
45
```
56

7+
## Assignment Problem
68
```@docs
79
OperationsResearchModels.AssignmentProblem
810
```
911

12+
## Assignment Result
13+
1014
```@docs
1115
OperationsResearchModels.AssignmentResult
1216
```

docs/src/game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Zero-Sum Games
1+
## Zero-Sum Games
22

33
```@docs
44
OperationsResearchModels.game

docs/src/knapsack.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
# The Classical Knapsack Problem
1+
# The Classical Knapsack Problem Solver
22

33
```@docs
44
OperationsResearchModels.solve(p::KnapsackProblem)
5-
```
5+
```
6+
7+
8+
```@docs
9+
OperationsResearchModels.KnapsackProblem
10+
```
11+
12+
```@docs
13+
OperationsResearchModels.KnapsackResult
14+
```
15+

docs/src/scheduling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
OperationsResearchModels.johnsons
77
```
88

9-
### Genetic Algorithm for the problems that cannot be solved with using Johnson's Rule
9+
## Genetic Algorithm for the problems that cannot be solved with using Johnson's Rule
1010

1111
```@docs
1212
OperationsResearchModels.johnsons_ga
1313
```
1414

15-
### Makespan
15+
## Makespan
1616

1717
```@docs
1818
OperationsResearchModels.makespan

src/knapsack.jl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,44 @@ export KnapsackResult
77

88
using JuMP, HiGHS
99

10+
11+
"""
12+
KnapsackResult
13+
14+
# Description
15+
16+
A structure to hold the result of the knapsack problem.
17+
18+
# Fields
19+
20+
- `selected`: A vector of booleans indicating which items are selected.
21+
- `model`: The JuMP model used to solve the problem.
22+
- `objective`: The objective value of the model.
23+
"""
1024
struct KnapsackResult
1125
selected::Vector{Bool}
1226
model::JuMP.Model
1327
objective::Float64
1428
end
1529

30+
31+
32+
"""
33+
knapsack(values::Vector{Float64}, weights::Vector{Float64}, capacity::Float64)::KnapsackResult
34+
35+
# Description
36+
37+
Defines the knapsack problem.
38+
39+
# Fields
40+
41+
- `values::Vector{Float64}`: The values of the items.
42+
- `weights::Vector{Float64}`: The weights of the items.
43+
- `capacity::Float64`: The maximum capacity of the knapsack.
44+
45+
# Output
46+
- `KnapsackResult`: The custom data type that holds selected items, model, and objective value.
47+
"""
1648
struct KnapsackProblem
1749
values::Vector{Float64}
1850
weights::Vector{Float64}

0 commit comments

Comments
 (0)