Skip to content

Commit 60bbe28

Browse files
committed
Minor fixes.
1 parent 6fda83e commit 60bbe28

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

examples/example02.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ graph[:Lj][graph[:Lj] .== 0] .= 1e-6
5050
# second, in the nonconvex case (gamma>beta)
5151
param[:gamma] = 2 # change only gamma, keep other parameters
5252
res[2] = optimal_network(param, graph) # optimize by iterating on FOCs
53-
res[3] = annealing(graph, res[2][:Ijk]) # improve with annealing, starting from previous result
53+
res[3] = annealing(param, graph, res[2][:Ijk]) # improve with annealing, starting from previous result
5454
end
5555

5656
# ==========

examples/paper_example02.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ param[:gamma] = 2
4646
results[2] = optimal_network(param, graph)
4747

4848
# Nonconvex - annealing
49-
results[3] = annealing(graph, results[2][:Ijk], perturbation_method = "rebranching")
49+
results[3] = annealing(param, graph, results[2][:Ijk], perturbation_method = "rebranching")
5050

5151
welfare_increase = (results[3][:welfare] / results[2][:welfare]) ^ (1 / (param[:alpha] * (1 - param[:rho]))) # compute welfare increase in consumption equivalent
5252

examples/paper_example03.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ results[1] = optimal_network(param, graph)
4848

4949
# Nonconvex
5050
param[:gamma] = 2
51-
results[2] = optimal_network(graph, I0 = results[1][:Ijk])
51+
results[2] = optimal_network(param, graph, I0 = results[1][:Ijk])
5252

5353
# Plot results
5454

@@ -59,7 +59,8 @@ for j in 1:2
5959
# Initialize an empty array to hold the subplots
6060
plots = Vector{Any}(undef, (1 + param[:N]))
6161
# Plot network
62-
plots[1] = plot_graph(graph, results[j][:Ijk], node_shades = results[j][:Lj], node_sizes = results[j][:Lj], node_sizes_scale = 40)
62+
plots[1] = plot_graph(graph, results[j][:Ijk], node_shades = results[j][:Lj],
63+
node_sizes = results[j][:Lj], node_sizes_scale = 40)
6364
title!(plots[1], "(a) Transport Network")
6465
# Plot goods flows
6566
for i in 1:param[:N]

examples/paper_example04.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ using Random
33
using Plots
44

55
# Initialize parameters
6-
param = init_parameters(K = 100, labor_mobility = false)
6+
param = init_parameters(K = 100, rho = 0, labor_mobility = false)
77
width, height = 13, 13
88

99
# Create graph
10-
param, g0 = create_graph(param, width, height, type = "map")
10+
g0 = create_graph(param, width, height, type = "map")
1111

1212
# Set fundamentals
1313
g0[:Zjn] = ones(g0[:J], 1) .* 1e-7 # matrix of productivity (not 0 to avoid numerical glitches)

0 commit comments

Comments
 (0)