ICEACE Model: Closed Economy  1.0.0
Design Documentation of ICEACE Model
 All Data Structures Files Functions Variables Typedefs Macros Pages
government_functions_labour.c
Go to the documentation of this file.
1 #include "../header.h"
2 #include "../government_agent_header.h"
3 
4 /*
5  * \fn: int government_trace_unemployment_status()
6  * \brief: Government collects info from the population to keep trace
7  * of average wages and number of households in the population.
8  */
10  int unemployed = 0;
11  double total_wages = 0;
12  int total = 0;
13  int id;
16  if (id == 0) {
17  unemployed++;
18  }
19  else{
20  total_wages += employment_status_message->wage;
21  }
22  total++;
24 
25  if (total == 0 || unemployed == total) {
26  UNEMPLOYMENT_RATE = 1.0;
27  AVERAGE_WAGE = 0;
28  } else {
29  UNEMPLOYMENT_RATE = (double) unemployed / total;
30  AVERAGE_WAGE = total_wages / (total - unemployed);
31  }
32  POPULATION_SIZE = total;
33 
34 
35  return 0; /* Returning zero means the agent is not removed */
36 }