Skip to content

Commit d6a47a4

Browse files
committed
(#2) Add type documentation for Connection struct
1 parent c46fec5 commit d6a47a4

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

docs/src/network.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Network Models
22

3+
## Connection
4+
5+
```@docs
6+
OperationsResearchModels.Connection
7+
```
8+
39
## Shortest Path
410

511
```@docs

src/network.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,25 @@ export leftexpressions
1313
export hassameorder
1414

1515

16+
"""
17+
Connection
1618
19+
# Description
20+
21+
A structure to hold a directed connection between two nodes in a network.
22+
23+
# Fields
24+
- `from::Int64`: The starting node of the connection.
25+
- `to::Int64`: The ending node of the connection.
26+
- `value::Any`: The value associated with the connection (e.g. distance, time, capacity).
27+
28+
# Example
29+
30+
```julia
31+
# Create a connection from node 1 to node 2 with a distance of 5 kms.
32+
conn = Connection(1, 2, 5)
33+
```
34+
"""
1735
struct Connection
1836
from::Int64
1937
to::Int64

0 commit comments

Comments
 (0)