|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objecteos.bank.Bank
public class Bank
Bank. There is only one bank in the current model. Each agent has a checking account and a savings account. All transactions are settled exclusively through transfers between the checking accounts. A positive balance in the savings account signifies deposit and earns interest. A negative balance signifies loans and pays interest. There are two interest rates - loan interest rate and deposit interest rate. Loan interest rate is determined by the demand and supply of loans. Deposit interest rate is computed by distributing interest payment from all debtors to creditors.
Nested Class Summary | |
---|---|
static class |
Bank.Account
An account of an agent |
Field Summary | |
---|---|
static int |
CHECKING
account type - checking account |
static double |
INIT_LOAN_IR
initial loan interest rate |
static double |
IR0
interest rate when total loan == total deposit |
static int |
LT_IR_WIN
time window within which long-term interest rate is measured |
static double |
MAX_LOAN_IR
max loan interest rate |
static double |
MIN_LOAN_IR
min loan interest rate |
static int |
OTHER
other payment |
static int |
PRIIC
primary income: wage for laborers, sales revenue for firms |
static int |
SAVINGS
account type - savings account |
static int |
SECIC
secondary income: e.g. |
static double |
tao
sensitivity of interest rate to a change in total loan |
Constructor Summary | |
---|---|
Bank()
|
Method Summary | |
---|---|
static void |
act()
Called by Economy.step() in every time step |
static void |
closeAcct(int agentID)
Close an account |
static double |
deposit(int agentID,
double amt)
Deposit amt from agent's checking account to the savings account. |
static Bank.Account |
getAcct(int agentID)
Return a reference to the agent's account |
static double |
getBalance(int agentID,
int acctType)
Return the balance of the specified account |
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 |
getLTDepositIR()
Return the long-term deposit interest rate in the last step |
static double |
getLTLoanIR()
Return the long-term loan interest rate in the last step |
static double |
getTotalDeposit()
Return the total deposit in the last step |
static double |
getTotalLoan()
Return the total loan in the last step |
static void |
openAcct(int agentID,
double initCheckingBal,
double initSavingsBal)
Open an account, which includes a checking account and a savings account; |
static void |
pay(int payerID,
int payeeID,
double amt,
int purpose)
Transfer amt from payer's checking account to payee's checking account. |
static void |
payFrom(int payerID,
double amt)
Deduct amt from the payer's checking account. |
static void |
payTo(int payeeID,
double amt,
int purpose)
Add amt to payee's checking account. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double INIT_LOAN_IR
public static final double IR0
public static double tao
public static final int LT_IR_WIN
public static double MAX_LOAN_IR
public static double MIN_LOAN_IR
public static final int CHECKING
public static final int SAVINGS
public static final int PRIIC
public static final int SECIC
public static final int OTHER
Constructor Detail |
---|
public Bank()
Method Detail |
---|
public static void openAcct(int agentID, double initCheckingBal, double initSavingsBal)
agentID
- initCheckingBal
- initial checking account balanceinitSavingsBal
- initial savings account balancepublic static void closeAcct(int agentID)
agentID
- public static double getBalance(int agentID, int acctType)
agentID
- acctType
- account type, either CHECKING or SAVINGS
public static Bank.Account getAcct(int agentID)
agentID
-
public static void payFrom(int payerID, double amt)
payerID
- amt
- amount to be paidpublic static void payTo(int payeeID, double amt, int purpose)
payeeID
- amt
- amount to be paidpurpose
- purpose of the payment (either PRIIC or SECIC)public static void pay(int payerID, int payeeID, double amt, int purpose)
payerID
- payeeID
- amt
- amount to be paidpurpose
- either PRIIC or SECICpublic static double deposit(int agentID, double amt)
agentID
- amt
- amount to be paid
public static void act()
public static double getLoanIR()
public static double getDepositIR()
public static double getLTDepositIR()
public static double getLTLoanIR()
public static double getTotalLoan()
public static double getTotalDeposit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |