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_Labour
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
*/
9
int
government_trace_unemployment_status
(){
10
int
unemployed = 0;
11
double
total_wages = 0;
12
int
total = 0;
13
int
id;
14
START_EMPLOYMENT_STATUS_MESSAGE_LOOP
15
id
=
employment_status_message
->
employer_id
;
16
if
(
id
== 0) {
17
unemployed++;
18
}
19
else
{
20
total_wages +=
employment_status_message
->
wage
;
21
}
22
total++;
23
FINISH_EMPLOYMENT_STATUS_MESSAGE_LOOP
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
}
Generated on Tue Apr 8 2014 13:25:19 for ICEACE Model: Closed Economy by
1.8.3.1