-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimulation.h
65 lines (58 loc) · 1.35 KB
/
simulation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef _SIMULATION_H_
#define _SIMULATION_H_
#include <vector>
#include "agents.h"
class Simulation
{
public:
// parameters
int time = 2000;
int numberOfFirms;
int numberOfBanks;
float alpha = 0.2;
float varpf = 0.4;
float gamma = 0.02;
int chi = 5;
int lambd = 4;
float adj = 0.1;
int phi = 3;
float beta = 0.7;
float rCB = 0.02;
float cB = 0.01;
int seed = 10000;
// Agents
Firms firms;
Banks banks;
// Firm-bank adjacency matrix
std::vector<std::vector<int>> link_fb;
// Model outputs
std::vector<float> GDP;
std::vector<float> totalCapital;
std::vector<float> avgFirmPrice;
std::vector<float> totalWealth;
std::vector<float> totalDebt;
// Constructor
Simulation(int nFirms, int nBanks);
// Methods
int findBestBank(std::vector<int> potentialPartners);
void findMatchings(int p_time);
std::vector<int> findBankCustomers(int bank);
void calculateDeposits();
float getMaxFirmWealth();
void replaceDefaults();
void updateInterestRates();
void updateFirmDebt();
void updateFirmCapital();
void updateFirmOutput();
void updateFirmPrice();
void updateFirmInterestRate();
void updateFirmProfit();
void updateFirmNetworth();
void updateFirmLeverage();
void updateBankNetworth();
void updateLossRatio();
void reportResults(int p_time);
void saveResults();
void run();
};
#endif