eos.bank
Class Bank

java.lang.Object
  extended by eos.bank.Bank

public class Bank
extends java.lang.Object

Simplified Bank. There is only one bank in the current model. Each agent has an account and several subaccounts, which are balance (main bank account) mortgages (outstanding mortgage loans, which are contracts) interest (per-step) revenue (per-step) savedRevenue -- saved revenue for dumping as data, and use in CGFirm.act savedInterest -- saved interest for possible dumping as data, and use in CGFirm.act payments (per-step) wage (per-step) Smoothed versions of these are also maintained here. A positive balance in an account signifies assets and earns interest. A negative balance signifies loans and pays interest. There are two interest rates, loan interest rate and deposit interest rate, but for now we are taking depositIR = loanIR. loanIR is determined by an adaptive algorithm using parameter tau and some measure of the imbalance in the bank's reserve --> this is the subject of current experimentation bankReserve is the alegraic sum of all balances: deposits, which are positive, and loans, which are negative. mortgages is the total amount on loan by the firms for their purchases of capital, and each mortgage payment pays back the bank some principle and some interest on purchase of a mortgage for a machine, cash flows from the bank's reserve to the capital firm that produced the machine; this is repaid by the purchasing firm to the bank in equal installments determined by the standard mortgage formulas


Nested Class Summary
static class Bank.Account
          An account of an agent
 
Field Summary
static double DELTA_TC
          time constant for exponential smoothing of smoothed interest rate
static double INIT_BANK_RESERVE
          initial bank reserve
static double INIT_LOAN_IR
          initial loan interest rate
static double IR_TC
          time constant for exponential smoothing of smoothed interest rate
static double loanIR
           
static double MAX_LOAN_IR
          max loan interest rate
static double MIN_LOAN_IR
          min loan interest rate
static double SUBACCOUNT_TC
          time constant for exponential smoothing of subaccounts
static double tau
          sensitivity of interest rate to a change in total loan
 
Constructor Summary
Bank()
           
 
Method Summary
static void act()
          Called by Economy.step() at the beginning of every time step balance is treated algebraically, negative is loan
static void buyMortgage(int payerID, double paymentTotalMortgage)
          ownerID takes out mortgage for a new machine incurring a debt of paymentTotalMortgage to owner's acct
static void closeAcct(int agentID)
          Close an account
static Bank.Account getAcct(int agentID)
          Return a reference to the agent's account
static double getBalance(int agentID)
          Return the balance of the specified account
static double getBankReserve()
          Return the total reserve in the last step
static double getCapitalDemand()
          Return demand for capital
static double getDelta()
          Return delta, used to adjust loanIR
static double getDepositIR()
          Return the deposit interest rate in the last step
static double getLoanIR()
          Return the loan interest rate in the last step
static double getM0()
          Return the narrow money supply M0
static double getSmoothedCapitalDemand()
          Return smoothed demand for capital
static double getSmoothedDepositIR()
          Return the long-term deposit interest rate in the last step
static double getSmoothedSupplyOfLoans()
          Return smoothed supply of loans
static double getTotalDeposits()
          Return the total deposits in the last step
static double getTotalLoans()
          Return the total loans in the last step
static double getTotalMortgages()
          Return the total mortgages in the last step this is recomputed when called as is therefore up-to-date
static void openAcct(int agentID, double initBal, double initMort, double initInt, double initRev, double initPay, double initWage)
          Open an account
static void pay(int payerID, int payeeID, double amt)
          Transfer amt from payer's account to payee's account.
static void payFrom(int payerID, double amt)
          Deduct amt from the payer's account.
static void payMortgage(int payerID, double paymentInterest, double paymentPrinciple)
          Bank collects mortgage payments from ownerID, called from Capital.useCapital charge paymentInterest and paymentPrinciple to owner's account, put that in bankReserve; also keep track of mortgages
static void payTo(int payeeID, double amt)
          Add amt to payee's account.
static void updateSubAccounts()
          update smoothed values of subaccounts save revenue for data dump in Economy reset /per-step/ subaccounts: interest, revenue, payments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT_LOAN_IR

public static final double INIT_LOAN_IR
initial loan interest rate

See Also:
Constant Field Values

INIT_BANK_RESERVE

public static final double INIT_BANK_RESERVE
initial bank reserve

See Also:
Constant Field Values

tau

public static double tau
sensitivity of interest rate to a change in total loan


IR_TC

