You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/create_graph.jl
+20-23Lines changed: 20 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -2,38 +2,35 @@
2
2
# using LinearAlgebra
3
3
4
4
"""
5
-
create_graph(param, w = 11, h = 11; type = "map", kwargs...) -> Dict, Dict
5
+
create_graph(param, w = 11, h = 11; type = "map", N = 1, kwargs...) -> Dict
6
6
7
7
Initialize the underlying graph, population and productivity parameters.
8
8
9
9
# Arguments
10
-
- `param::Dict`: Dict that contains the model parameters
11
-
- `w::Int64=11`: Number of nodes along the width of the underlying graph (integer)
12
-
- `h::Int64=11`: Number of nodes along the height of the underlying graph (integer, odd if triangle)
10
+
- `param::Dict`: Dict that contains the model parameters (only needed for checks)
11
+
- `w::Int64=11`: Number of nodes along the width of the underlying graph if type != "custom" (integer)
12
+
- `h::Int64=11`: Number of nodes along the height of the underlying graph if type != "custom" (integer, odd if triangle)
13
13
14
14
# Keyword Arguments
15
15
- `type::String="map"`: Either "map", "square", "triangle", or "custom"
16
-
- `omega::Vector{Float64}`: Vector of Pareto weights for each node or region in partial mobility case (default ones(J or nregions))
17
-
- `Zjn::Matrix{Float64}`: J x N matrix of producties per node (j = 1:J) and good (n = 1:N) (default ones(J, N))
18
16
- `adjacency::BitMatrix`: J x J Adjacency matrix (only used for custom network)
19
17
- `x::Vector{Float64}`: x coordinate (longitude) of each node (only used for custom network)
20
18
- `y::Vector{Float64}`: y coordinate (latitude) of each node (only used for custom network)
19
+
- `omega::Vector{Float64}`: Vector of Pareto weights for each node or region in partial mobility case (default ones(J or nregions))
20
+
- `m::Vector{Float64}=ones(N)`: Vector of weights Nx1 in the cross congestion cost function
21
+
- `Zjn::Matrix{Float64}`: J x N matrix of producties per node (j = 1:J) and good (n = 1:N) (default ones(J, N))
21
22
- `Lj::Vector{Float64}`: Vector of populations in each node (j = 1:J) (only for fixed labour case)
22
23
- `Hj::Vector{Float64}`: Vector of immobile good in each node (j = 1:J) (e.g. housing, default ones(J))
23
24
- `Lr::Vector{Float64}`: Vector of populations in each region (r = 1:nregions) (only for partial mobility)
24
25
- `region::Vector{Int64}`: Vector indicating region of each location (only for partial mobility)
25
26
26
-
# Notes
27
-
- `create_graph()` will overwrite any parameters `Zjn`, `Lj`, `Hj`, `omega`, `Lr`, already set in the `param` Dict with the default values. So these values should be set inside `create_graph()`, or after `create_graph()` has been called.
28
-
29
27
# Examples
30
28
```julia
31
-
param, graph = create_graph(init_parameters())
29
+
graph = create_graph()
32
30
```
33
31
"""
34
32
functioncreate_graph(param, w =11, h =11; type ="map", kwargs...)
0 commit comments