18 int firm_type, firm_id, household_id;
19 int nhouseholds, nrfirms, ncfirms;
20 int constructor_firm_size, employment_size;
33 add_int(&household_list, household_id);
36 nhouseholds = household_list.
size;
37 if (nhouseholds == 0 ) {
39 printf(
"Warning @jpoffice_init_employment(): No household is detected at initiliazation.\n");
52 add_int(®ular_firm_list, firm_id);
54 add_int(&constructor_firm_list, firm_id);
58 nrfirms = regular_firm_list.
size;
59 ncfirms = constructor_firm_list.
size;
65 constructor_firm_size = (int) (nhouseholds * 0.075 / ncfirms);
66 employment_size = (int) (nhouseholds * 0.95);
69 printf(
"nRFirms: %d nCFirms: %d, nHH: %d\n", nrfirms, ncfirms, nhouseholds);
70 printf(
"nCFirm Size: %d, nEmployment: %d\n", constructor_firm_size, employment_size);
74 for (i = 0; i < ncfirms; i++) {
75 if (nemployed > employment_size) {
77 printf(
"Warning @jpoffice_init_employment(): There are more constructor firms then employable number of households.\n");
84 firm_id = constructor_firm_list.
array[i];
85 household_id = household_list.
array[0];
94 for (i = 0; i < nrfirms; i++) {
95 if (nemployed > employment_size) {
97 printf(
"Warning @jpoffice_init_employment(): There are more firms then employable number of households.\n");
104 firm_id = regular_firm_list.
array[i];
105 household_id = household_list.
array[0];
114 for (i = 0; i < ncfirms; i++) {
115 firm_id = constructor_firm_list.
array[0];
116 for (j = 1; j < constructor_firm_size; j++) {
117 if (nemployed > employment_size) {
119 printf(
"Warning @jpoffice_init_employment(): Household shortage is observed at assigning additional labour to constructor firms.\n");
126 household_id = household_list.
array[0];
140 if (nemployed > employment_size){
145 firm_id = regular_firm_list.
array[i];
146 household_id = household_list.
array[0];
154 printf(
"Number of total employement %d\n", nemployed);