Skip to content

Commit

Permalink
Update search_and_matching_labour.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Nov 12, 2024
1 parent a141332 commit addeb6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/markets/search_and_matching_labour.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function search_and_matching_labour(firms::AbstractFirms, model)
O_h = model.w_act.O_h

V_i = N_d_i .- N_i

# get employed workers in random order
H_E = findall(O_h .> 0)
shuffle!(H_E)
Expand All @@ -46,12 +47,12 @@ function search_and_matching_labour(firms::AbstractFirms, model)

# find unemployed workers and positive vacancies
H_U = findall(O_h .== 0)
shuffle!(H_U)
I_V = findall(V_i .> 0)
shuffle!(I_V)

shuffle!(H_U)
# while there are no more vacancies or unemployed workers
while !isempty(H_U) && !isempty(I_V)
shuffle!(I_V)
for f in eachindex(I_V)
# select random vacancy
i = I_V[f]
Expand All @@ -65,6 +66,7 @@ function search_and_matching_labour(firms::AbstractFirms, model)
isempty(H_U) && break
end
I_V = findall(V_i .> 0)
shuffle!(I_V)
end

return N_i, O_h
Expand Down

0 comments on commit addeb6e

Please sign in to comment.