diff --git a/Project.toml b/Project.toml index f903ae9..1597819 100644 --- a/Project.toml +++ b/Project.toml @@ -11,7 +11,7 @@ JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MAT = "23992714-dd62-5051-b70f-ba57cb901cac" -NamedTupleTools = "d9ec5142-1e00-5aa0-9d6a-321866360f50" +MutableNamedTuples = "af6c499f-54b4-48cc-bbd2-094bba7533c7" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" @@ -22,6 +22,6 @@ FileIO = "1.16" JLD2 = "0.4" JuliaFormatter = "1.0.56" MAT = "0.10" -NamedTupleTools = "0.14" +MutableNamedTuples = "0.1.3" StatsBase = "0.34" julia = "1.9" diff --git a/src/model_init/agents.jl b/src/model_init/agents.jl index c6a818c..27de2c0 100644 --- a/src/model_init/agents.jl +++ b/src/model_init/agents.jl @@ -352,7 +352,7 @@ This is a Model type. It is used to store all the agents of the economy. - `rotw`: RestOfTheWorld - `agg`: Aggregates """ -struct Model +mutable struct Model w_act::AbstractWorkers w_inact::AbstractWorkers firms::AbstractFirms diff --git a/src/model_init/init.jl b/src/model_init/init.jl index 58e470c..2c0d9de 100644 --- a/src/model_init/init.jl +++ b/src/model_init/init.jl @@ -1,6 +1,6 @@ -using NamedTupleTools +using MutableNamedTuples recursive_namedtuple(x::Any) = x -recursive_namedtuple(d::Dict) = namedtuple(Dict(k => recursive_namedtuple(v) for (k, v) in d)) +recursive_namedtuple(d::Dict) = MutableNamedTuple(;Dict(k => recursive_namedtuple(v) for (k, v) in d)...) """ initialise_model(parameters, initial_conditions, T, typeInt = Int64, typeFloat = Float64)