diff --git a/src/markets/search_and_matching_labour.jl b/src/markets/search_and_matching_labour.jl index 7eb8ecd..ec1d1f9 100644 --- a/src/markets/search_and_matching_labour.jl +++ b/src/markets/search_and_matching_labour.jl @@ -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) @@ -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] @@ -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