Skip to content

Commit f2f7a8a

Browse files
committed
update documentation
1 parent 68773ad commit f2f7a8a

File tree

4 files changed

+76
-7
lines changed

4 files changed

+76
-7
lines changed

docs/src/algorithms.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,28 @@
55
OperationsResearchModels.solve(a::AssignmentProblem)
66
```
77

8+
```@docs
9+
OperationsResearchModels.AssignmentProblem
10+
```
11+
12+
```@docs
13+
OperationsResearchModels.AssignmentResult
14+
```
15+
816
## Transportation Problem
917

1018
```@docs
1119
OperationsResearchModels.solve(t::TransportationProblem)
1220
```
1321

22+
```@docs
23+
OperationsResearchModels.TransportationProblem
24+
```
25+
26+
```@docs
27+
OperationsResearchModels.TransportationResult
28+
```
29+
1430
### Initial basic solutions for a transportation problem
1531

1632
#### North-west Corner Method

src/assignment.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,37 @@ export AssignmentResult
99
import ..OperationsResearchModels: solve
1010

1111

12+
"""
13+
AssignmentProblem
14+
15+
# Arguments
16+
17+
- `costs::Array{T,2}`: The cost matrix of the assignment problem.
18+
19+
# Description
20+
21+
The `AssignmentProblem` struct represents an assignment problem with a cost matrix.
22+
"""
1223
struct AssignmentProblem{T<:Real}
1324
costs::Array{T,2}
1425
end
1526

1627

28+
29+
"""
30+
AssignmentResult(problem, solution, cost)
31+
32+
# Arguments
33+
34+
- `problem::AssignmentProblem`: The original assignment problem.
35+
- `solution::Matrix`: The solution matrix of the assignment problem.
36+
- `cost::Real`: The optimal cost of the assignment.
37+
38+
# Description
39+
40+
The `AssignmentResult` struct represents the result of solving an assignment problem.
41+
It contains the original problem, the solution matrix, and the optimal cost.
42+
"""
1743
struct AssignmentResult
1844
problem::AssignmentProblem
1945
solution::Matrix

src/simplex.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,11 @@ Description:
490490
491491
Arguments:
492492
493-
- obj::Vector: The objective function coefficients.
494-
- amat::Matrix: The LHS of the constraints.
495-
- rhs::Vector: The RHS of the constraints.
496-
- dir::Vector: The directions of the constraints. Can be a vector of LE (<=), GE (>=), or EQ (==).
497-
- opttype::OptimizationType: The type of the optimization. Can be Maximize or Minimize.
493+
- `obj::Vector`: The objective function coefficients.
494+
- `amat::Matrix`: The LHS of the constraints.
495+
- `rhs::Vector`: The RHS of the constraints.
496+
- `dir::Vector`: The directions of the constraints. Can be a vector of LE (<=), GE (>=), or EQ (==).
497+
- `opttype::OptimizationType`: The type of the optimization. Can be Maximize or Minimize.
498498
499499
Returns:
500500
@@ -555,8 +555,8 @@ Description:
555555
556556
Arguments:
557557
558-
- A::Matrix: The matrix to find the inverse.
559-
- verbose::Bool: If true, the intermediate steps are displayed. Default is true.
558+
- `A::Matrix`: The matrix to find the inverse.
559+
- `verbose::Bool`: If true, the intermediate steps are displayed. Default is true.
560560
561561
Returns:
562562

src/transportation.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,40 @@ export balance
1414
import ..OperationsResearchModels: solve
1515

1616

17+
"""
18+
TransportationProblem
19+
20+
# Arguments
21+
22+
- `costs::Array{T,2}`: The cost matrix of the transportation problem.
23+
- `demand::Array{T,1}`: The demand vector of the transportation problem.
24+
- `supply::Array{T,1}`: The supply vector of the transportation problem.
1725
26+
# Description
27+
28+
The `TransportationProblem` struct represents a transportation problem with a cost matrix, demand vector, and supply vector.
29+
"""
1830
mutable struct TransportationProblem{T<:Real}
1931
costs::Array{T,2}
2032
demand::Array{T,1}
2133
supply::Array{T,1}
2234
end
2335

36+
37+
"""
38+
TransportationResult(problem, balancedProblem, solution, cost)
39+
40+
# Arguments
41+
42+
- `problem::TransportationProblem`: The original transportation problem.
43+
- `balancedProblem::TransportationProblem`: The balanced transportation problem.
44+
- `solution::Matrix`: The solution matrix of the transportation problem.
45+
- `cost::Real`: The optimal cost of the transportation problem.
46+
47+
# Description
48+
The `TransportationResult` struct represents the result of solving a transportation problem.
49+
It contains the original problem, the balanced problem, the solution matrix, and the optimal cost.
50+
"""
2451
struct TransportationResult
2552
originalProblem::TransportationProblem
2653
balancedProblem::TransportationProblem

0 commit comments

Comments
 (0)