-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagents.h
More file actions
49 lines (42 loc) · 1004 Bytes
/
Copy pathagents.h
File metadata and controls
49 lines (42 loc) · 1004 Bytes
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
#ifndef _AGENTS_H_
#define _AGENTS_H_
#include <vector>
#include <random>
class Firms
{
public:
int numberOfFirms;
float alpha = 0.1;
float varpf = 0.4;
unsigned int seed;
std::mt19937 gen;
std::vector<float> price;
std::normal_distribution<float> price_dist{alpha, std::sqrt(varpf)};
std::vector<float> debt;
std::vector<float> networth;
std::vector<float> profit;
std::vector<float> interestRate;
std::vector<float> leverage;
std::vector<float> capital;
std::vector<float> output;
std::vector<float> lgdf;
std::vector<float> defaulted;
Firms(int nFirms);
bool isDefaulted(int firm);
};
class Banks
{
public:
int numberOfBanks;
std::vector<float> interestRate;
std::vector<float> networth;
std::vector<float> deposit;
std::vector<float> badDebt;
std::vector<float> profit;
std::vector<float> creditLinkDegree;
std::vector<float> nonPerformingLoans;
std::vector<float> defaulted;
Banks(int nBanks);
bool isDefaulted(int bank);
};
#endif