diff --git a/src/markets/search_and_matching.jl b/src/markets/search_and_matching.jl index a77cb85..5cabe0d 100644 --- a/src/markets/search_and_matching.jl +++ b/src/markets/search_and_matching.jl @@ -388,7 +388,7 @@ function perform_firms_market!( DM_d_ig[i] -= S_fg[f] DM_nominal_ig[i] += @view(S_fg[f]) .* @view(P_f[f]) S_fg[f] = 0 - deleteat!(F_g, e) + swap_pop!(F_g, e) isempty(F_g) && break pr_price_f = pos(exp.(-2 .* @view(P_f[F_g])) ./ sum(exp.(-2 .* @view(P_f[F_g])))) pr_size_f = @view(S_f[F_g]) ./ sum(@view(S_f[F_g])) @@ -426,7 +426,7 @@ function perform_firms_market!( DM_d_ig_[i] -= S_fg_[f] S_fg[f] -= S_fg_[f] S_fg_[f] = 0 - deleteat!(F_g, e) + swap_pop!(F_g, e) isempty(F_g) && break pr_price_f = pos(exp.(-2 .* @view(P_f[F_g])) ./ sum(exp.(-2 .* @view(P_f[F_g])))) pr_size_f = @view(S_f[F_g]) ./ sum(@view(S_f[F_g])) @@ -522,7 +522,7 @@ function perform_retail_market!( C_d_hg[h] -= S_fg[f] * P_f[f] C_real_hg[h] += S_fg[f] S_fg[f] = 0 - deleteat!(F_g, e) + swap_pop!(F_g, e) isempty(F_g) && break pr_price_f = pos(exp.(-2 .* @view(P_f[F_g])) ./ sum(exp.(-2 .* @view(P_f[F_g])))) pr_size_f = @view(S_f[F_g]) ./ sum(@view(S_f[F_g])) @@ -556,7 +556,7 @@ function perform_retail_market!( C_d_hg_[h] -= S_fg_[f] * P_f[f] S_fg[f] -= S_fg_[f] S_fg_[f] = 0 - deleteat!(F_g, e) + swap_pop!(F_g, e) isempty(F_g) && break pr_price_f = max.(0, exp.(-2 .* @view(P_f[F_g])) ./ sum(exp.(-2 .* @view(P_f[F_g])))) pr_price_f[isnan.(pr_price_f)] .= 0.0