Skip to content

Commit

Permalink
Some refactoring of market functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Nov 30, 2024
1 parent ba76276 commit 4b1e735
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/markets/search_and_matching_credit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ function search_and_matching_credit(firms::AbstractFirms, model)
DL_i = zeros(size(DL_d_i))
I_FG = findall(DL_d_i .> 0)
shuffle!(I_FG)
s = sum(L_e_i) + sum(DL_i)
for i in I_FG
DL_i[i] = max(0, min(min(DL_d_i[i], zeta_LTV * K_e_i[i] - L_e_i[i]), E_k / zeta - (sum(L_e_i) + sum(DL_i))))
DL_i[i] = max(0.0, min(DL_d_i[i], zeta_LTV * K_e_i[i] - L_e_i[i], E_k / zeta - s))
end
return DL_i
end

0 comments on commit 4b1e735

Please sign in to comment.