ICEACE Model: Closed Economy
1.0.0
Design Documentation of ICEACE Model
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Macros
Pages
IceaceModel1.0
Market_Credit
government_functions_credit.c
Go to the documentation of this file.
1
#include "../header.h"
2
#include "../government_agent_header.h"
3
4
5
6
7
/*
8
* \fn: int government_collect_capital_tax()
9
* \brief:
10
*/
11
int
government_collect_capital_tax
()
12
{
13
double
amount = 0;
14
START_CAPITAL_TAX_MESSAGE_LOOP
15
amount =
capital_tax_message
->
amount
;
16
CAPITAL_TAX_INCOME
+= amount;
17
LIQUIDITY
+= amount;
18
FINISH_CAPITAL_TAX_MESSAGE_LOOP
19
20
return
0;
/* Returning zero means the agent is not removed */
21
}
22
23
/*
24
* \fn: int government_collect_centralbank_profit()
25
* \brief:
26
*/
27
int
government_collect_centralbank_profit
()
28
{
29
double
amount = 0;
30
31
START_CENTRALBANK_GOVERNMENT_PROFIT_MESSAGE_LOOP
32
amount =
centralbank_government_profit_message
->
amount
;
33
CENTRALBANK_INCOME
+= amount;
34
LIQUIDITY
+= amount;
35
FINISH_CENTRALBANK_GOVERNMENT_PROFIT_MESSAGE_LOOP
36
37
return
0;
/* Returning zero means the agent is not removed */
38
}
39
40
/*
41
* \fn: int government_compute_income_statement()
42
* \brief: Government computes income statement.
43
*/
44
int
government_compute_income_statement
()
45
{
46
EARNINGS
=
CAPITAL_TAX_INCOME
+
LABOUR_TAX_INCOME
+
CENTRALBANK_INCOME
;
47
EXPENDITURES
=
UNEMPLOYMENT_BENEFITS
+
GENERAL_BENEFITS
;
48
49
if
(
DATA_COLLECTION_MODE
) {
50
char
* filename;
51
FILE * file1;
52
filename = malloc(100*
sizeof
(
char
));
53
filename[0]=0;
54
strcpy(filename,
"./outputs/data/Government_snapshot.txt"
);
55
file1 = fopen(filename,
"a"
);
56
fprintf(file1,
"%d %f %f %f %f %f %f %f %f %f %f %f %f %f %f\n"
,
IT_NO
,
UNEMPLOYMENT_RATE
,
AVERAGE_WAGE
,
LABOUR_TAX_RATE
,
CAPITAL_TAX_RATE
,
GOV_GENERAL_BENEFIT_RATE
,
LABOUR_TAX_INCOME
,
CAPITAL_TAX_INCOME
, CENTRALBANK_INCOME,
UNEMPLOYMENT_BENEFITS
, GENERAL_BENEFITS,
LIQUIDITY
,
DEBT
,
EARNINGS
,
EXPENDITURES
);
57
fclose(file1);
58
free(filename);
59
}
60
61
/* These values can be kept longer to be able to implement long term government fiscal policy decisions.
62
*/
63
CAPITAL_TAX_INCOME
= 0;
64
LABOUR_TAX_INCOME
= 0;
65
GENERAL_BENEFITS = 0;
66
UNEMPLOYMENT_BENEFITS
= 0;
67
CENTRALBANK_INCOME = 0;
68
return
0;
/* Returning zero means the agent is not removed */
69
}
70
71
72
/*
73
* \fn: int government_do_balance_sheet()
74
* \brief: Government does the balance sheet accounting.
75
*/
76
int
government_do_balance_sheet
()
77
{
78
double
amount = 0;
79
80
if
(
LIQUIDITY
< 0) {
81
amount = -1 *
LIQUIDITY
;
82
add_gov_centralbank_debt_request_message
(amount);
83
DEBT
+= amount;
84
LIQUIDITY
= 0;
85
}
86
87
if
(
LIQUIDITY
> 0) {
88
if
(
DEBT
<
LIQUIDITY
) {
89
add_gov_centralbank_debt_payment_message
(
DEBT
);
90
LIQUIDITY
-=
DEBT
;
91
DEBT
= 0;
92
}
else
{
93
add_gov_centralbank_debt_payment_message
(
LIQUIDITY
);
94
DEBT
-=
LIQUIDITY
;
95
LIQUIDITY
= 0;
96
}
97
}
98
99
EQUITY
=
LIQUIDITY
-
DEBT
;
100
101
add_gov_centralbank_update_deposit_message
(
LIQUIDITY
);
102
103
return
0;
/* Returning zero means the agent is not removed */
104
}
105
106
107
/*
108
* \fn: int government_update_fiscal_policy()
109
* \brief:
110
*/
111
int
government_update_fiscal_policy
()
112
{
113
double
balance;
114
double
dTax;
115
double
dBenefit;
116
117
118
balance =
EARNINGS
-
EXPENDITURES
;
119
120
121
if
(balance <= 0) {
122
dTax =
RATIO_FISCAL_POLICY
* 0.05;
123
dBenefit = (1-
RATIO_FISCAL_POLICY
) * 0.05;
124
LABOUR_TAX_RATE
=
LABOUR_TAX_RATE
+ dTax;
125
CAPITAL_TAX_RATE
=
CAPITAL_TAX_RATE
+ dTax;
126
GOV_GENERAL_BENEFIT_RATE
=
GOV_GENERAL_BENEFIT_RATE
- dBenefit;
127
}
128
129
/* The increment portion (0.05) and threshold below (500) is picked from the model description.
130
However, I suggest this be parameterized and be treated as one of policy parameters. bulent.
131
*/
132
if
(balance >
POPULATION_SIZE
/16){
133
dTax = (1 -
RATIO_FISCAL_POLICY
) * 0.05;
134
dBenefit =
RATIO_FISCAL_POLICY
* 0.05;
135
LABOUR_TAX_RATE
=
LABOUR_TAX_RATE
- dTax;
136
CAPITAL_TAX_RATE
=
CAPITAL_TAX_RATE
- dTax;
137
GOV_GENERAL_BENEFIT_RATE
=
GOV_GENERAL_BENEFIT_RATE
+ dBenefit;
138
}
139
140
if
(
CAPITAL_TAX_RATE
> 0.5) {
141
CAPITAL_TAX_RATE
= 0.5;
142
}
143
if
(
CAPITAL_TAX_RATE
< 0.1) {
144
CAPITAL_TAX_RATE
= 0.1;
145
}
146
147
if
(
LABOUR_TAX_RATE
> 0.5) {
148
LABOUR_TAX_RATE
= 0.5;
149
}
150
if
(
LABOUR_TAX_RATE
< 0.1) {
151
LABOUR_TAX_RATE
= 0.1;
152
}
153
154
if
(
GOV_GENERAL_BENEFIT_RATE
> 0.5){
155
GOV_GENERAL_BENEFIT_RATE
= 0.5;
156
}
157
158
if
(
GOV_GENERAL_BENEFIT_RATE
< 0){
159
GOV_GENERAL_BENEFIT_RATE
= 0;
160
}
161
162
163
add_labour_tax_rate_message
(
LABOUR_TAX_RATE
);
164
add_capital_tax_rate_message
(
CAPITAL_TAX_RATE
);
165
166
return
0;
/* Returning zero means the agent is not removed */
167
}
168
169
/*
170
* \fn: int government_collect_labour_tax()
171
* \brief: Monthly collected labour tax.
172
*/
173
int
government_collect_labour_tax
()
174
{
175
double
amount = 0;
176
START_LABOUR_TAX_MESSAGE_LOOP
177
amount =
labour_tax_message
->
amount
;
178
LABOUR_TAX_INCOME
+= amount;
179
LIQUIDITY
+= amount;
180
FINISH_LABOUR_TAX_MESSAGE_LOOP
181
return
0;
/* Returning zero means the agent is not removed */
182
}
183
184
/*
185
* \fn: int government_distribute_general_benefits()
186
* \brief: All households recieve equal amount of benefits.
187
*/
188
int
government_distribute_general_benefits
()
189
{
190
double
benefit = 0;
191
double
total_benefits;
192
193
benefit =
AVERAGE_WAGE
*
GOV_GENERAL_BENEFIT_RATE
;
194
add_general_benefit_message
(benefit);
195
total_benefits = benefit *
POPULATION_SIZE
;
196
GENERAL_BENEFITS
+= total_benefits;
197
LIQUIDITY
-= total_benefits;
198
199
return
0;
/* Returning zero means the agent is not removed */
200
}
201
202
/*
203
* \fn: int government_distribute_unemployment_benefits()
204
* \brief:
205
*/
206
int
government_distribute_unemployment_benefits
()
207
{
208
double
benefit = 0;
209
double
total_benefits;
210
211
benefit =
AVERAGE_WAGE
* 0.5;
212
add_unemployment_benefit_message
(benefit);
213
total_benefits = benefit *
POPULATION_SIZE
*
UNEMPLOYMENT_RATE
;
214
UNEMPLOYMENT_BENEFITS
+= total_benefits;
215
LIQUIDITY
-= total_benefits;
216
217
return
0;
/* Returning zero means the agent is not removed */
218
}
219
220
Generated on Tue Apr 8 2014 13:25:19 for ICEACE Model: Closed Economy by
1.8.3.1