public static final double IR_TC
time constant for exponential smoothing of smoothed interest rate

See Also:
Constant Field Values

DELTA_TC

public static final double DELTA_TC
time constant for exponential smoothing of smoothed interest rate

See Also:
Constant Field Values

SUBACCOUNT_TC

public static final double SUBACCOUNT_TC
time constant for exponential smoothing of subaccounts

See Also:
Constant Field Values

MAX_LOAN_IR

public static double MAX_LOAN_IR
max loan interest rate


MIN_LOAN_IR

public static double MIN_LOAN_IR
min loan interest rate


loanIR

public static double loanIR
Constructor Detail

Bank

public Bank()
Method Detail

openAcct

public static void openAcct(int agentID,
                            double initBal,
                            double initMort,
                            double initInt,
                            double initRev,
                            double initPay,
                            double initWage)
Open an account

Parameters:
agentID -

closeAcct

public static void closeAcct(int agentID)
Close an account

Parameters:
agentID -

getBalance

public static double getBalance(int agentID)
Return the balance of the specified account

Parameters:
agentID -
Returns:
the balance of the specified account

getAcct

public static Bank.Account getAcct(int agentID)
Return a reference to the agent's account

Parameters:
agentID -
Returns:
a reference to the agent's account

payFrom

public static void payFrom(int payerID,
                           double amt)
Deduct amt from the payer's account. If the payer's account contains insufficient funds, the balance becomes negative and represents a loan

Parameters:
payerID -
amt - amount to be paid

payTo

public static void payTo(int payeeID,
                         double amt)
Add amt to payee's account.

Parameters:
payeeID -
amt - amount to be paid

pay

public static void pay(int payerID,
                       int payeeID,
                       double amt)
Transfer amt from payer's account to payee's account. If the payer's account has a balance less than amt, the balance becomes negative and represents a loan

Parameters:
payerID -
payeeID -
amt - amount to be paid

act

public static void act()
Called by Economy.step() at the beginning of every time step balance is treated algebraically, negative is loan


getLoanIR

public static double getLoanIR()
Return the loan interest rate in the last step

Returns:
the loan interest rate in the last step

getDepositIR

public static double getDepositIR()
Return the deposit interest rate in the last step

Returns:
the deposit interest rate in the last step

getSmoothedDepositIR

public static double getSmoothedDepositIR()
Return the long-term deposit interest rate in the last step

Returns:
the long-term deposit interest rate in the last step

getTotalLoans

public static double getTotalLoans()
Return the total loans in the last step

Returns:
the total loans in the last step

getTotalMortgages

public static double getTotalMortgages()
Return the total mortgages in the last step this is recomputed when called as is therefore up-to-date

Returns:
the total mortgages in the last step

getTotalDeposits

public static double getTotalDeposits()
Return the total deposits in the last step

Returns:
the total deposits in the last step

getBankReserve

public static double getBankReserve()
Return the total reserve in the last step

Returns:
the total reserve in the last step

getM0

public static double getM0()
Return the narrow money supply M0

Returns:
the narrow money supply M0

getCapitalDemand

public static double getCapitalDemand()
Return demand for capital

Returns:
demand for capital

getSmoothedCapitalDemand

public static double getSmoothedCapitalDemand()
Return smoothed demand for capital

Returns:
smoothed demand for capital

getSmoothedSupplyOfLoans

public static double getSmoothedSupplyOfLoans()
Return smoothed supply of loans

Returns:
smoothed supply of loans

getDelta

public static double getDelta()
Return delta, used to adjust loanIR

Returns:
delta, used to adjust loanIR

payMortgage

public static void payMortgage(int payerID,
                               double paymentInterest,
                               double paymentPrinciple)
Bank collects mortgage payments from ownerID, called from Capital.useCapital charge paymentInterest and paymentPrinciple to owner's account, put that in bankReserve; also keep track of mortgages

Parameters:
payerID -
paymentInterest - part of mortgage payment that is interest
paymentPrinciple - part of mortgage payment that is principle

buyMortgage

public static void buyMortgage(int payerID,
                               double paymentTotalMortgage)
ownerID takes out mortgage for a new machine incurring a debt of paymentTotalMortgage to owner's acct

Parameters:
payerID -
paymentTotalMortgage - total loan represented by mortgage

updateSubAccounts

public static void updateSubAccounts()
update smoothed values of subaccounts save revenue for data dump in Economy reset /per-step/ subaccounts: interest, revenue, payments