-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinit_government.jl
41 lines (30 loc) · 1.21 KB
/
init_government.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
init_government(parameters, initial_conditions; typeInt = Int64, typeFloat = Float64)
Initialize the government agent.
# Arguments
- `parameters`: The parameters.
- `initial_conditions`: The initial conditions.
- `typeInt`: The integer type to be used (default: `Int64`).
- `typeFloat`: The floating-point type to be used (default: `Float64`).
# Returns
- The initialized government model.
- The arguments used to initialize the government model.
"""
function init_government(parameters, initial_conditions; typeInt = Int64, typeFloat = Float64)
alpha_G = parameters["alpha_G"]
beta_G = parameters["beta_G"]
sigma_G = parameters["sigma_G"]
L_G = initial_conditions["L_G"]
sb_inact = initial_conditions["sb_inact"]
sb_other = initial_conditions["sb_other"]
J = typeInt(parameters["J"])
C_G = Vector{typeFloat}(vec(initial_conditions["C_G"]))
T_prime = typeInt(parameters["T_prime"])
C_d_j = Vector{typeFloat}(zeros(J))
C_j = zero(typeFloat)
P_j = zero(typeFloat)
Y_G = zero(typeFloat)
gov_args = (alpha_G, beta_G, sigma_G, Y_G, C_G[T_prime], L_G, sb_inact, sb_other, C_d_j, C_j, P_j)
government = Government(gov_args...)
return government, gov_args
end