breed [Banks Bank] breed [Firms Firm] breed [CentralBanks CentralBank] directed-link-breed [LoansBF LoanBF] directed-link-breed [LoansBB LoanBB] directed-link-breed [LoansCBB LoanCBB] CentralBanks-own [ReservesCB LoansCB BanknotesInCirculation] Banks-own [CashB LoansB DepositsB DebtsB] LoansBF-own [Age AmountBF] LoansBB-own [Age AmountBB] LoansCBB-own [Age AmountCBB] globals [ListOmega] to setup clear-all reset-ticks ask patches [set pcolor 8] create-CentralBanks 1 [set color Yellow set shape "building institution" set size 3 setxy 25 0 ] create-Banks BanksInitialNumber [set color Red set shape "building institution" set size 1.5 ] layout-circle Banks 15 create-Firms FirmsNumber [set color Blue set shape "factory" set size 1.5 ] layout-circle Firms 24.5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; INITIALIZATION ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ask CentralBanks [set ReservesCB 0 set LoansCB 0 set BanknotesInCirculation 0 ] ask Banks [set LoansB 0 set DebtsB 0 set ListOmega [] repeat BanksInitialNumber [set ListOmega lput random-float 1 ListOmega] let Tot (sum ListOmega) let j 0 while [j < BanksInitialNumber] [set ListOmega replace-item j ListOmega (item j ListOmega / Tot) set j (j + 1) ] let i 1 while [i <= BanksInitialNumber] [ask (Bank i) [set CashB ((MinInitialLiquidity + random (MaxInitialLiquidity - MinInitialLiquidity)) + ((item (i - 1) ListOmega) * FamiliesTotalAssets)) set DepositsB (((item (i - 1) ListOmega) * FamiliesTotalAssets) * ((1 + rD) ^ (1 / 360))) ] set i (i + 1) ] ] end to go ask LoansBF [set Age Age + 1] ask LoansBB [set Age Age + 1] ask LoansCBB [set Age Age + 1] let BanksNumber (count Banks with [color = Red]) if (BanksNumber = 0) [ stop ] ask Firms [set color Blue] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; LOAN REQUESTS FROM FIRMS & PAYMENT IN BANK DEPOSITS ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; let NoR (min (list (random-poisson Ave#LoansRequests) FirmsNumber)) ; NoR: Number of Requests ask n-of NoR Firms [let MyBank one-of Banks with [color = Red] ifelse (Mybank != Nobody) [ifelse (([CashB] of MyBank) - Loan) >= MinCashForLoan [create-LoanBF-from MyBank ; Creation of link Bank -> Firm [set color Green set Age 0 set AmountBF Loan ; Loan requested by the Firm: Loan ask end1 [set CashB (CashB - ([AmountBF] of myself)) set LoansB (LoansB + (([AmountBF] of myself) * ((1 + rC) ^ (RepaymentPeriod / 360)))) ] set ListOmega [] ; Payment in Bank deposits repeat BanksNumber [set ListOmega lput random-float 1 ListOmega] let Tot (sum ListOmega) let j 0 while [j < BanksNumber] [set ListOmega replace-item j ListOmega (item j ListOmega / Tot) set j (j + 1) ] let i 1 let k 0 while [i <= BanksInitialNumber and k < BanksNumber] [ask (Bank i) [if (([color] of Bank i) = Red) [set CashB (CashB + ((item k ListOmega) * ([AmountBF] of myself))) set DepositsB (DepositsB + ((item k ListOmega) * ([AmountBF] of myself))) set k (k + 1) ] ] set i (i + 1) ] ] ] [ask MyBank [let OtherBank one-of other Banks with [color = Red] ifelse ((OtherBank != Nobody) and (([CashB] of OtherBank) + ([CashB] of MyBank) - Loan) >= (2 * MinCashForLoan)) [create-LoanBB-from OtherBank ; Creation of link Bank -> Bank [set color Pink set Age 0 set AmountBB (MinCashForLoan - ([CashB] of MyBank) + Loan) ; Loan requested by MyBank: MinCashForLoan - ([CashB] of MyBank) + Loan ask end1 [set CashB (CashB - ([AmountBB] of myself)) set LoansB (LoansB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ask end2 [set CashB (MinCashForLoan + Loan) set DebtsB (DebtsB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ] create-LoanBF-to myself ; Creation of link Bank -> Firm [set color Green set Age 0 set AmountBF Loan ; Loan requested by the Firm: Loan ask end1 [set CashB MinCashForLoan set LoansB (LoansB + (([AmountBF] of myself) * ((1 + rC) ^ (RepaymentPeriod / 360)))) ] set ListOmega [] ; Payment in Bank deposits repeat BanksNumber [set ListOmega lput random-float 1 ListOmega] let Tot (sum ListOmega) let j 0 while [j < BanksNumber] [set ListOmega replace-item j ListOmega (item j ListOmega / Tot) set j (j + 1) ] let i 1 let k 0 while [i <= BanksInitialNumber and k < BanksNumber] [ask (Bank i) [if (([color] of Bank i) = Red) [set CashB (CashB + ((item k ListOmega) * ([AmountBF] of myself))) set DepositsB (DepositsB + ((item k ListOmega) * ([AmountBF] of myself))) set k (k + 1) ] ] set i (i + 1) ] ] ] [ifelse CBConservativeChoice [ifelse (([CashB] of MyBank) >= (0.2 * ([DepositsB] of MyBank)) and ((([BanknotesInCirculation] of CentralBank 0) + (MinCashForLoan - ([CashB] of MyBank) + Loan)) <= MaxBanknotesInCirculation)) ; CBConservativeChoice ON [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (MinCashForLoan - ([CashB] of MyBank) + Loan) ; Loan requested by MyBank: MinCashForLoan - ([CashB] of MyBank) + Loan ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB (MinCashForLoan + Loan) set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] create-LoanBF-to myself ; Creation of link Bank -> Firm [set color Green set Age 0 set AmountBF Loan ; Loan requested by the Firm: Loan ask end1 [set CashB MinCashForLoan set LoansB (LoansB + (([AmountBF] of myself) * ((1 + rC) ^ (RepaymentPeriod / 360)))) ] set ListOmega [] ; Payment in Bank deposits repeat BanksNumber [set ListOmega lput random-float 1 ListOmega] let Tot (sum ListOmega) let j 0 while [j < BanksNumber] [set ListOmega replace-item j ListOmega (item j ListOmega / Tot) set j (j + 1) ] let i 1 let k 0 while [i <= BanksInitialNumber and k < BanksNumber] [ask (Bank i) [if (([color] of Bank i) = Red) [set CashB (CashB + ((item k ListOmega) * ([AmountBF] of myself))) set DepositsB (DepositsB + ((item k ListOmega) * ([AmountBF] of myself))) set k (k + 1) ] ] set i (i + 1) ] ] ] [ask myself [set color Yellow] ; The Firm doesn't get the required loan ] ] [ifelse (([CashB] of MyBank) < (0.2 * ([DepositsB] of MyBank))) ; CBConservativeChoice OFF [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (MinCashForLoan - ([CashB] of MyBank) + Loan) ; Loan requested by MyBank: MinCashForLoan - ([CashB] of MyBank) + Loan ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB (MinCashForLoan + Loan) set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] create-LoanBF-to myself ; Creation of link Bank -> Firm [set color Green set Age 0 set AmountBF Loan ; Loan requested by the Firm: Loan ask end1 [set CashB MinCashForLoan set LoansB (LoansB + (([AmountBF] of myself) * ((1 + rC) ^ (RepaymentPeriod / 360)))) ] set ListOmega [] ; Payment in Bank deposits repeat BanksNumber [set ListOmega lput random-float 1 ListOmega] let Tot (sum ListOmega) let j 0 while [j < BanksNumber] [set ListOmega replace-item j ListOmega (item j ListOmega / Tot) set j (j + 1) ] let i 1 let k 0 while [i <= BanksInitialNumber and k < BanksNumber] [ask (Bank i) [if (([color] of Bank i) = Red) [set CashB (CashB + ((item k ListOmega) * ([AmountBF] of myself))) set DepositsB (DepositsB + ((item k ListOmega) * ([AmountBF] of myself))) set k (k + 1) ] ] set i (i + 1) ] ] ] [ask myself [set color Yellow] ; The Firm doesn't get the required loan ] ] ] ] ] ] [ask myself [set color Yellow] ; The Firm doesn't get the required loan ] ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; REPAYMENT OF LOANS ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ask LoansBF with [Age = RepaymentPeriod] ; Repayment of Bank - Firm loans [ask end1 [set CashB (CashB + (([AmountBF] of myself) * ((1 + rC) ^ (RepaymentPeriod / 360)))) set LoansB (LoansB - (([AmountBF] of myself) * ((1 + rC) ^ (RepaymentPeriod / 360)))) ] die ] ask LoansBB with [Age = RepaymentPeriod] ; Repayment of Bank - Bank loans [ifelse (([CashB] of end2) >= (AmountBB * ((1 + rB) ^ (RepaymentPeriod / 360)))) [ask end1 [set CashB (CashB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) set LoansB (LoansB - (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ask end2 [set CashB (CashB - (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) set DebtsB (DebtsB - (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] die ] [set Age (RepaymentPeriod - 1) ] ] ask LoansCBB with [Age = RepaymentPeriod] ; Repayment of Central Bank - Bank loans [ifelse (([CashB] of end2) >= (AmountCBB * ((1 + rCB) ^ (RepaymentPeriod / 360)))) [ask end1 [set ReservesCB (ReservesCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set LoansCB (LoansCB - (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ask end2 [set CashB (CashB - (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set DebtsB (DebtsB - (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] die ] [set Age (RepaymentPeriod - 1) ] ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; WITHDRAWAL FROM DEPOSITS ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; let NoW (min (list (random-poisson Ave#Withdrawal) BanksNumber)) ; NoW: Number of Withdrawals ask n-of NoW (Banks with [color = Red]) [ifelse (CashB >= DepositsB) [ifelse (Withdrawal <= DepositsB) [set CashB (CashB - Withdrawal) ; CashB >= DepositsB >= Withdrawal set DepositsB (DepositsB - Withdrawal) ] [set CashB (CashB - DepositsB) ; CashB >= Withdrawal >= DepositsB or Withdrawal >= CashB >= DepositsB set DepositsB 0 ] ] [ifelse (Withdrawal <= CashB) [set CashB (CashB - Withdrawal) ; DepositsB >= CashB >= Withdrawal set DepositsB (DepositsB - Withdrawal) ] [ifelse (Withdrawal <= DepositsB) [let OtherBank one-of other Banks with [color = Red] ; DepositsB >= Withdrawal >= CashB ifelse ((OtherBank != Nobody) and ((([CashB] of OtherBank) - (Withdrawal - CashB)) >= MinCashForLoan)) [create-LoanBB-from OtherBank ; Creazione link Banca -> Banca [set color Pink set Age 0 set AmountBB (Withdrawal - ([CashB] of myself)) ; Loan requested by the Bank: Withdrawal - ([CashB] of myself) ask end1 [set CashB (CashB - ([AmountBB] of myself)) set LoansB (LoansB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ask end2 [set CashB 0 set DepositsB (DepositsB - Withdrawal) set DebtsB (DebtsB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ] ] [ifelse CBConservativeChoice [ifelse ((CashB >= (0.2 * DepositsB)) and ((([BanknotesInCirculation] of CentralBank 0) + (Withdrawal - CashB)) <= MaxBanknotesInCirculation)) ; CBConservativeChoice ON [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (Withdrawal - ([CashB] of myself)) ; Loan requested by the Bank: Withdrawal - ([CashB] of myself) ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB 0 set DepositsB (DepositsB - Withdrawal) set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] ] [set DepositsB (DepositsB - CashB) ; The loan is not granted, Bank's default set CashB 0 set color Black ] ] [ifelse (CashB < (0.2 * DepositsB)) ; CBConservativeChoice OFF [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (Withdrawal - ([CashB] of myself)) ; Loan requested by the Bank: Withdrawal - ([CashB] of myself) ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB 0 set DepositsB (DepositsB - Withdrawal) set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] ] [set DepositsB (DepositsB - CashB) ; The loan is not granted, Bank's default set CashB 0 set color Black ] ] ] ] [let OtherBank one-of other Banks with [color = Red] ; Withdrawal >= DepositsB >= CashB ifelse ((OtherBank != Nobody) and ((([CashB] of OtherBank) - (DepositsB - CashB)) >= MinCashForLoan)) [create-LoanBB-from OtherBank ; Creation of link Bank -> Bank [set color Pink set Age 0 set AmountBB (([DepositsB] of myself) - ([CashB] of myself)) ; Loan requested by the Bank: ([DepositsB] of myself) - ([CashB] of myself) ask end1 [set CashB (CashB - ([AmountBB] of myself)) set LoansB (LoansB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ask end2 [set CashB 0 set DepositsB 0 set DebtsB (DebtsB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ] ] [ifelse CBConservativeChoice [ifelse ((CashB >= (0.2 * DepositsB)) and ((([BanknotesInCirculation] of CentralBank 0) + (DepositsB - CashB)) <= MaxBanknotesInCirculation)) ; CBConservativeChoice ON [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (([DepositsB] of myself) - ([CashB] of myself)) ; Loan requested by the Bank: ([DepositsB] of myself) - ([CashB] of myself) ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB 0 set DepositsB 0 set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] ] [set DepositsB (DepositsB - CashB) ; The loan is not granted, Bank's default set CashB 0 set color Black ] ] [ifelse (CashB < (0.2 * DepositsB)) ; CBConservativeChoice OFF [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (([DepositsB] of myself) - ([CashB] of myself)) ; Loan requested by the Bank: ([DepositsB] of myself) - ([CashB] of myself) ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB 0 set DepositsB 0 set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] ] [set DepositsB (DepositsB - CashB) ; The loan is not granted, Bank's default set CashB 0 set color Black ] ] ] ] ] ] ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; WITHDRAWAL FROM DEPOSITS 2 ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; let NoFwL (count (Firms with [color = Yellow])) ; NoFwL: Number of Firms without the requested Loan let WithdrawalAmount (NoFwL * Loan) ; WithdrawalAmount: Amount of money that has not been obtained from the Firms ask Banks [set ListOmega [] repeat BanksNumber [set ListOmega lput random-float 1 ListOmega] let Tot (sum ListOmega) let j 0 while [j < BanksNumber] [set ListOmega replace-item j ListOmega (item j ListOmega / Tot) set j (j + 1) ] let i 1 let k 0 while [i <= BanksInitialNumber and k < BanksNumber] [ask (Bank i) [if (([color] of Bank i) = Red) [ifelse (CashB >= DepositsB) [ifelse (((item k ListOmega) * WithdrawalAmount) <= DepositsB) [set CashB (CashB - ((item k ListOmega) * WithdrawalAmount)) ; CashB >= DepositsB >= ((item k ListOmega) * WithdrawalAmount) set DepositsB (DepositsB - ((item k ListOmega) * WithdrawalAmount)) ] [set CashB (CashB - DepositsB) ; CashB >= ((item k ListOmega) * WithdrawalAmount) >= DepositsB or ((item k ListOmega) * WithdrawalAmount) >= CashB >= DepositsB set DepositsB 0 ] ] [ifelse (((item k ListOmega) * WithdrawalAmount) <= CashB) [set CashB (CashB - ((item k ListOmega) * WithdrawalAmount)) ; DepositsB >= CashB >= ((item k ListOmega) * WithdrawalAmount) set DepositsB (DepositsB - ((item k ListOmega) * WithdrawalAmount)) ] [ifelse (((item k ListOmega) * WithdrawalAmount) <= DepositsB) [let OtherBank one-of other Banks with [color = Red] ; DepositsB >= ((item k ListOmega) * WithdrawalAmount) >= CashB ifelse ((OtherBank != Nobody) and ((([CashB] of OtherBank) - (((item k ListOmega) * WithdrawalAmount) - CashB)) >= MinCashForLoan)) [create-LoanBB-from OtherBank ; Creation of link Bank -> Bank [set color Pink set Age 0 set AmountBB (((item k ListOmega) * WithdrawalAmount) - ([CashB] of myself)) ; Loan requested by the Bank: ((item k ListOmega) * WithdrawalAmount) - ([CashB] of myself) ask end1 [set CashB (CashB - ([AmountBB] of myself)) set LoansB (LoansB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ask end2 [set CashB 0 set DepositsB (DepositsB - ((item k ListOmega) * WithdrawalAmount)) set DebtsB (DebtsB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ] ] [ifelse CBConservativeChoice [ifelse ((CashB >= (0.2 * DepositsB)) and ((([BanknotesInCirculation] of CentralBank 0) + (((item k ListOmega) * WithdrawalAmount) - CashB)) <= MaxBanknotesInCirculation)) ; CBConservativeChoice ON [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (((item k ListOmega) * WithdrawalAmount) - ([CashB] of myself)) ; Loan requested by the Bank: ((item k ListOmega) * WithdrawalAmount) - ([CashB] of myself) ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB 0 set DepositsB (DepositsB - ((item k ListOmega) * WithdrawalAmount)) set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] ] [set DepositsB (DepositsB - CashB) ; The loan is not granted, Bank's default set CashB 0 set color Black ] ] [ifelse (CashB < (0.2 * DepositsB)) ; CBConservativeChoice OFF [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (((item k ListOmega) * WithdrawalAmount) - ([CashB] of myself)) ; Loan requested by the Bank: ((item k ListOmega) * WithdrawalAmount) - ([CashB] of myself) ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB 0 set DepositsB (DepositsB - ((item k ListOmega) * WithdrawalAmount)) set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] ] [set DepositsB (DepositsB - CashB) ; The loan is not granted, Bank's default set CashB 0 set color Black ] ] ] ] [let OtherBank one-of other Banks with [color = Red] ; ((item k ListOmega) * WithdrawalAmount) >= DepositsB >= CashB ifelse ((OtherBank != Nobody) and ((([CashB] of OtherBank) - (DepositsB - CashB)) >= MinCashForLoan)) [create-LoanBB-from OtherBank ; Creation of link Bank -> Bank [set color Pink set Age 0 set AmountBB (([DepositsB] of myself) - ([CashB] of myself)) ; Loan requested by the Bank: ([DepositsB] of myself) - ([CashB] of myself) ask end1 [set CashB (CashB - ([AmountBB] of myself)) set LoansB (LoansB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ask end2 [set CashB 0 set DepositsB 0 set DebtsB (DebtsB + (([AmountBB] of myself) * ((1 + rB) ^ (RepaymentPeriod / 360)))) ] ] ] [ifelse CBConservativeChoice [ifelse ((CashB >= (0.2 * DepositsB)) and ((([BanknotesInCirculation] of CentralBank 0) + (DepositsB - CashB)) <= MaxBanknotesInCirculation)) ; CBConservativeChoice ON [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (([DepositsB] of myself) - ([CashB] of myself)) ; Loan requested by the Bank: ([DepositsB] of myself) - ([CashB] of myself) ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB 0 set DepositsB 0 set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] ] [set DepositsB (DepositsB - CashB) ; The loan is not granted, Bank's default set CashB 0 set color Black ] ] [ifelse (CashB < (0.2 * DepositsB)) ; CBConservativeChoice OFF [create-LoanCBB-from CentralBank 0 ; Creation of link Central Bank -> Bank [set color Blue set Age 0 set AmountCBB (([DepositsB] of myself) - ([CashB] of myself)) ; Loan requested by the Bank: ([DepositsB] of myself) - ([CashB] of myself) ask end1 [set LoansCB (LoansCB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) set BanknotesInCirculation (BanknotesInCirculation + ([AmountCBB] of myself)) ] ask end2 [set CashB 0 set DepositsB 0 set DebtsB (DebtsB + (([AmountCBB] of myself) * ((1 + rCB) ^ (RepaymentPeriod / 360)))) ] ] ] [set DepositsB (DepositsB - CashB) ; The loan is not granted, Bank's default set CashB 0 set color Black ] ] ] ] ] ] set k (k + 1) ] ] set i (i + 1) ] ] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; INTEREST RATE ON DEPOSITS ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ask (Banks with [color = Red]) [set DepositsB (DepositsB * ((1 + rD) ^ (1 / 360))) ] tick end @#$#@#$#@ GRAPHICS-WINDOW 694 10 1134 471 -1 25 8.4314 1 10 1 1 1 0 0 0 1 0 50 -25 25 1 1 1 ticks 30.0 SLIDER 2 10 156 43 BanksInitialNumber BanksInitialNumber 0 20 10 1 1 NIL HORIZONTAL SLIDER 157 10 319 43 FirmsNumber FirmsNumber 0 200 100 1 1 NIL HORIZONTAL BUTTON 320 112 490 145 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 157 44 319 77 MaxInitialLiquidity MaxInitialLiquidity 0 1000 200 1 1 NIL HORIZONTAL BUTTON 491 112 693 145 NIL go T 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 2 78 156 111 Loan Loan 1 500 50 1 1 NIL HORIZONTAL SLIDER 320 78 490 111 RepaymentPeriod RepaymentPeriod 1 720 300 1 1 NIL HORIZONTAL SLIDER 157 146 319 179 rC rC 0 1 0.1 0.01 1 NIL HORIZONTAL SLIDER 320 146 490 179 rB rB 0 1 0.05 0.01 1 NIL HORIZONTAL SLIDER 157 78 319 111 Ave#LoansRequests Ave#LoansRequests 0 200 10 1 1 NIL HORIZONTAL SLIDER 491 146 693 179 rCB rCB 0 1 0.02 0.01 1 NIL HORIZONTAL SLIDER 320 44 490 77 MinCashForLoan MinCashForLoan 0 1000 500 1 1 NIL HORIZONTAL SLIDER 2 146 156 179 rD rD 0 1 0.01 0.01 1 NIL HORIZONTAL SLIDER 320 10 490 43 FamiliesTotalAssets FamiliesTotalAssets 0 10000 8000 1 1 NIL HORIZONTAL SLIDER 2 44 156 77 MinInitialLiquidity MinInitialLiquidity 0 500 100 1 1 NIL HORIZONTAL SLIDER 157 112 319 145 Ave#Withdrawal Ave#Withdrawal 0 20 3 1 1 NIL HORIZONTAL SLIDER 2 112 156 145 Withdrawal Withdrawal 0 500 10 1 1 NIL HORIZONTAL PLOT 2 472 373 701 ALIVE BANKS Time (days) Amount 0.0 10.0 0.0 10.0 true true "" "" PENS "AveCash" 1.0 0 -13840069 true "" "let BanksNumber (count Banks with [Color = Red])\nif (BanksNumber != 0)\n [plot (((sum [CashB] of (Banks with [Color = Red]))) / BanksNumber)\n ]" "AveLoans" 1.0 0 -2674135 true "" "let BanksNumber (count Banks with [Color = Red])\nif (BanksNumber != 0)\n [plot (((sum [LoansB] of (Banks with [Color = Red]))) / BanksNumber)\n ]" "AveDeposits" 1.0 0 -13345367 true "" "let BanksNumber (count Banks with [Color = Red])\nif (BanksNumber != 0)\n [plot (((sum [DepositsB] of (Banks with [Color = Red]))) / BanksNumber)\n ]" "AveDebts" 1.0 0 -5825686 true "" "let BanksNumber (count Banks with [Color = Red])\nif (BanksNumber != 0)\n [plot (((sum [DebtsB] of (Banks with [Color = Red]))) / BanksNumber)\n ]" PLOT 1135 472 1506 701 CENTRAL BANK Time (days) Amount 0.0 10.0 0.0 10.0 true true "" "" PENS "BanknotesInCirculation" 1.0 0 -13840069 true "" "plot (sum [BanknotesInCirculation] of CentralBanks)" "Loans" 1.0 0 -2674135 true "" "plot (sum [LoansCB] of CentralBanks)" PLOT 374 180 693 425 NUMBER OF ACTIVE LOANS Time (days) Amount 0.0 10.0 0.0 10.0 true true "" "" PENS "# LoansBF" 1.0 0 -13840069 true "" "plot count LoansBF" "# LoansBB" 1.0 0 -2674135 true "" "plot count LoansBB" "# LoansCBB" 1.0 0 -13345367 true "" "plot count LoansCBB" MONITOR 694 702 831 747 Banks in default count Banks with [color = Black] 17 1 11 MONITOR 1135 702 1317 747 BanknotesInCirculation sum [BanknotesInCirculation] of CentralBanks 4 1 11 MONITOR 1318 702 1506 747 Loans sum [LoansCB] of CentralBanks 4 1 11 MONITOR 182 702 285 747 AveDeposits ((sum [DepositsB] of (Banks with [Color = Red]))) / (count Banks with [Color = Red]) 4 1 11 MONITOR 2 702 87 747 AveCash ((sum [CashB] of (Banks with [Color = Red]))) / (count Banks with [Color = Red]) 4 1 11 MONITOR 88 702 181 747 AveLoans ((sum [LoansB] of (Banks with [Color = Red]))) / (count Banks with [Color = Red]) 4 1 11 MONITOR 286 702 373 747 AveDebts ((sum [DebtsB] of (Banks with [Color = Red]))) / (count Banks with [Color = Red]) 4 1 11 MONITOR 374 702 693 747 AveEquity ((sum [CashB] of (Banks with [color = Red])) + (sum [LoansB] of (Banks with [color = Red])) - (sum [DepositsB] of (Banks with [color = Red])) - (sum [DebtsB] of (Banks with [color = Red]))) / (count Banks with [Color = Red]) 4 1 11 MONITOR 374 426 471 471 #LoansBF count LoansBF 4 1 11 MONITOR 472 426 578 471 #LoansBB count LoansBB 4 1 11 MONITOR 579 426 693 471 #LoansCBB count LoansCBB 4 1 11 MONITOR 832 702 968 747 Banks in default % (count Banks with [color = Black]) / BanksInitialNumber 2 1 11 SLIDER 491 44 693 77 MaxBanknotesInCirculation MaxBanknotesInCirculation 0 20000 1000 1 1 NIL HORIZONTAL PLOT 2 180 373 425 FIRMS Time (days) Amount 0.0 10.0 0.0 10.0 true true "" "" PENS "# F. with the req. loan" 1.0 0 -13840069 true "" "plot count (Firms with [color = Blue])" "# F. without the req. loan" 1.0 0 -2674135 true "" "plot count (Firms with [color = Yellow])" MONITOR 2 426 190 471 # F. with the requested loan % (count (Firms with [color = Blue])) / FirmsNumber 4 1 11 MONITOR 185 426 373 471 # F. without the requested loan % (count (Firms with [color = Yellow])) / FirmsNumber 4 1 11 PLOT 374 472 693 701 ALIVE BANKS AVERAGE EQUITY Time (days) Amount 0.0 10.0 0.0 10.0 true false "" "" PENS "default" 1.0 0 -13840069 true "" "let BanksNumber (count Banks with [Color = Red])\nif (BanksNumber != 0)\n [plot (((sum [CashB] of (Banks with [Color = Red])) + (sum [LoansB] of Banks with [Color = Red]) - (sum [DepositsB] of Banks with [Color = Red]) - (sum [DebtsB] of Banks with [Color = Red]))/ BanksNumber)\n ]" "pen-1" 1.0 0 -2674135 true "" "plot 0" PLOT 694 472 1134 701 RISK OF DEFAULT FOR ALIVE BANKS INDEX Time (days) Amount 0.0 10.0 0.0 10.0 true true "set-plot-y-range 0 7.5" "set-plot-y-range 0 7.5" PENS "RDAB Index" 1.0 0 -13345367 true "" "let BanksNumber (count Banks with [Color = Red])\nif (BanksNumber != 0)\n [let AveCash ((sum ([CashB] of (Banks with [color = Red]))) / BanksNumber)\n let AveDeposits ((sum ([DepositsB] of (Banks with [color = Red]))) / BanksNumber)\n ifelse ((AveCash != 0) and ((AveDeposits / AveCash) <= 7.5))\n [plot (AveDeposits / AveCash)\n ]\n [plot 7.5\n ]\n ]" "Zero Risk" 1.0 0 -955883 true "" "plot 0" "Low Risk" 1.0 0 -2674135 true "" "plot 2.5" "Medium Risk" 1.0 0 -8053223 true "" "plot 5" "High Risk" 1.0 0 -13628663 true "" "plot 7.5" MONITOR 969 702 1134 747 RDAB Index (sum ([DepositsB] of (Banks with [color = Red]))) / (sum ([CashB] of (Banks with [color = Red]))) 4 1 11 SWITCH 491 78 693 111 CBConservativeChoice CBConservativeChoice 1 1 -1000 @#$#@#$#@ ## WHAT IS IT? The model describes a contemporary economic system composed by agents that are characterized by a precise economic condition and that interact on three types of market: the job market, the goods market and the financial market. The agents are divided into four different categories: Families, who hold a capital, provide work in exchange for wage, save and consume, Firms, that provide a wage for Families, produce goods and invest, Banks, which collecting deposits and making loans, participate in the circuit of money creation and a Central Bank which has the status of last resort lender. ## HOW IT WORKS The Initialization consists of three successive steps: - Defining the initial Banks cash - Payment of the FamiliesTotalAssets in Banks deposits - Application of the interest rate on deposits Defined the Initialization, each time interval (corresponding to a day) consists of six steps that determine the evolution of the system: - Loan requests from Firms - Payment in Bank deposits - Repayment of loans - Withdrawal from deposits - Withdrawal from deposits 2 - Application of the interest rate on deposits ## HOW TO USE IT - Adjust the slider parameters (see below). - Press the SETUP button. - Press the GO button to begin the simulation. Parameters that have to be choosen: - BanksInitialNumber: set the initial number of Banks. - FirmsNumber: set the initial number of Firms. - FamiliesTotalAssets: set the initial total assets of Families. - CentralBankInitialCash: set the initial cash of Central Bank. - MinInitialLiquidity: set the minimum initial cash of Banks. - MaxInitialLiquidity: set the maximum initial cash of Banks. - MinCashForLoan: set the minimum cash of Banks for the granting of a loan. - MinCashForLoanCB: set the minimum cash of Central Bank for the granting of a loan. - Loan: set the amount of a loan request by a Firm. - Ave#LoansRequests: set the average number of loans requests. - RepaymentPeriod: set the period of time for the repayment of a loan. - CBRiskAversion: set the strategy of Central Bank; "Risk aversion" (ON) and "Cooperation" (OFF). - Withdrawal: set the amount of a withdrawal from a deposit. - Ave#Withdrawal: set the average number of withdrawals from deposits. - rD: set the annual interest rate guaranteed by Banks on deposits. - rC: set the annual interest rate on Bank-Firm loans. - rB: set the annual interest rate on Bank-Bank loans. - rCB: set the annual interest rate on Central Bank-Bank loans. ## THINGS TO TRY Run the model considering a Central Bank adopting "Risk Aversion" and after, with the same setup, run the model considering a Central Bank adopting "Cooperation". This procedure allows to identify the differences that appear in the dynamics of the system for the two strategies adoptable by the Central Bank. ## EXTENDING THE MODEL An interesting modification of the model is to consider a heterogeneous set of Banks that have a relative size with an exponential dependence of their cardinality: the fraction of Families that at the initialization deposits their part of FamiliesTotalAssets in the deposits of the b-th Bank is exponentially proportional to b. ## CREDITS AND REFERENCES This model is based on the innovative paper Raberto M, Rapallo F, Scalas E (2011), Semi-Markov Graph Dynamics. PLoS ONE 6(8): e23370. doi:10.1371/journal.pone.0023370 http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0023370 From this paper started the master thesis of Marco Maria Bosco, 2013, "Simulazioni di Mercati del Credito: Il Modello di Mercato ad Agenti". See http://web.econ.unito.it/terna/tesi/bosco.pdf to view the complete text of the master's thesis where you'll find a full description of the code, a comprehensive study of the dynamics of the model and its possible applications to a real economic system. @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 15 165 260 250 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 building institution false 0 Rectangle -7500403 true true 0 60 300 270 Rectangle -16777216 true false 130 196 168 256 Rectangle -16777216 false false 0 255 300 270 Polygon -7500403 true true 0 60 150 15 300 60 Polygon -16777216 false false 0 60 150 15 300 60 Circle -1 true false 135 26 30 Circle -16777216 false false 135 25 30 Rectangle -16777216 false false 0 60 300 75 Rectangle -16777216 false false 218 75 255 90 Rectangle -16777216 false false 218 240 255 255 Rectangle -16777216 false false 224 90 249 240 Rectangle -16777216 false false 45 75 82 90 Rectangle -16777216 false false 45 240 82 255 Rectangle -16777216 false false 51 90 76 240 Rectangle -16777216 false false 90 240 127 255 Rectangle -16777216 false false 90 75 127 90 Rectangle -16777216 false false 96 90 121 240 Rectangle -16777216 false false 179 90 204 240 Rectangle -16777216 false false 173 75 210 90 Rectangle -16777216 false false 173 240 210 255 Rectangle -16777216 false false 269 90 294 240 Rectangle -16777216 false false 263 75 300 90 Rectangle -16777216 false false 263 240 300 255 Rectangle -16777216 false false 0 240 37 255 Rectangle -16777216 false false 6 90 31 240 Rectangle -16777216 false false 0 75 37 90 Line -16777216 false 112 260 184 260 Line -16777216 false 105 265 196 265 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 factory false 0 Rectangle -7500403 true true 76 194 285 270 Rectangle -7500403 true true 36 95 59 231 Rectangle -16777216 true false 90 210 270 240 Line -7500403 true 90 195 90 255 Line -7500403 true 120 195 120 255 Line -7500403 true 150 195 150 240 Line -7500403 true 180 195 180 255 Line -7500403 true 210 210 210 240 Line -7500403 true 240 210 240 240 Line -7500403 true 90 225 270 225 Circle -1 true false 37 73 32 Circle -1 true false 55 38 54 Circle -1 true false 96 21 42 Circle -1 true false 105 40 32 Circle -1 true false 129 19 42 Rectangle -7500403 true true 14 228 78 270 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 sheep false 0 Rectangle -7500403 true true 151 225 180 285 Rectangle -7500403 true true 47 225 75 285 Rectangle -7500403 true true 15 75 210 225 Circle -7500403 true true 135 75 150 Circle -16777216 true false 165 76 116 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 5.0.4 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ setup go count Banks with [color = Red] setup go (count Banks with [color = Red]) = 0 sum [BanknotesInCirculation] of CentralBanks setup go (count Banks with [color = Red]) = 0 ticks setup go (count Banks with [color = Red]) = 0 ticks setup go (count Banks with [color = Red]) = 0 ticks setup go (count Banks with [color = Red]) = 0 sum [BanknotesInCirculation] of CentralBanks setup go (count Banks with [color = Red]) = 0 count LoansBF setup go (count Banks with [color = Red]) = 0 count LoansBB setup go (count Banks with [color = Red]) = 0 count Banks with [color = Red] @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 1.0 0.0 0.0 1 1.0 0.0 0.2 0 1.0 0.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@