ICEACE Model: Closed Economy  1.0.0
Design Documentation of ICEACE Model
 All Data Structures Files Functions Variables Typedefs Macros Pages
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  */
12 {
13  double amount = 0;
15  amount = capital_tax_message->amount;
16  CAPITAL_TAX_INCOME += amount;
17  LIQUIDITY += amount;
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  */
28 {
29  double amount = 0;
30 
33  CENTRALBANK_INCOME += amount;
34  LIQUIDITY += amount;
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  */
45 {
48 
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  */
65  GENERAL_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  */
77 {
78  double amount = 0;
79 
80  if (LIQUIDITY < 0) {
81  amount = -1 * LIQUIDITY;
83  DEBT += amount;
84  LIQUIDITY = 0;
85  }
86 
87  if (LIQUIDITY > 0) {
88  if (DEBT < LIQUIDITY) {
90  LIQUIDITY -= DEBT;
91  DEBT = 0;
92  } else {
94  DEBT -= LIQUIDITY;
95  LIQUIDITY = 0;
96  }
97  }
98 
99  EQUITY = LIQUIDITY - DEBT;
100 
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  */
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;
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;
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){
156  }
157 
158  if (GOV_GENERAL_BENEFIT_RATE < 0){
160  }
161 
162 
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  */
174 {
175  double amount = 0;
177  amount = labour_tax_message->amount;
178  LABOUR_TAX_INCOME += amount;
179  LIQUIDITY += amount;
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  */
189 {
190  double benefit = 0;
191  double total_benefits;
192 
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  */
207 {
208  double benefit = 0;
209  double total_benefits;
210 
211  benefit = AVERAGE_WAGE * 0.5;
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