ICEACE Model: Closed Economy  1.0.0
Design Documentation of ICEACE Model
 All Data Structures Files Functions Variables Typedefs Macros Pages
header.h
Go to the documentation of this file.
1 
5 #ifndef _HEADER_H
6 #define _HEADER_H
7 
8 #ifdef _DEBUG_MODE
9  #define ERRCHECK
10 #else
11  #define NDEBUG
12 #endif
13 
14 #include <assert.h>
15 #include <stdlib.h>
16 #include <string.h>
17 #include <stdio.h>
18 #include <math.h>
19 #include <limits.h>
20 #include "mboard.h"
21 
22 #define FLAME_TEST_PRINT_START_AND_END_OF_MODEL_FUNCTIONS 0
23 #define FLAME_TEST_PRINT_START_AND_END_OF_LIBMBOARD_CALLS 0
24 #define FLAME_USE_FILTERS_IN_SYNC 1
25 
26 
27 /* Checking macros */
28 #ifdef CHECK_MEMORY
29 #define CHECK_POINTER(PT) if(PT==NULL){printf("**** ERROR in Memory check 1\n");exit(1);}
30 #else
31 #define CHECK_POINTER(PT)
32 #endif
33 
34 
37 #define RESUME_MODE (FLAME_get_environment_variable_resume_mode())
38 
40 #define PRINT_DEBUG_MODE (FLAME_get_environment_variable_print_debug_mode())
41 
43 #define WARNING_MODE (FLAME_get_environment_variable_warning_mode())
44 
46 #define DATA_COLLECTION_MODE (FLAME_get_environment_variable_data_collection_mode())
47 
49 #define COLLECT_HOUSEHOLD_DATA (FLAME_get_environment_variable_collect_household_data())
50 
52 #define COLLECT_FIRM_DATA (FLAME_get_environment_variable_collect_firm_data())
53 
55 #define RATIO_LIQUIDITY (FLAME_get_environment_variable_ratio_liquidity())
56 
58 #define CONSUMPTION_ADJUSTMENT_SPEED (FLAME_get_environment_variable_consumption_adjustment_speed())
59 
61 #define WEALTH_EFFECT (FLAME_get_environment_variable_wealth_effect())
62 
64 #define TURNOVER_PROBABILITY (FLAME_get_environment_variable_turnover_probability())
65 
67 #define PRODUCTION_MARKUP (FLAME_get_environment_variable_production_markup())
68 
70 #define PRICE_MARKUP (FLAME_get_environment_variable_price_markup())
71 
73 #define FIRM_MEMORY_PERSISTANCE (FLAME_get_environment_variable_firm_memory_persistance())
74 
76 #define RATIO_FISCAL_POLICY (FLAME_get_environment_variable_ratio_fiscal_policy())
77 
79 #define RATIO_CAPITALIST_HOUSEHOLDS (FLAME_get_environment_variable_ratio_capitalist_households())
80 
82 #define INFLATION_TARGET (FLAME_get_environment_variable_inflation_target())
83 
85 #define FIRMS_MINIMUM_EQUITY_RATIO (FLAME_get_environment_variable_firms_minimum_equity_ratio())
86 
88 #define FIRM_STARTUP_LEVERAGE (FLAME_get_environment_variable_firm_startup_leverage())
89 
91 #define HOUSEHOLD_STARTUP_LEVERAGE (FLAME_get_environment_variable_household_startup_leverage())
92 
94 #define CAR_BUFFER_THRESHOLD (FLAME_get_environment_variable_car_buffer_threshold())
95 
97 #define HOUSING_MARKET_ENTRANCE_PROB (FLAME_get_environment_variable_housing_market_entrance_prob())
98 
100 #define FIRE_SALE_THRESHOLD (FLAME_get_environment_variable_fire_sale_threshold())
101 
103 #define HOUSEHOLD_BUDGET_CONSTRAINT (FLAME_get_environment_variable_household_budget_constraint())
104 
106 #define CAPITAL_ADEQUECY_RATIO (FLAME_get_environment_variable_capital_adequecy_ratio())
107 
109 #define HOUSING_PRICE_UP_RATE (FLAME_get_environment_variable_housing_price_up_rate())
110 
112 #define HOUSING_PRICE_DOWN_RATE (FLAME_get_environment_variable_housing_price_down_rate())
113 
115 #define HOUSEHOLD_MORTGAGE_WRITEOFF_HIGH (FLAME_get_environment_variable_household_mortgage_writeoff_high())
116 
118 #define HOUSEHOLD_MORTGAGE_WRITEOFF_LOW (FLAME_get_environment_variable_household_mortgage_writeoff_low())
119 
121 #define ARRAY_BLOCK_SIZE 10
122 
128 #define ARRAY_GROWTH_RATE 1.618034
129 
131 #define START_FIRM_BANK_INIT_LOANS_MESSAGE_LOOP for(firm_bank_init_loans_message = get_first_firm_bank_init_loans_message(); firm_bank_init_loans_message != NULL; firm_bank_init_loans_message = get_next_firm_bank_init_loans_message(firm_bank_init_loans_message)) {
132 
134 #define FINISH_FIRM_BANK_INIT_LOANS_MESSAGE_LOOP }
135 
137 #define START_FIRM_BANK_INIT_DEPOSIT_MESSAGE_LOOP for(firm_bank_init_deposit_message = get_first_firm_bank_init_deposit_message(); firm_bank_init_deposit_message != NULL; firm_bank_init_deposit_message = get_next_firm_bank_init_deposit_message(firm_bank_init_deposit_message)) {
138 
140 #define FINISH_FIRM_BANK_INIT_DEPOSIT_MESSAGE_LOOP }
141 
143 #define START_FIRM_BANK_UPDATE_DEPOSIT_MESSAGE_LOOP for(firm_bank_update_deposit_message = get_first_firm_bank_update_deposit_message(); firm_bank_update_deposit_message != NULL; firm_bank_update_deposit_message = get_next_firm_bank_update_deposit_message(firm_bank_update_deposit_message)) {
144 
146 #define FINISH_FIRM_BANK_UPDATE_DEPOSIT_MESSAGE_LOOP }
147 
149 #define START_HOUSEHOLD_BANK_INIT_MORTGAGES_MESSAGE_LOOP for(household_bank_init_mortgages_message = get_first_household_bank_init_mortgages_message(); household_bank_init_mortgages_message != NULL; household_bank_init_mortgages_message = get_next_household_bank_init_mortgages_message(household_bank_init_mortgages_message)) {
150 
152 #define FINISH_HOUSEHOLD_BANK_INIT_MORTGAGES_MESSAGE_LOOP }
153 
155 #define START_HOUSEHOLD_BANK_INIT_DEPOSIT_MESSAGE_LOOP for(household_bank_init_deposit_message = get_first_household_bank_init_deposit_message(); household_bank_init_deposit_message != NULL; household_bank_init_deposit_message = get_next_household_bank_init_deposit_message(household_bank_init_deposit_message)) {
156 
158 #define FINISH_HOUSEHOLD_BANK_INIT_DEPOSIT_MESSAGE_LOOP }
159 
161 #define START_HOUSEHOLD_BANK_UPDATE_DEPOSIT_MESSAGE_LOOP for(household_bank_update_deposit_message = get_first_household_bank_update_deposit_message(); household_bank_update_deposit_message != NULL; household_bank_update_deposit_message = get_next_household_bank_update_deposit_message(household_bank_update_deposit_message)) {
162 
164 #define FINISH_HOUSEHOLD_BANK_UPDATE_DEPOSIT_MESSAGE_LOOP }
165 
167 #define START_BANK_CENTRALBANK_INIT_DEBT_MESSAGE_LOOP for(bank_centralbank_init_debt_message = get_first_bank_centralbank_init_debt_message(); bank_centralbank_init_debt_message != NULL; bank_centralbank_init_debt_message = get_next_bank_centralbank_init_debt_message(bank_centralbank_init_debt_message)) {
168 
170 #define FINISH_BANK_CENTRALBANK_INIT_DEBT_MESSAGE_LOOP }
171 
173 #define START_BANK_CENTRALBANK_INIT_DEPOSIT_MESSAGE_LOOP for(bank_centralbank_init_deposit_message = get_first_bank_centralbank_init_deposit_message(); bank_centralbank_init_deposit_message != NULL; bank_centralbank_init_deposit_message = get_next_bank_centralbank_init_deposit_message(bank_centralbank_init_deposit_message)) {
174 
176 #define FINISH_BANK_CENTRALBANK_INIT_DEPOSIT_MESSAGE_LOOP }
177 
179 #define START_BANK_CENTRALBANK_UPDATE_DEPOSIT_MESSAGE_LOOP for(bank_centralbank_update_deposit_message = get_first_bank_centralbank_update_deposit_message(); bank_centralbank_update_deposit_message != NULL; bank_centralbank_update_deposit_message = get_next_bank_centralbank_update_deposit_message(bank_centralbank_update_deposit_message)) {
180 
182 #define FINISH_BANK_CENTRALBANK_UPDATE_DEPOSIT_MESSAGE_LOOP }
183 
185 #define START_FUND_CENTRALBANK_INIT_DEPOSIT_MESSAGE_LOOP for(fund_centralbank_init_deposit_message = get_first_fund_centralbank_init_deposit_message(); fund_centralbank_init_deposit_message != NULL; fund_centralbank_init_deposit_message = get_next_fund_centralbank_init_deposit_message(fund_centralbank_init_deposit_message)) {
186 
188 #define FINISH_FUND_CENTRALBANK_INIT_DEPOSIT_MESSAGE_LOOP }
189 
191 #define START_FUND_CENTRALBANK_UPDATE_DEPOSIT_MESSAGE_LOOP for(fund_centralbank_update_deposit_message = get_first_fund_centralbank_update_deposit_message(); fund_centralbank_update_deposit_message != NULL; fund_centralbank_update_deposit_message = get_next_fund_centralbank_update_deposit_message(fund_centralbank_update_deposit_message)) {
192 
194 #define FINISH_FUND_CENTRALBANK_UPDATE_DEPOSIT_MESSAGE_LOOP }
195 
197 #define START_GOV_CENTRALBANK_INIT_DEPOSIT_MESSAGE_LOOP for(gov_centralbank_init_deposit_message = get_first_gov_centralbank_init_deposit_message(); gov_centralbank_init_deposit_message != NULL; gov_centralbank_init_deposit_message = get_next_gov_centralbank_init_deposit_message(gov_centralbank_init_deposit_message)) {
198 
200 #define FINISH_GOV_CENTRALBANK_INIT_DEPOSIT_MESSAGE_LOOP }
201 
203 #define START_GOV_CENTRALBANK_UPDATE_DEPOSIT_MESSAGE_LOOP for(gov_centralbank_update_deposit_message = get_first_gov_centralbank_update_deposit_message(); gov_centralbank_update_deposit_message != NULL; gov_centralbank_update_deposit_message = get_next_gov_centralbank_update_deposit_message(gov_centralbank_update_deposit_message)) {
204 
206 #define FINISH_GOV_CENTRALBANK_UPDATE_DEPOSIT_MESSAGE_LOOP }
207 
209 #define START_INTEREST_RATE_MESSAGE_LOOP for(interest_rate_message = get_first_interest_rate_message(); interest_rate_message != NULL; interest_rate_message = get_next_interest_rate_message(interest_rate_message)) {
210 
212 #define FINISH_INTEREST_RATE_MESSAGE_LOOP }
213 
215 #define START_CAPITAL_TAX_RATE_MESSAGE_LOOP for(capital_tax_rate_message = get_first_capital_tax_rate_message(); capital_tax_rate_message != NULL; capital_tax_rate_message = get_next_capital_tax_rate_message(capital_tax_rate_message)) {
216 
218 #define FINISH_CAPITAL_TAX_RATE_MESSAGE_LOOP }
219 
221 #define START_LABOUR_TAX_RATE_MESSAGE_LOOP for(labour_tax_rate_message = get_first_labour_tax_rate_message(); labour_tax_rate_message != NULL; labour_tax_rate_message = get_next_labour_tax_rate_message(labour_tax_rate_message)) {
222 
224 #define FINISH_LABOUR_TAX_RATE_MESSAGE_LOOP }
225 
227 #define START_HOUSEHOLD_JPOFFICE_ID_MESSAGE_LOOP for(household_jpoffice_id_message = get_first_household_jpoffice_id_message(); household_jpoffice_id_message != NULL; household_jpoffice_id_message = get_next_household_jpoffice_id_message(household_jpoffice_id_message)) {
228 
230 #define FINISH_HOUSEHOLD_JPOFFICE_ID_MESSAGE_LOOP }
231 
233 #define START_JPOFFICE_HOUSEHOLD_EMPLOYER_MESSAGE_LOOP for(jpoffice_household_employer_message = get_first_jpoffice_household_employer_message(); jpoffice_household_employer_message != NULL; jpoffice_household_employer_message = get_next_jpoffice_household_employer_message(jpoffice_household_employer_message)) {
234 
236 #define FINISH_JPOFFICE_HOUSEHOLD_EMPLOYER_MESSAGE_LOOP }
237 
239 #define START_FIRM_JPOFFICE_ID_MESSAGE_LOOP for(firm_jpoffice_id_message = get_first_firm_jpoffice_id_message(); firm_jpoffice_id_message != NULL; firm_jpoffice_id_message = get_next_firm_jpoffice_id_message(firm_jpoffice_id_message)) {
240 
242 #define FINISH_FIRM_JPOFFICE_ID_MESSAGE_LOOP }
243 
245 #define START_JPOFFICE_FIRM_EMPLOYEE_MESSAGE_LOOP for(jpoffice_firm_employee_message = get_first_jpoffice_firm_employee_message(); jpoffice_firm_employee_message != NULL; jpoffice_firm_employee_message = get_next_jpoffice_firm_employee_message(jpoffice_firm_employee_message)) {
246 
248 #define FINISH_JPOFFICE_FIRM_EMPLOYEE_MESSAGE_LOOP }
249 
251 #define START_BUY_MESSAGE_LOOP for(buy_message = get_first_buy_message(); buy_message != NULL; buy_message = get_next_buy_message(buy_message)) {
252 
254 #define FINISH_BUY_MESSAGE_LOOP }
255 
257 #define START_BOUGHT_MESSAGE_LOOP for(bought_message = get_first_bought_message(); bought_message != NULL; bought_message = get_next_bought_message(bought_message)) {
258 
260 #define FINISH_BOUGHT_MESSAGE_LOOP }
261 
263 #define START_SELL_MESSAGE_LOOP for(sell_message = get_first_sell_message(); sell_message != NULL; sell_message = get_next_sell_message(sell_message)) {
264 
266 #define FINISH_SELL_MESSAGE_LOOP }
267 
269 #define START_SOLD_MESSAGE_LOOP for(sold_message = get_first_sold_message(); sold_message != NULL; sold_message = get_next_sold_message(sold_message)) {
270 
272 #define FINISH_SOLD_MESSAGE_LOOP }
273 
275 #define START_GOODS_TRANSACTIONS_SUMMARY_MESSAGE_LOOP for(goods_transactions_summary_message = get_first_goods_transactions_summary_message(); goods_transactions_summary_message != NULL; goods_transactions_summary_message = get_next_goods_transactions_summary_message(goods_transactions_summary_message)) {
276 
278 #define FINISH_GOODS_TRANSACTIONS_SUMMARY_MESSAGE_LOOP }
279 
281 #define START_CENTRALBANK_HOUSEHOLDS_QUARTERLY_CPI_MESSAGE_LOOP for(centralbank_households_quarterly_cpi_message = get_first_centralbank_households_quarterly_cpi_message(); centralbank_households_quarterly_cpi_message != NULL; centralbank_households_quarterly_cpi_message = get_next_centralbank_households_quarterly_cpi_message(centralbank_households_quarterly_cpi_message)) {
282 
284 #define FINISH_CENTRALBANK_HOUSEHOLDS_QUARTERLY_CPI_MESSAGE_LOOP }
285 
287 #define START_FIRED_MESSAGE_LOOP for(fired_message = get_first_fired_message(); fired_message != NULL; fired_message = get_next_fired_message(fired_message)) {
288 
290 #define FINISH_FIRED_MESSAGE_LOOP }
291 
293 #define START_VACANCY_STAGE1_MESSAGE_LOOP for(vacancy_stage1_message = get_first_vacancy_stage1_message(); vacancy_stage1_message != NULL; vacancy_stage1_message = get_next_vacancy_stage1_message(vacancy_stage1_message)) {
294 
296 #define FINISH_VACANCY_STAGE1_MESSAGE_LOOP }
297 
299 #define START_JOB_APPLICATION_STAGE2_MESSAGE_LOOP for(job_application_stage2_message = get_first_job_application_stage2_message(); job_application_stage2_message != NULL; job_application_stage2_message = get_next_job_application_stage2_message(job_application_stage2_message)) {
300 
302 #define FINISH_JOB_APPLICATION_STAGE2_MESSAGE_LOOP }
303 
305 #define START_JOB_APPLICATION_STAGE1_MESSAGE_LOOP for(job_application_stage1_message = get_first_job_application_stage1_message(); job_application_stage1_message != NULL; job_application_stage1_message = get_next_job_application_stage1_message(job_application_stage1_message)) {
306 
308 #define FINISH_JOB_APPLICATION_STAGE1_MESSAGE_LOOP }
309 
311 #define START_JOB_MATCH_STAGE1_MESSAGE_LOOP for(job_match_stage1_message = get_first_job_match_stage1_message(); job_match_stage1_message != NULL; job_match_stage1_message = get_next_job_match_stage1_message(job_match_stage1_message)) {
312 
314 #define FINISH_JOB_MATCH_STAGE1_MESSAGE_LOOP }
315 
317 #define START_JOB_CHANGE_MESSAGE_LOOP for(job_change_message = get_first_job_change_message(); job_change_message != NULL; job_change_message = get_next_job_change_message(job_change_message)) {
318 
320 #define FINISH_JOB_CHANGE_MESSAGE_LOOP }
321 
323 #define START_VACANCY_STAGE2_MESSAGE_LOOP for(vacancy_stage2_message = get_first_vacancy_stage2_message(); vacancy_stage2_message != NULL; vacancy_stage2_message = get_next_vacancy_stage2_message(vacancy_stage2_message)) {
324 
326 #define FINISH_VACANCY_STAGE2_MESSAGE_LOOP }
327 
329 #define START_JOB_MATCH_STAGE2_MESSAGE_LOOP for(job_match_stage2_message = get_first_job_match_stage2_message(); job_match_stage2_message != NULL; job_match_stage2_message = get_next_job_match_stage2_message(job_match_stage2_message)) {
330 
332 #define FINISH_JOB_MATCH_STAGE2_MESSAGE_LOOP }
333 
335 #define START_EMPLOYMENT_STATUS_MESSAGE_LOOP for(employment_status_message = get_first_employment_status_message(); employment_status_message != NULL; employment_status_message = get_next_employment_status_message(employment_status_message)) {
336 
338 #define FINISH_EMPLOYMENT_STATUS_MESSAGE_LOOP }
339 
341 #define START_FIRM_HOUSEHOLD_WAGE_PAYMENT_MESSAGE_LOOP for(firm_household_wage_payment_message = get_first_firm_household_wage_payment_message(); firm_household_wage_payment_message != NULL; firm_household_wage_payment_message = get_next_firm_household_wage_payment_message(firm_household_wage_payment_message)) {
342 
344 #define FINISH_FIRM_HOUSEHOLD_WAGE_PAYMENT_MESSAGE_LOOP }
345 
347 #define START_FIRM_BANK_LOAN_REQUEST_1_MESSAGE_LOOP for(firm_bank_loan_request_1_message = get_first_firm_bank_loan_request_1_message(); firm_bank_loan_request_1_message != NULL; firm_bank_loan_request_1_message = get_next_firm_bank_loan_request_1_message(firm_bank_loan_request_1_message)) {
348 
350 #define FINISH_FIRM_BANK_LOAN_REQUEST_1_MESSAGE_LOOP }
351 
353 #define START_FIRM_BANK_LOAN_REQUEST_2_MESSAGE_LOOP for(firm_bank_loan_request_2_message = get_first_firm_bank_loan_request_2_message(); firm_bank_loan_request_2_message != NULL; firm_bank_loan_request_2_message = get_next_firm_bank_loan_request_2_message(firm_bank_loan_request_2_message)) {
354 
356 #define FINISH_FIRM_BANK_LOAN_REQUEST_2_MESSAGE_LOOP }
357 
359 #define START_BANK_FIRM_LOAN_ACKNOWLEDGE_1_MESSAGE_LOOP for(bank_firm_loan_acknowledge_1_message = get_first_bank_firm_loan_acknowledge_1_message(); bank_firm_loan_acknowledge_1_message != NULL; bank_firm_loan_acknowledge_1_message = get_next_bank_firm_loan_acknowledge_1_message(bank_firm_loan_acknowledge_1_message)) {
360 
362 #define FINISH_BANK_FIRM_LOAN_ACKNOWLEDGE_1_MESSAGE_LOOP }
363 
365 #define START_BANK_FIRM_LOAN_ACKNOWLEDGE_2_MESSAGE_LOOP for(bank_firm_loan_acknowledge_2_message = get_first_bank_firm_loan_acknowledge_2_message(); bank_firm_loan_acknowledge_2_message != NULL; bank_firm_loan_acknowledge_2_message = get_next_bank_firm_loan_acknowledge_2_message(bank_firm_loan_acknowledge_2_message)) {
366 
368 #define FINISH_BANK_FIRM_LOAN_ACKNOWLEDGE_2_MESSAGE_LOOP }
369 
371 #define START_BANK_CENTRALBANK_DEBT_REQUEST_MESSAGE_LOOP for(bank_centralbank_debt_request_message = get_first_bank_centralbank_debt_request_message(); bank_centralbank_debt_request_message != NULL; bank_centralbank_debt_request_message = get_next_bank_centralbank_debt_request_message(bank_centralbank_debt_request_message)) {
372 
374 #define FINISH_BANK_CENTRALBANK_DEBT_REQUEST_MESSAGE_LOOP }
375 
377 #define START_HOUSEHOLD_SHARE_MESSAGE_LOOP for(household_share_message = get_first_household_share_message(); household_share_message != NULL; household_share_message = get_next_household_share_message(household_share_message)) {
378 
380 #define FINISH_HOUSEHOLD_SHARE_MESSAGE_LOOP }
381 
383 #define START_CAPITAL_TAX_MESSAGE_LOOP for(capital_tax_message = get_first_capital_tax_message(); capital_tax_message != NULL; capital_tax_message = get_next_capital_tax_message(capital_tax_message)) {
384 
386 #define FINISH_CAPITAL_TAX_MESSAGE_LOOP }
387 
389 #define START_LABOUR_TAX_MESSAGE_LOOP for(labour_tax_message = get_first_labour_tax_message(); labour_tax_message != NULL; labour_tax_message = get_next_labour_tax_message(labour_tax_message)) {
390 
392 #define FINISH_LABOUR_TAX_MESSAGE_LOOP }
393 
395 #define START_UNEMPLOYMENT_BENEFIT_MESSAGE_LOOP for(unemployment_benefit_message = get_first_unemployment_benefit_message(); unemployment_benefit_message != NULL; unemployment_benefit_message = get_next_unemployment_benefit_message(unemployment_benefit_message)) {
396 
398 #define FINISH_UNEMPLOYMENT_BENEFIT_MESSAGE_LOOP }
399 
401 #define START_GENERAL_BENEFIT_MESSAGE_LOOP for(general_benefit_message = get_first_general_benefit_message(); general_benefit_message != NULL; general_benefit_message = get_next_general_benefit_message(general_benefit_message)) {
402 
404 #define FINISH_GENERAL_BENEFIT_MESSAGE_LOOP }
405 
407 #define START_FUND_REQUEST_MESSAGE_LOOP for(fund_request_message = get_first_fund_request_message(); fund_request_message != NULL; fund_request_message = get_next_fund_request_message(fund_request_message)) {
408 
410 #define FINISH_FUND_REQUEST_MESSAGE_LOOP }
411 
413 #define START_FUND_REQUEST_ACK_MESSAGE_LOOP for(fund_request_ack_message = get_first_fund_request_ack_message(); fund_request_ack_message != NULL; fund_request_ack_message = get_next_fund_request_ack_message(fund_request_ack_message)) {
414 
416 #define FINISH_FUND_REQUEST_ACK_MESSAGE_LOOP }
417 
419 #define START_NEW_ENTRANT_LOAN_MESSAGE_LOOP for(new_entrant_loan_message = get_first_new_entrant_loan_message(); new_entrant_loan_message != NULL; new_entrant_loan_message = get_next_new_entrant_loan_message(new_entrant_loan_message)) {
420 
422 #define FINISH_NEW_ENTRANT_LOAN_MESSAGE_LOOP }
423 
425 #define START_FIRM_BANK_INTEREST_ON_LOAN_MESSAGE_LOOP for(firm_bank_interest_on_loan_message = get_first_firm_bank_interest_on_loan_message(); firm_bank_interest_on_loan_message != NULL; firm_bank_interest_on_loan_message = get_next_firm_bank_interest_on_loan_message(firm_bank_interest_on_loan_message)) {
426 
428 #define FINISH_FIRM_BANK_INTEREST_ON_LOAN_MESSAGE_LOOP }
429 
431 #define START_LOAN_WRITEOFF_MESSAGE_LOOP for(loan_writeoff_message = get_first_loan_writeoff_message(); loan_writeoff_message != NULL; loan_writeoff_message = get_next_loan_writeoff_message(loan_writeoff_message)) {
432 
434 #define FINISH_LOAN_WRITEOFF_MESSAGE_LOOP }
435 
437 #define START_FIRM_BANK_INSOLVENT_ACCOUNT_MESSAGE_LOOP for(firm_bank_insolvent_account_message = get_first_firm_bank_insolvent_account_message(); firm_bank_insolvent_account_message != NULL; firm_bank_insolvent_account_message = get_next_firm_bank_insolvent_account_message(firm_bank_insolvent_account_message)) {
438 
440 #define FINISH_FIRM_BANK_INSOLVENT_ACCOUNT_MESSAGE_LOOP }
441 
443 #define START_FIRM_NET_PROFIT_MESSAGE_LOOP for(firm_net_profit_message = get_first_firm_net_profit_message(); firm_net_profit_message != NULL; firm_net_profit_message = get_next_firm_net_profit_message(firm_net_profit_message)) {
444 
446 #define FINISH_FIRM_NET_PROFIT_MESSAGE_LOOP }
447 
449 #define START_BANK_NET_PROFIT_MESSAGE_LOOP for(bank_net_profit_message = get_first_bank_net_profit_message(); bank_net_profit_message != NULL; bank_net_profit_message = get_next_bank_net_profit_message(bank_net_profit_message)) {
450 
452 #define FINISH_BANK_NET_PROFIT_MESSAGE_LOOP }
453 
455 #define START_BANK_CENTRALBANK_INTEREST_PAYMENT_MESSAGE_LOOP for(bank_centralbank_interest_payment_message = get_first_bank_centralbank_interest_payment_message(); bank_centralbank_interest_payment_message != NULL; bank_centralbank_interest_payment_message = get_next_bank_centralbank_interest_payment_message(bank_centralbank_interest_payment_message)) {
456 
458 #define FINISH_BANK_CENTRALBANK_INTEREST_PAYMENT_MESSAGE_LOOP }
459 
461 #define START_BANK_CENTRALBANK_DEBT_PAYMENT_MESSAGE_LOOP for(bank_centralbank_debt_payment_message = get_first_bank_centralbank_debt_payment_message(); bank_centralbank_debt_payment_message != NULL; bank_centralbank_debt_payment_message = get_next_bank_centralbank_debt_payment_message(bank_centralbank_debt_payment_message)) {
462 
464 #define FINISH_BANK_CENTRALBANK_DEBT_PAYMENT_MESSAGE_LOOP }
465 
467 #define START_GOV_CENTRALBANK_DEBT_REQUEST_MESSAGE_LOOP for(gov_centralbank_debt_request_message = get_first_gov_centralbank_debt_request_message(); gov_centralbank_debt_request_message != NULL; gov_centralbank_debt_request_message = get_next_gov_centralbank_debt_request_message(gov_centralbank_debt_request_message)) {
468 
470 #define FINISH_GOV_CENTRALBANK_DEBT_REQUEST_MESSAGE_LOOP }
471 
473 #define START_GOV_CENTRALBANK_DEBT_PAYMENT_MESSAGE_LOOP for(gov_centralbank_debt_payment_message = get_first_gov_centralbank_debt_payment_message(); gov_centralbank_debt_payment_message != NULL; gov_centralbank_debt_payment_message = get_next_gov_centralbank_debt_payment_message(gov_centralbank_debt_payment_message)) {
474 
476 #define FINISH_GOV_CENTRALBANK_DEBT_PAYMENT_MESSAGE_LOOP }
477 
479 #define START_CENTRALBANK_GOVERNMENT_PROFIT_MESSAGE_LOOP for(centralbank_government_profit_message = get_first_centralbank_government_profit_message(); centralbank_government_profit_message != NULL; centralbank_government_profit_message = get_next_centralbank_government_profit_message(centralbank_government_profit_message)) {
480 
482 #define FINISH_CENTRALBANK_GOVERNMENT_PROFIT_MESSAGE_LOOP }
483 
485 #define START_HOUSING_PRICE_MESSAGE_LOOP for(housing_price_message = get_first_housing_price_message(); housing_price_message != NULL; housing_price_message = get_next_housing_price_message(housing_price_message)) {
486 
488 #define FINISH_HOUSING_PRICE_MESSAGE_LOOP }
489 
491 #define START_BUY_HOUSING_MESSAGE_LOOP for(buy_housing_message = get_first_buy_housing_message(); buy_housing_message != NULL; buy_housing_message = get_next_buy_housing_message(buy_housing_message)) {
492 
494 #define FINISH_BUY_HOUSING_MESSAGE_LOOP }
495 
497 #define START_SELL_HOUSING_MESSAGE_LOOP for(sell_housing_message = get_first_sell_housing_message(); sell_housing_message != NULL; sell_housing_message = get_next_sell_housing_message(sell_housing_message)) {
498 
500 #define FINISH_SELL_HOUSING_MESSAGE_LOOP }
501 
503 #define START_BOUGHT_HOUSING_MESSAGE_LOOP for(bought_housing_message = get_first_bought_housing_message(); bought_housing_message != NULL; bought_housing_message = get_next_bought_housing_message(bought_housing_message)) {
504 
506 #define FINISH_BOUGHT_HOUSING_MESSAGE_LOOP }
507 
509 #define START_SOLD_HOUSING_MESSAGE_LOOP for(sold_housing_message = get_first_sold_housing_message(); sold_housing_message != NULL; sold_housing_message = get_next_sold_housing_message(sold_housing_message)) {
510 
512 #define FINISH_SOLD_HOUSING_MESSAGE_LOOP }
513 
515 #define START_BANK_REAGENCY_CREDIBILITY_MESSAGE_LOOP for(bank_reagency_credibility_message = get_first_bank_reagency_credibility_message(); bank_reagency_credibility_message != NULL; bank_reagency_credibility_message = get_next_bank_reagency_credibility_message(bank_reagency_credibility_message)) {
516 
518 #define FINISH_BANK_REAGENCY_CREDIBILITY_MESSAGE_LOOP }
519 
521 #define START_MORTGAGE_REQUESTS_MESSAGE_LOOP for(mortgage_requests_message = get_first_mortgage_requests_message(); mortgage_requests_message != NULL; mortgage_requests_message = get_next_mortgage_requests_message(mortgage_requests_message)) {
522 
524 #define FINISH_MORTGAGE_REQUESTS_MESSAGE_LOOP }
525 
527 #define START_MORTGAGE_PAYMENT_FROM_SALE_MESSAGE_LOOP for(mortgage_payment_from_sale_message = get_first_mortgage_payment_from_sale_message(); mortgage_payment_from_sale_message != NULL; mortgage_payment_from_sale_message = get_next_mortgage_payment_from_sale_message(mortgage_payment_from_sale_message)) {
528 
530 #define FINISH_MORTGAGE_PAYMENT_FROM_SALE_MESSAGE_LOOP }
531 
533 #define START_MORTGAGE_PAYMENT_MESSAGE_LOOP for(mortgage_payment_message = get_first_mortgage_payment_message(); mortgage_payment_message != NULL; mortgage_payment_message = get_next_mortgage_payment_message(mortgage_payment_message)) {
534 
536 #define FINISH_MORTGAGE_PAYMENT_MESSAGE_LOOP }
537 
539 #define START_MORTGAGE_WRITEOFF_MESSAGE_LOOP for(mortgage_writeoff_message = get_first_mortgage_writeoff_message(); mortgage_writeoff_message != NULL; mortgage_writeoff_message = get_next_mortgage_writeoff_message(mortgage_writeoff_message)) {
540 
542 #define FINISH_MORTGAGE_WRITEOFF_MESSAGE_LOOP }
543 
545 #define START_HOUSING_TRANSACTIONS_SUMMARY_MESSAGE_LOOP for(housing_transactions_summary_message = get_first_housing_transactions_summary_message(); housing_transactions_summary_message != NULL; housing_transactions_summary_message = get_next_housing_transactions_summary_message(housing_transactions_summary_message)) {
546 
548 #define FINISH_HOUSING_TRANSACTIONS_SUMMARY_MESSAGE_LOOP }
549 
550 
552 {
553  int type; /* 0=snapshot 1=firm 2=household 3=equityfund 4=bank 5=government 6=centralbank 7=jpoffice 8=mall 9=reagency */
554  int format; /* 0=XML */
555  char * location;
556  int period;
557  int phase;
558  int flag; /* Used when outputting to show it has been used */
559 
560  struct FLAME_output * next;
561 };
562 typedef struct FLAME_output FLAME_output;
563 
569 struct int_array
570 {
571  int size;
573 
574  int * array;
575 };
576 
583 {
584  int size;
586 
587  float * array;
588 };
589 
596 {
597  int size;
599 
600  double * array;
601 };
602 
609 {
610  int size;
612 
613  char * array;
614 };
615 
619 typedef struct int_array int_array;
623 typedef struct float_array float_array;
627 typedef struct double_array double_array;
631 typedef struct char_array char_array;
632 
639 {
640  int quantity;
641  double avg_price;
642 };
643 
648 {
649  int size;
651 
652  struct transaction * array;
653 };
654 
658 typedef struct transaction transaction;
668 struct buyer
669 {
670  int id;
671  double budget;
672 };
673 
678 {
679  int size;
681 
682  struct buyer * array;
683 };
684 
688 typedef struct buyer buyer;
692 typedef struct buyer_array buyer_array;
698 struct seller
699 {
700  int id;
701  double price;
702  int inventory;
703  double inv_price;
704 };
705 
710 {
711  int size;
713 
714  struct seller * array;
715 };
716 
720 typedef struct seller seller;
724 typedef struct seller_array seller_array;
730 struct vacancy
731 {
732  int id;
733  double wage;
734 };
735 
740 {
741  int size;
743 
744  struct vacancy * array;
745 };
746 
750 typedef struct vacancy vacancy;
760 struct employee
761 {
762  int id;
763  double wage;
764 };
765 
770 {
771  int size;
773 
774  struct employee * array;
775 };
776 
780 typedef struct employee employee;
790 struct mortgage
791 {
792  int bank_id;
793  double principal;
797  double interestrate;
798  int mtype;
799 };
800 
805 {
806  int size;
808 
809  struct mortgage * array;
810 };
811 
815 typedef struct mortgage mortgage;
825 struct loan
826 {
827  int bank_id;
828  double amount;
829  double to_be_paid;
830 };
831 
836 {
837  int size;
839 
840  struct loan * array;
841 };
842 
846 typedef struct loan loan;
850 typedef struct loan_array loan_array;
856 struct hbuyer
857 {
858  int buyer_id;
859  int bank_id;
860  double liquidity;
863  int choice;
864 };
865 
870 {
871  int size;
873 
874  struct hbuyer * array;
875 };
876 
880 typedef struct hbuyer hbuyer;
884 typedef struct hbuyer_array hbuyer_array;
890 struct hseller
891 {
892  int seller_id;
893  double price;
894  int quantity;
895  int type;
896 };
897 
902 {
903  int size;
905 
906  struct hseller * array;
907 };
908 
912 typedef struct hseller hseller;
922 struct hbank
923 {
924  int id;
925  double equity;
926  double risky_assets;
928 };
929 
934 {
935  int size;
937 
938  struct hbank * array;
939 };
940 
944 typedef struct hbank hbank;
948 typedef struct hbank_array hbank_array;
949 
954 {
955  int id;
956  int bank_id;
960  int it_no;
964  int manager;
965  double wage_offer;
966  double average_wage;
968  int vacancies;
979  double unit_cost;
982  int projects[12];
984  double debt;
985  int inventory;
986  int sales;
987  double revenues;
988  double total_assets;
990  double labour_costs;
992  double dividends_paid;
995  double net_earnings;
996  double ebit;
997  double equity;
998  double liquidity;
1000  int hasloan;
1008 };
1009 
1014 {
1015  /*@dependent@*/ struct xmachine_memory_firm * agent;
1017  /*@dependent@*/ struct xmachine_memory_firm_holder * prev;
1018  /*@dependent@*/ struct xmachine_memory_firm_holder * next;
1019 };
1020 
1025 {
1026  /*@dependent@*/ struct xmachine_memory_firm_holder * agents;
1028  int count;
1029 };
1030 
1035 {
1036  int id;
1037  int bank_id;
1038  int it_no;
1041  double mall_budget;
1044  double wage;
1052  double mortgages;
1054  double equity;
1055  double housing_price;
1057  int n_shares;
1058  double liquidity;
1060  double previous_wages[3];
1061  double previous_benefits[3];
1062  double labour_income;
1063  double total_assets;
1064  double housing_value;
1067  double equity_ratio;
1069  double mortgage_costs[3];
1072 };
1073 
1078 {
1079  /*@dependent@*/ struct xmachine_memory_household * agent;
1081  /*@dependent@*/ struct xmachine_memory_household_holder * prev;
1082  /*@dependent@*/ struct xmachine_memory_household_holder * next;
1083 };
1084 
1089 {
1090  /*@dependent@*/ struct xmachine_memory_household_holder * agents;
1092  int count;
1093 };
1094 
1099 {
1100  int id;
1101  int it_no;
1104  double share_firms;
1106  double share_banks;
1107  double equity;
1108  double liquidity;
1109  int n_shares;
1115 };
1116 
1121 {
1122  /*@dependent@*/ struct xmachine_memory_equityfund * agent;
1124  /*@dependent@*/ struct xmachine_memory_equityfund_holder * prev;
1125  /*@dependent@*/ struct xmachine_memory_equityfund_holder * next;
1126 };
1127 
1132 {
1133  /*@dependent@*/ struct xmachine_memory_equityfund_holder * agents;
1135  int count;
1136 };
1137 
1142 {
1143  int id;
1146  int it_no;
1147  double total_assets;
1148  double loans;
1149  double loans_start;
1150  double mortgages;
1151  double deposits;
1153  double equity;
1154  double liquidity;
1155  double revenues;
1157  double interest_rate;
1163  double net_earnings;
1164  double total_costs;
1165 };
1166 
1171 {
1172  /*@dependent@*/ struct xmachine_memory_bank * agent;
1174  /*@dependent@*/ struct xmachine_memory_bank_holder * prev;
1175  /*@dependent@*/ struct xmachine_memory_bank_holder * next;
1176 };
1177 
1182 {
1183  /*@dependent@*/ struct xmachine_memory_bank_holder * agents;
1185  int count;
1186 };
1187 
1192 {
1193  int id;
1194  int it_no;
1195  double average_wage;
1198  double debt;
1199  double equity;
1200  double liquidity;
1211  double earnings;
1213  double expenditures;
1214 };
1215 
1220 {
1221  /*@dependent@*/ struct xmachine_memory_government * agent;
1223  /*@dependent@*/ struct xmachine_memory_government_holder * prev;
1224  /*@dependent@*/ struct xmachine_memory_government_holder * next;
1225 };
1226 
1231 {
1232  /*@dependent@*/ struct xmachine_memory_government_holder * agents;
1234  int count;
1235 };
1236 
1241 {
1242  int id;
1247  int it_no;
1252  double interest_rate;
1253  double liquidity;
1254  double loans_banks;
1256  double fiat_money;
1257  double equity;
1261  double total_assets;
1264  double revenues;
1265  double net_earnings;
1266  double total_costs;
1268 };
1269 
1274 {
1275  /*@dependent@*/ struct xmachine_memory_centralbank * agent;
1277  /*@dependent@*/ struct xmachine_memory_centralbank_holder * prev;
1278  /*@dependent@*/ struct xmachine_memory_centralbank_holder * next;
1279 };
1280 
1285 {
1286  /*@dependent@*/ struct xmachine_memory_centralbank_holder * agents;
1288  int count;
1289 };
1290 
1295 {
1296  int id;
1297  int it_no;
1299 };
1300 
1305 {
1306  /*@dependent@*/ struct xmachine_memory_jpoffice * agent;
1308  /*@dependent@*/ struct xmachine_memory_jpoffice_holder * prev;
1309  /*@dependent@*/ struct xmachine_memory_jpoffice_holder * next;
1310 };
1311 
1316 {
1317  /*@dependent@*/ struct xmachine_memory_jpoffice_holder * agents;
1319  int count;
1320 };
1321 
1326 {
1327  int id;
1328  int it_no;
1331 };
1332 
1337 {
1338  /*@dependent@*/ struct xmachine_memory_mall * agent;
1340  /*@dependent@*/ struct xmachine_memory_mall_holder * prev;
1341  /*@dependent@*/ struct xmachine_memory_mall_holder * next;
1342 };
1343 
1348 {
1349  /*@dependent@*/ struct xmachine_memory_mall_holder * agents;
1351  int count;
1352 };
1353 
1358 {
1359  int id;
1361  int it_no;
1364 };
1365 
1370 {
1371  /*@dependent@*/ struct xmachine_memory_reagency * agent;
1373  /*@dependent@*/ struct xmachine_memory_reagency_holder * prev;
1374  /*@dependent@*/ struct xmachine_memory_reagency_holder * next;
1375 };
1376 
1381 {
1382  /*@dependent@*/ struct xmachine_memory_reagency_holder * agents;
1384  int count;
1385 };
1386 
1390 struct xmachine
1391 {
1392  /*@dependent@*/ /*@null@*/ /*@out@*/ struct xmachine_memory_firm * xmachine_firm;
1393  /*@dependent@*/ /*@null@*/ /*@out@*/ struct xmachine_memory_household * xmachine_household;
1394  /*@dependent@*/ /*@null@*/ /*@out@*/ struct xmachine_memory_equityfund * xmachine_equityfund;
1395  /*@dependent@*/ /*@null@*/ /*@out@*/ struct xmachine_memory_bank * xmachine_bank;
1396  /*@dependent@*/ /*@null@*/ /*@out@*/ struct xmachine_memory_government * xmachine_government;
1397  /*@dependent@*/ /*@null@*/ /*@out@*/ struct xmachine_memory_centralbank * xmachine_centralbank;
1398  /*@dependent@*/ /*@null@*/ /*@out@*/ struct xmachine_memory_jpoffice * xmachine_jpoffice;
1399  /*@dependent@*/ /*@null@*/ /*@out@*/ struct xmachine_memory_mall * xmachine_mall;
1400  /*@dependent@*/ /*@null@*/ /*@out@*/ struct xmachine_memory_reagency * xmachine_reagency;
1401 };
1402 
1406 
1411 {
1412  int bank_id;
1413  double amount;
1414 };
1415 
1419 
1424 {
1425  int bank_id;
1426  double amount;
1427 };
1428 
1432 
1437 {
1438  int bank_id;
1439  double amount;
1440 };
1441 
1445 
1450 {
1451  int bank_id;
1452  double amount;
1453 };
1454 
1458 
1463 {
1464  int bank_id;
1465  double amount;
1466 };
1467 
1471 
1476 {
1477  int bank_id;
1478  double amount;
1479 };
1480 
1484 
1489 {
1490  int bank_id;
1491  double amount;
1492 };
1493 
1497 
1502 {
1503  int bank_id;
1504  double amount;
1505 };
1506 
1510 
1515 {
1516  int bank_id;
1517  double amount;
1518 };
1519 
1523 
1528 {
1529  double amount;
1530 };
1531 
1535 
1540 {
1541  double amount;
1542 };
1543 
1547 
1552 {
1553  double amount;
1554 };
1555 
1559 
1564 {
1565  double amount;
1566 };
1567 
1571 
1576 {
1577  double rate;
1578 };
1579 
1583 
1588 {
1589  double value;
1590 };
1591 
1595 
1600 {
1601  double value;
1602 };
1603 
1607 
1612 {
1614 };
1615 
1619 
1624 {
1627  int position;
1628 };
1629 
1633 
1638 {
1639  int firm_id;
1641 };
1642 
1646 
1651 {
1652  int firm_id;
1654  int position;
1655 };
1656 
1660 
1664 struct m_buy
1665 {
1666  int id;
1667  double budget;
1668 };
1669 
1673 
1677 struct m_bought
1678 {
1679  int id;
1680  double money_spent;
1682 };
1683 
1687 
1691 struct m_sell
1692 {
1693  int id;
1694  double price;
1696 };
1697 
1701 
1705 struct m_sold
1706 {
1707  int id;
1709 };
1710 
1714 
1719 {
1720  int quantity;
1721  double avg_price;
1722 };
1723 
1727 
1732 {
1733  double change;
1734 };
1735 
1739 
1743 struct m_fired
1744 {
1746 };
1747 
1751 
1756 {
1758  double wage;
1759 };
1760 
1764 
1769 {
1771 };
1772 
1776 
1781 {
1783  double wage;
1784 };
1785 
1789 
1794 {
1797  double wage;
1798 };
1799 
1803 
1808 {
1811 };
1812 
1816 
1821 {
1823  double wage;
1824 };
1825 
1829 
1834 {
1837  double wage;
1838 };
1839 
1843 
1848 {
1850  double wage;
1851  int nshares;
1852 };
1853 
1857 
1862 {
1863  int firm_id;
1864  double wage;
1865 };
1866 
1870 
1875 {
1876  int firm_id;
1877  int bank_id;
1878  double amount;
1879 };
1880 
1884 
1889 {
1890  int firm_id;
1891  int bank_id;
1892  double amount;
1893 };
1894 
1898 
1903 {
1904  int bank_id;
1905  int firm_id;
1906  double amount;
1907 };
1908 
1912 
1917 {
1918  int bank_id;
1919  int firm_id;
1920  double amount;
1921 };
1922 
1926 
1931 {
1932  int bank_id;
1933  double amount;
1934 };
1935 
1939 
1944 {
1945  double amount;
1946 };
1947 
1951 
1956 {
1957  double amount;
1958 };
1959 
1963 
1968 {
1969  double amount;
1970 };
1971 
1975 
1980 {
1981  double amount;
1982 };
1983 
1987 
1992 {
1993  double amount;
1994 };
1995 
1999 
2004 {
2005  int firm_id;
2006  double amount;
2007 };
2008 
2012 
2017 {
2018  int firm_id;
2019  double amount;
2020 };
2021 
2025 
2030 {
2031  int firm_id;
2032  int bank_id;
2033  double amount;
2034 };
2035 
2039 
2044 {
2045  int bank_id;
2046  double amount;
2047 };
2048 
2052 
2057 {
2058  int bank_id;
2059  double amount;
2060 };
2061 
2065 
2070 {
2071  int bank_id;
2072  double liquidity;
2073 };
2074 
2078 
2083 {
2084  int id;
2086  double net_income;
2087 };
2088 
2092 
2097 {
2098  int id;
2099  double net_income;
2100 };
2101 
2105 
2110 {
2111  int id;
2112  double amount;
2113 };
2114 
2118 
2123 {
2124  int id;
2125  double amount;
2126 };
2127 
2131 
2136 {
2137  double amount;
2138 };
2139 
2143 
2148 {
2149  double amount;
2150 };
2151 
2155 
2160 {
2161  double amount;
2162 };
2163 
2167 
2172 {
2173  double price;
2174 };
2175 
2179 
2184 {
2185  int buyer_id;
2186  int bank_id;
2187  double liquidity;
2191 };
2192 
2196 
2201 {
2203  double price;
2204  int quantity;
2205  int type;
2206 };
2207 
2211 
2216 {
2217  int buyer_id;
2219  double mortgage_used;
2220  double annuity;
2221 };
2222 
2226 
2231 {
2234  double price_sold;
2235 };
2236 
2240 
2245 {
2246  int bank_id;
2247  double equity;
2248  double risky_assets;
2249 };
2250 
2254 
2259 {
2260  int bank_id;
2261  double amount;
2262 };
2263 
2267 
2272 {
2273  int bank_id;
2274  double amount;
2275 };
2276 
2280 
2285 {
2286  int bank_id;
2287  double interest;
2288  double principal;
2289 };
2290 
2294 
2299 {
2300  int bank_id;
2301  double amount;
2302 };
2303 
2307 
2312 {
2313  int quantity;
2314  double avg_price;
2315 };
2316 
2320 typedef struct xmachine xmachine;
2433 
2438 
2443 
2448 
2453 
2458 
2463 
2468 
2473 
2478 
2483 
2488 
2493 
2498 
2503 
2508 
2513 
2518 
2523 
2528 
2532 typedef struct m_buy m_buy;
2533 
2537 typedef struct m_bought m_bought;
2538 
2542 typedef struct m_sell m_sell;
2543 
2547 typedef struct m_sold m_sold;
2548 
2553 
2558 
2562 typedef struct m_fired m_fired;
2563 
2568 
2573 
2578 
2583 
2588 
2593 
2598 
2603 
2608 
2613 
2618 
2623 
2628 
2633 
2638 
2643 
2648 
2653 
2658 
2663 
2668 
2673 
2678 
2683 
2688 
2693 
2698 
2703 
2708 
2713 
2718 
2723 
2728 
2733 
2738 
2743 
2748 
2753 
2758 
2763 
2768 
2773 
2778 
2779 
2783 struct location
2784 {
2785  double point;
2787  struct location * next;
2788 };
2789 
2794 {
2795  int node_id;
2796  double partition_data[6];
2799  struct xmachine * agents;
2820  struct m_buy * buy_messages;
2872 };
2873 
2874 
2878 typedef struct location location;
2883 
2971 
3187 char outputpath[1000];
3190 double total_time;
3199 //xmachine ** p_xmachine;
3203 /* Pointer to current $agent_name agent */
3204 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_firm * current_xmachine_firm;
3206 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_firm_holder * current_xmachine_firm_holder;
3207 xmachine_memory_firm_state * current_xmachine_firm_next_state; /* New agents added to this state */
3208 /* Pointer to list of firm agents in state FirmHousingPrice state */
3209 //xmachine_memory_firm * temp_xmachine_firm_FirmHousingPrice;
3211 /* Pointer to list of firm agents in state FirmHousingSell state */
3212 //xmachine_memory_firm * temp_xmachine_firm_FirmHousingSell;
3214 /* Pointer to list of firm agents in state FirmHousingMarket state */
3215 //xmachine_memory_firm * temp_xmachine_firm_FirmHousingMarket;
3217 /* Pointer to list of firm agents in state FirmCreditCheckTaxRate state */
3218 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditCheckTaxRate;
3220 /* Pointer to list of firm agents in state end state */
3221 //xmachine_memory_firm * temp_xmachine_firm_end;
3223 /* Pointer to list of firm agents in state FirmCreditInsolvencyCheck state */
3224 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditInsolvencyCheck;
3226 /* Pointer to list of firm agents in state FirmCreditDividendPayments state */
3227 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditDividendPayments;
3229 /* Pointer to list of firm agents in state FirmCreditBalanceSheet state */
3230 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditBalanceSheet;
3232 /* Pointer to list of firm agents in state FirmCreditBankruptcy state */
3233 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditBankruptcy;
3235 /* Pointer to list of firm agents in state FirmCreditLiquidityRecheck state */
3236 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditLiquidityRecheck;
3238 /* Pointer to list of firm agents in state FirmCreditIlliquidityStatus state */
3239 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditIlliquidityStatus;
3241 /* Pointer to list of firm agents in state FirmCreditLoanBorrow2 state */
3242 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditLoanBorrow2;
3244 /* Pointer to list of firm agents in state FirmCreditLoanBorrow1 state */
3245 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditLoanBorrow1;
3247 /* Pointer to list of firm agents in state FirmCreditPayments state */
3248 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditPayments;
3250 /* Pointer to list of firm agents in state FirmCreditStatus state */
3251 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditStatus;
3253 /* Pointer to list of firm agents in state FirmCreditLiquidityNeed state */
3254 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditLiquidityNeed;
3256 /* Pointer to list of firm agents in state FirmCreditComputeDividends state */
3257 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditComputeDividends;
3259 /* Pointer to list of firm agents in state FirmCreditInvestment state */
3260 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditInvestment;
3262 /* Pointer to list of firm agents in state FirmConstructionLabourDemand state */
3263 //xmachine_memory_firm * temp_xmachine_firm_FirmConstructionLabourDemand;
3265 /* Pointer to list of firm agents in state FirmProductionLabourDemand state */
3266 //xmachine_memory_firm * temp_xmachine_firm_FirmProductionLabourDemand;
3268 /* Pointer to list of firm agents in state FirmProductionPlanning state */
3269 //xmachine_memory_firm * temp_xmachine_firm_FirmProductionPlanning;
3271 /* Pointer to list of firm agents in state FirmProductionConstructor state */
3272 //xmachine_memory_firm * temp_xmachine_firm_FirmProductionConstructor;
3274 /* Pointer to list of firm agents in state FirmProductionRegular state */
3275 //xmachine_memory_firm * temp_xmachine_firm_FirmProductionRegular;
3277 /* Pointer to list of firm agents in state FirmProductionRoleCheck state */
3278 //xmachine_memory_firm * temp_xmachine_firm_FirmProductionRoleCheck;
3280 /* Pointer to list of firm agents in state FirmProductionSkip state */
3281 //xmachine_memory_firm * temp_xmachine_firm_FirmProductionSkip;
3283 /* Pointer to list of firm agents in state FirmProductionStart state */
3284 //xmachine_memory_firm * temp_xmachine_firm_FirmProductionStart;
3286 /* Pointer to list of firm agents in state FirmLabourWageAdjustment state */
3287 //xmachine_memory_firm * temp_xmachine_firm_FirmLabourWageAdjustment;
3289 /* Pointer to list of firm agents in state FirmLabourPayWages state */
3290 //xmachine_memory_firm * temp_xmachine_firm_FirmLabourPayWages;
3292 /* Pointer to list of firm agents in state FirmLabourStage2End state */
3293 //xmachine_memory_firm * temp_xmachine_firm_FirmLabourStage2End;
3295 /* Pointer to list of firm agents in state FirmLabourStage2 state */
3296 //xmachine_memory_firm * temp_xmachine_firm_FirmLabourStage2;
3298 /* Pointer to list of firm agents in state FirmLabourStage1Application state */
3299 //xmachine_memory_firm * temp_xmachine_firm_FirmLabourStage1Application;
3301 /* Pointer to list of firm agents in state FirmLabourStage1End state */
3302 //xmachine_memory_firm * temp_xmachine_firm_FirmLabourStage1End;
3304 /* Pointer to list of firm agents in state FirmLabourStage1 state */
3305 //xmachine_memory_firm * temp_xmachine_firm_FirmLabourStage1;
3307 /* Pointer to list of firm agents in state FirmLabourStart state */
3308 //xmachine_memory_firm * temp_xmachine_firm_FirmLabourStart;
3310 /* Pointer to list of firm agents in state FirmConsumptionPrice state */
3311 //xmachine_memory_firm * temp_xmachine_firm_FirmConsumptionPrice;
3313 /* Pointer to list of firm agents in state FirmReceiveSales state */
3314 //xmachine_memory_firm * temp_xmachine_firm_FirmReceiveSales;
3316 /* Pointer to list of firm agents in state FirmConsumptionMarket state */
3317 //xmachine_memory_firm * temp_xmachine_firm_FirmConsumptionMarket;
3319 /* Pointer to list of firm agents in state FirmHousingStart state */
3320 //xmachine_memory_firm * temp_xmachine_firm_FirmHousingStart;
3322 /* Pointer to list of firm agents in state FirmConsumptionStart state */
3323 //xmachine_memory_firm * temp_xmachine_firm_FirmConsumptionStart;
3325 /* Pointer to list of firm agents in state FirmCreditPolicyChecks state */
3326 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditPolicyChecks;
3328 /* Pointer to list of firm agents in state FirmUpdateDeposits state */
3329 //xmachine_memory_firm * temp_xmachine_firm_FirmUpdateDeposits;
3331 /* Pointer to list of firm agents in state FirmCreditStart state */
3332 //xmachine_memory_firm * temp_xmachine_firm_FirmCreditStart;
3334 /* Pointer to list of firm agents in state FirmInitBalanceSheet state */
3335 //xmachine_memory_firm * temp_xmachine_firm_FirmInitBalanceSheet;
3337 /* Pointer to list of firm agents in state FirmInitEmployment state */
3338 //xmachine_memory_firm * temp_xmachine_firm_FirmInitEmployment;
3340 /* Pointer to list of firm agents in state FirmLoop state */
3341 //xmachine_memory_firm * temp_xmachine_firm_FirmLoop;
3343 /* Pointer to list of firm agents in state FirmInitPostId state */
3344 //xmachine_memory_firm * temp_xmachine_firm_FirmInitPostId;
3346 /* Pointer to list of firm agents in state start state */
3347 //xmachine_memory_firm * temp_xmachine_firm_start;
3349 /* Pointer to current $agent_name agent */
3350 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_household * current_xmachine_household;
3354 /* Pointer to list of household agents in state HHHousingWriteOff state */
3355 //xmachine_memory_household * temp_xmachine_household_HHHousingWriteOff;
3357 /* Pointer to list of household agents in state HHHousingPayments state */
3358 //xmachine_memory_household * temp_xmachine_household_HHHousingPayments;
3360 /* Pointer to list of household agents in state HHHousingBargain state */
3361 //xmachine_memory_household * temp_xmachine_household_HHHousingBargain;
3363 /* Pointer to list of household agents in state HHHousingRevenue state */
3364 //xmachine_memory_household * temp_xmachine_household_HHHousingRevenue;
3366 /* Pointer to list of household agents in state HHHousingCheckWealth state */
3367 //xmachine_memory_household * temp_xmachine_household_HHHousingCheckWealth;
3369 /* Pointer to list of household agents in state HHHousingPrice state */
3370 //xmachine_memory_household * temp_xmachine_household_HHHousingPrice;
3372 /* Pointer to list of household agents in state HHHousingRole state */
3373 //xmachine_memory_household * temp_xmachine_household_HHHousingRole;
3375 /* Pointer to list of household agents in state HHCreditCheckTaxRate state */
3376 //xmachine_memory_household * temp_xmachine_household_HHCreditCheckTaxRate;
3378 /* Pointer to list of household agents in state HHCreditUpdateAnnuity state */
3379 //xmachine_memory_household * temp_xmachine_household_HHCreditUpdateAnnuity;
3381 /* Pointer to list of household agents in state end state */
3382 //xmachine_memory_household * temp_xmachine_household_end;
3384 /* Pointer to list of household agents in state HHCreditBalanceSheet state */
3385 //xmachine_memory_household * temp_xmachine_household_HHCreditBalanceSheet;
3387 /* Pointer to list of household agents in state HHCreditIsCapitalist state */
3388 //xmachine_memory_household * temp_xmachine_household_HHCreditIsCapitalist;
3390 /* Pointer to list of household agents in state HHCreditMonthly state */
3391 //xmachine_memory_household * temp_xmachine_household_HHCreditMonthly;
3393 /* Pointer to list of household agents in state HHLabourEmploymentStatus state */
3394 //xmachine_memory_household * temp_xmachine_household_HHLabourEmploymentStatus;
3396 /* Pointer to list of household agents in state HHLabourPayroll state */
3397 //xmachine_memory_household * temp_xmachine_household_HHLabourPayroll;
3399 /* Pointer to list of household agents in state HHLabourStage1Placement state */
3400 //xmachine_memory_household * temp_xmachine_household_HHLabourStage1Placement;
3402 /* Pointer to list of household agents in state HHLabourStage1Applications state */
3403 //xmachine_memory_household * temp_xmachine_household_HHLabourStage1Applications;
3405 /* Pointer to list of household agents in state HHLabourStage2 state */
3406 //xmachine_memory_household * temp_xmachine_household_HHLabourStage2;
3408 /* Pointer to list of household agents in state HHLabourStage1 state */
3409 //xmachine_memory_household * temp_xmachine_household_HHLabourStage1;
3411 /* Pointer to list of household agents in state HHLabourStart state */
3412 //xmachine_memory_household * temp_xmachine_household_HHLabourStart;
3414 /* Pointer to list of household agents in state HHHousingStart state */
3415 //xmachine_memory_household * temp_xmachine_household_HHHousingStart;
3417 /* Pointer to list of household agents in state HHConsumptionRecieveGoods state */
3418 //xmachine_memory_household * temp_xmachine_household_HHConsumptionRecieveGoods;
3420 /* Pointer to list of household agents in state HHConsumptionMonthly state */
3421 //xmachine_memory_household * temp_xmachine_household_HHConsumptionMonthly;
3423 /* Pointer to list of household agents in state HHConsumptionWeekly state */
3424 //xmachine_memory_household * temp_xmachine_household_HHConsumptionWeekly;
3426 /* Pointer to list of household agents in state HHConsumptionStart state */
3427 //xmachine_memory_household * temp_xmachine_household_HHConsumptionStart;
3429 /* Pointer to list of household agents in state HHCreditPolicyChecks state */
3430 //xmachine_memory_household * temp_xmachine_household_HHCreditPolicyChecks;
3432 /* Pointer to list of household agents in state HouseholdUpdateDeposits state */
3433 //xmachine_memory_household * temp_xmachine_household_HouseholdUpdateDeposits;
3435 /* Pointer to list of household agents in state HHCreditStart state */
3436 //xmachine_memory_household * temp_xmachine_household_HHCreditStart;
3438 /* Pointer to list of household agents in state HouseholdInitBalanceSheet state */
3439 //xmachine_memory_household * temp_xmachine_household_HouseholdInitBalanceSheet;
3441 /* Pointer to list of household agents in state HouseholdInitEmployment state */
3442 //xmachine_memory_household * temp_xmachine_household_HouseholdInitEmployment;
3444 /* Pointer to list of household agents in state HouseholdLoop state */
3445 //xmachine_memory_household * temp_xmachine_household_HouseholdLoop;
3447 /* Pointer to list of household agents in state HouseholdInitPostId state */
3448 //xmachine_memory_household * temp_xmachine_household_HouseholdInitPostId;
3450 /* Pointer to list of household agents in state start state */
3451 //xmachine_memory_household * temp_xmachine_household_start;
3453 /* Pointer to current $agent_name agent */
3454 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_equityfund * current_xmachine_equityfund;
3458 /* Pointer to list of equityfund agents in state EFCreditPolicyChecks state */
3459 //xmachine_memory_equityfund * temp_xmachine_equityfund_EFCreditPolicyChecks;
3461 /* Pointer to list of equityfund agents in state EFCreditBalanceSheet state */
3462 //xmachine_memory_equityfund * temp_xmachine_equityfund_EFCreditBalanceSheet;
3464 /* Pointer to list of equityfund agents in state end state */
3465 //xmachine_memory_equityfund * temp_xmachine_equityfund_end;
3467 /* Pointer to list of equityfund agents in state EFCreditDistributeShares state */
3468 //xmachine_memory_equityfund * temp_xmachine_equityfund_EFCreditDistributeShares;
3470 /* Pointer to list of equityfund agents in state EFCreditShareCollectionFirms state */
3471 //xmachine_memory_equityfund * temp_xmachine_equityfund_EFCreditShareCollectionFirms;
3473 /* Pointer to list of equityfund agents in state EFCreditShareCollectionBanks state */
3474 //xmachine_memory_equityfund * temp_xmachine_equityfund_EFCreditShareCollectionBanks;
3476 /* Pointer to list of equityfund agents in state EFCreditIncomeStatement state */
3477 //xmachine_memory_equityfund * temp_xmachine_equityfund_EFCreditIncomeStatement;
3479 /* Pointer to list of equityfund agents in state EFLabourMarket state */
3480 //xmachine_memory_equityfund * temp_xmachine_equityfund_EFLabourMarket;
3482 /* Pointer to list of equityfund agents in state EquityFundCredit state */
3483 //xmachine_memory_equityfund * temp_xmachine_equityfund_EquityFundCredit;
3485 /* Pointer to list of equityfund agents in state EquityFundLoop state */
3486 //xmachine_memory_equityfund * temp_xmachine_equityfund_EquityFundLoop;
3488 /* Pointer to list of equityfund agents in state start state */
3489 //xmachine_memory_equityfund * temp_xmachine_equityfund_start;
3491 /* Pointer to current $agent_name agent */
3492 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_bank * current_xmachine_bank;
3494 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_bank_holder * current_xmachine_bank_holder;
3495 xmachine_memory_bank_state * current_xmachine_bank_next_state; /* New agents added to this state */
3496 /* Pointer to list of bank agents in state BankHousingWriteOff state */
3497 //xmachine_memory_bank * temp_xmachine_bank_BankHousingWriteOff;
3499 /* Pointer to list of bank agents in state BankHousingMortgages state */
3500 //xmachine_memory_bank * temp_xmachine_bank_BankHousingMortgages;
3502 /* Pointer to list of bank agents in state BankHousingSales state */
3503 //xmachine_memory_bank * temp_xmachine_bank_BankHousingSales;
3505 /* Pointer to list of bank agents in state BankHousingCrediting state */
3506 //xmachine_memory_bank * temp_xmachine_bank_BankHousingCrediting;
3508 /* Pointer to list of bank agents in state end state */
3509 //xmachine_memory_bank * temp_xmachine_bank_end;
3511 /* Pointer to list of bank agents in state BankCreditLoanInterests state */
3512 //xmachine_memory_bank * temp_xmachine_bank_BankCreditLoanInterests;
3514 /* Pointer to list of bank agents in state BankCreditNewEntrants state */
3515 //xmachine_memory_bank * temp_xmachine_bank_BankCreditNewEntrants;
3517 /* Pointer to list of bank agents in state BankCreditLoanWriteOffs state */
3518 //xmachine_memory_bank * temp_xmachine_bank_BankCreditLoanWriteOffs;
3520 /* Pointer to list of bank agents in state BankCreditRequest2 state */
3521 //xmachine_memory_bank * temp_xmachine_bank_BankCreditRequest2;
3523 /* Pointer to list of bank agents in state BankCreditRequest1 state */
3524 //xmachine_memory_bank * temp_xmachine_bank_BankCreditRequest1;
3526 /* Pointer to list of bank agents in state BankCreditBalanceSheet state */
3527 //xmachine_memory_bank * temp_xmachine_bank_BankCreditBalanceSheet;
3529 /* Pointer to list of bank agents in state BankCreditDividends state */
3530 //xmachine_memory_bank * temp_xmachine_bank_BankCreditDividends;
3532 /* Pointer to list of bank agents in state BankHousingMarket state */
3533 //xmachine_memory_bank * temp_xmachine_bank_BankHousingMarket;
3535 /* Pointer to list of bank agents in state BankCreditPolicyChecks state */
3536 //xmachine_memory_bank * temp_xmachine_bank_BankCreditPolicyChecks;
3538 /* Pointer to list of bank agents in state BankUpdateDeposits state */
3539 //xmachine_memory_bank * temp_xmachine_bank_BankUpdateDeposits;
3541 /* Pointer to list of bank agents in state BankCreditStart state */
3542 //xmachine_memory_bank * temp_xmachine_bank_BankCreditStart;
3544 /* Pointer to list of bank agents in state BankInitBalanceSheet state */
3545 //xmachine_memory_bank * temp_xmachine_bank_BankInitBalanceSheet;
3547 /* Pointer to list of bank agents in state BankInitDeposits state */
3548 //xmachine_memory_bank * temp_xmachine_bank_BankInitDeposits;
3550 /* Pointer to list of bank agents in state BankInitMortgages state */
3551 //xmachine_memory_bank * temp_xmachine_bank_BankInitMortgages;
3553 /* Pointer to list of bank agents in state BankLoop state */
3554 //xmachine_memory_bank * temp_xmachine_bank_BankLoop;
3556 /* Pointer to list of bank agents in state BankInitLoans state */
3557 //xmachine_memory_bank * temp_xmachine_bank_BankInitLoans;
3559 /* Pointer to list of bank agents in state start state */
3560 //xmachine_memory_bank * temp_xmachine_bank_start;
3562 /* Pointer to current $agent_name agent */
3563 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_government * current_xmachine_government;
3567 /* Pointer to list of government agents in state GovernmentUpdatePolicy state */
3568 //xmachine_memory_government * temp_xmachine_government_GovernmentUpdatePolicy;
3570 /* Pointer to list of government agents in state GovernmentBalanceSheet state */
3571 //xmachine_memory_government * temp_xmachine_government_GovernmentBalanceSheet;
3573 /* Pointer to list of government agents in state GovernmentIncomeStatement state */
3574 //xmachine_memory_government * temp_xmachine_government_GovernmentIncomeStatement;
3576 /* Pointer to list of government agents in state end state */
3577 //xmachine_memory_government * temp_xmachine_government_end;
3579 /* Pointer to list of government agents in state GovernmentLabourTax state */
3580 //xmachine_memory_government * temp_xmachine_government_GovernmentLabourTax;
3582 /* Pointer to list of government agents in state GovernmentUnemploymentBenefits state */
3583 //xmachine_memory_government * temp_xmachine_government_GovernmentUnemploymentBenefits;
3585 /* Pointer to list of government agents in state GovernmentMonthly state */
3586 //xmachine_memory_government * temp_xmachine_government_GovernmentMonthly;
3588 /* Pointer to list of government agents in state GovernmentFiscalPolicy state */
3589 //xmachine_memory_government * temp_xmachine_government_GovernmentFiscalPolicy;
3591 /* Pointer to list of government agents in state GovernmentLabourStatus state */
3592 //xmachine_memory_government * temp_xmachine_government_GovernmentLabourStatus;
3594 /* Pointer to list of government agents in state GovernmentCredit state */
3595 //xmachine_memory_government * temp_xmachine_government_GovernmentCredit;
3597 /* Pointer to list of government agents in state GovernmentLoop state */
3598 //xmachine_memory_government * temp_xmachine_government_GovernmentLoop;
3600 /* Pointer to list of government agents in state start state */
3601 //xmachine_memory_government * temp_xmachine_government_start;
3603 /* Pointer to current $agent_name agent */
3604 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_centralbank * current_xmachine_centralbank;
3608 /* Pointer to list of centralbank agents in state CentralBankUpdateInterestRate state */
3609 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankUpdateInterestRate;
3611 /* Pointer to list of centralbank agents in state CentralBankBalanceSheet state */
3612 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankBalanceSheet;
3614 /* Pointer to list of centralbank agents in state CentralBankGovernmentRequests state */
3615 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankGovernmentRequests;
3617 /* Pointer to list of centralbank agents in state end state */
3618 //xmachine_memory_centralbank * temp_xmachine_centralbank_end;
3620 /* Pointer to list of centralbank agents in state CentralBankDebtRequests state */
3621 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankDebtRequests;
3623 /* Pointer to list of centralbank agents in state CentralBankPolicy state */
3624 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankPolicy;
3626 /* Pointer to list of centralbank agents in state CentralBankLabour state */
3627 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankLabour;
3629 /* Pointer to list of centralbank agents in state CentralBankHousing state */
3630 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankHousing;
3632 /* Pointer to list of centralbank agents in state CentralBankConsumptionPrices state */
3633 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankConsumptionPrices;
3635 /* Pointer to list of centralbank agents in state CentralBankConsumption state */
3636 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankConsumption;
3638 /* Pointer to list of centralbank agents in state CentralBankCredit state */
3639 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankCredit;
3641 /* Pointer to list of centralbank agents in state CentralBankLoop state */
3642 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankLoop;
3644 /* Pointer to list of centralbank agents in state CentralBankInitBalanceSheet state */
3645 //xmachine_memory_centralbank * temp_xmachine_centralbank_CentralBankInitBalanceSheet;
3647 /* Pointer to list of centralbank agents in state start state */
3648 //xmachine_memory_centralbank * temp_xmachine_centralbank_start;
3650 /* Pointer to current $agent_name agent */
3651 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_jpoffice * current_xmachine_jpoffice;
3655 /* Pointer to list of jpoffice agents in state JPOLabourStage2 state */
3656 //xmachine_memory_jpoffice * temp_xmachine_jpoffice_JPOLabourStage2;
3658 /* Pointer to list of jpoffice agents in state end state */
3659 //xmachine_memory_jpoffice * temp_xmachine_jpoffice_end;
3661 /* Pointer to list of jpoffice agents in state JPOLabourMarket state */
3662 //xmachine_memory_jpoffice * temp_xmachine_jpoffice_JPOLabourMarket;
3664 /* Pointer to list of jpoffice agents in state JPOfficeLoop state */
3665 //xmachine_memory_jpoffice * temp_xmachine_jpoffice_JPOfficeLoop;
3667 /* Pointer to list of jpoffice agents in state JPOfficeInitEmployment state */
3668 //xmachine_memory_jpoffice * temp_xmachine_jpoffice_JPOfficeInitEmployment;
3670 /* Pointer to list of jpoffice agents in state start state */
3671 //xmachine_memory_jpoffice * temp_xmachine_jpoffice_start;
3673 /* Pointer to current $agent_name agent */
3674 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_mall * current_xmachine_mall;
3676 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_mall_holder * current_xmachine_mall_holder;
3677 xmachine_memory_mall_state * current_xmachine_mall_next_state; /* New agents added to this state */
3678 /* Pointer to list of mall agents in state MallConsumptionSummary state */
3679 //xmachine_memory_mall * temp_xmachine_mall_MallConsumptionSummary;
3681 /* Pointer to list of mall agents in state end state */
3682 //xmachine_memory_mall * temp_xmachine_mall_end;
3684 /* Pointer to list of mall agents in state MallConsumptionMarket state */
3685 //xmachine_memory_mall * temp_xmachine_mall_MallConsumptionMarket;
3687 /* Pointer to list of mall agents in state start state */
3688 //xmachine_memory_mall * temp_xmachine_mall_start;
3690 /* Pointer to current $agent_name agent */
3691 /*@dependent@*/ /*@null@*/ /*@out@*/ xmachine_memory_reagency * current_xmachine_reagency;
3695 /* Pointer to list of reagency agents in state REAgencyHousingSummary state */
3696 //xmachine_memory_reagency * temp_xmachine_reagency_REAgencyHousingSummary;
3698 /* Pointer to list of reagency agents in state end state */
3699 //xmachine_memory_reagency * temp_xmachine_reagency_end;
3701 /* Pointer to list of reagency agents in state REAgencyCreditPolicyChecks state */
3702 //xmachine_memory_reagency * temp_xmachine_reagency_REAgencyCreditPolicyChecks;
3704 /* Pointer to list of reagency agents in state REAgencyHousingMarket state */
3705 //xmachine_memory_reagency * temp_xmachine_reagency_REAgencyHousingMarket;
3707 /* Pointer to list of reagency agents in state start state */
3708 //xmachine_memory_reagency * temp_xmachine_reagency_start;
3710 
3711 
3712 
3715 
3718 
3721 
3724 
3727 
3730 
3733 
3736 
3739 
3742 
3745 
3748 
3751 
3753 MBt_Iterator i_interest_rate;
3754 
3756 MBt_Iterator i_capital_tax_rate;
3757 
3759 MBt_Iterator i_labour_tax_rate;
3760 
3763 
3766 
3768 MBt_Iterator i_firm_jpoffice_id;
3769 
3772 
3773 MBt_Board b_buy;
3774 MBt_Iterator i_buy;
3775 
3776 MBt_Board b_bought;
3777 MBt_Iterator i_bought;
3778 
3779 MBt_Board b_sell;
3780 MBt_Iterator i_sell;
3781 
3782 MBt_Board b_sold;
3783 MBt_Iterator i_sold;
3784 
3787 
3790 
3791 MBt_Board b_fired;
3792 MBt_Iterator i_fired;
3793 
3795 MBt_Iterator i_vacancy_stage1;
3796 
3799 
3802 
3804 MBt_Iterator i_job_match_stage1;
3805 
3806 MBt_Board b_job_change;
3807 MBt_Iterator i_job_change;
3808 
3810 MBt_Iterator i_vacancy_stage2;
3811 
3813 MBt_Iterator i_job_match_stage2;
3814 
3816 MBt_Iterator i_employment_status;
3817 
3820 
3823 
3826 
3829 
3832 
3835 
3837 MBt_Iterator i_household_share;
3838 
3839 MBt_Board b_capital_tax;
3840 MBt_Iterator i_capital_tax;
3841 
3842 MBt_Board b_labour_tax;
3843 MBt_Iterator i_labour_tax;
3844 
3847 
3849 MBt_Iterator i_general_benefit;
3850 
3851 MBt_Board b_fund_request;
3852 MBt_Iterator i_fund_request;
3853 
3855 MBt_Iterator i_fund_request_ack;
3856 
3858 MBt_Iterator i_new_entrant_loan;
3859 
3862 
3864 MBt_Iterator i_loan_writeoff;
3865 
3868 
3870 MBt_Iterator i_firm_net_profit;
3871 
3873 MBt_Iterator i_bank_net_profit;
3874 
3877 
3880 
3883 
3886 
3889 
3891 MBt_Iterator i_housing_price;
3892 
3893 MBt_Board b_buy_housing;
3894 MBt_Iterator i_buy_housing;
3895 
3896 MBt_Board b_sell_housing;
3897 MBt_Iterator i_sell_housing;
3898 
3900 MBt_Iterator i_bought_housing;
3901 
3902 MBt_Board b_sold_housing;
3903 MBt_Iterator i_sold_housing;
3904 
3907 
3909 MBt_Iterator i_mortgage_requests;
3910 
3913 
3915 MBt_Iterator i_mortgage_payment;
3916 
3918 MBt_Iterator i_mortgage_writeoff;
3919 
3922 
3923 
4143 
4153 
4156 #define SPINF 999999.123456
4157 
4159 #define RELEASE 1
4160 
4162 #define kill_me_now return 1
4163 
4164 void initialise_pointers(void);
4165 void initialise_unit_testing(void);
4167 void free_FLAME_outputs(FLAME_output ** outputs);
4168 void add_location(double point, location ** p_location);
4169 void freelocations(location ** p_location);
4170 void add_node(int node_id, double minx, double maxx, double miny, double maxy, double minz, double maxz);
4171 void clean_up(int code);
4172 void propagate_agents(void);
4173 void propagate_messages_init(void);
4174 void propagate_messages_complete(void);
4175 void create_partitions(char * filename, int * itno);
4176 void free_node_info(void);
4177 void free_agent(void);
4178 void freexmachines(void);
4179 /* model datatypes */
4180 
4185 void add_transaction(transaction_array * array, int quantity, double avg_price);
4186 void remove_transaction(transaction_array * array, int index);
4187 
4188 void init_buyer_array(buyer_array * array);
4189 void reset_buyer_array(buyer_array * array);
4190 void free_buyer_array(buyer_array * array);
4191 void copy_buyer_array(buyer_array * from, buyer_array * to);
4192 void add_buyer(buyer_array * array, int id, double budget);
4193 void remove_buyer(buyer_array * array, int index);
4194 
4195 void init_seller_array(seller_array * array);
4196 void reset_seller_array(seller_array * array);
4197 void free_seller_array(seller_array * array);
4198 void copy_seller_array(seller_array * from, seller_array * to);
4199 void add_seller(seller_array * array, int id, double price, int inventory, double inv_price);
4200 void remove_seller(seller_array * array, int index);
4201 
4202 void init_vacancy_array(vacancy_array * array);
4203 void reset_vacancy_array(vacancy_array * array);
4204 void free_vacancy_array(vacancy_array * array);
4206 void add_vacancy(vacancy_array * array, int id, double wage);
4207 void remove_vacancy(vacancy_array * array, int index);
4208 
4209 void init_employee_array(employee_array * array);
4210 void reset_employee_array(employee_array * array);
4211 void free_employee_array(employee_array * array);
4213 void add_employee(employee_array * array, int id, double wage);
4214 void remove_employee(employee_array * array, int index);
4215 
4216 void init_mortgage_array(mortgage_array * array);
4217 void reset_mortgage_array(mortgage_array * array);
4218 void free_mortgage_array(mortgage_array * array);
4220 void add_mortgage(mortgage_array * array, int bank_id, double principal, int quarters_left, double quarterly_interest, double quarterly_principal, double interestrate, int mtype);
4221 void remove_mortgage(mortgage_array * array, int index);
4222 
4223 void init_loan_array(loan_array * array);
4224 void reset_loan_array(loan_array * array);
4225 void free_loan_array(loan_array * array);
4226 void copy_loan_array(loan_array * from, loan_array * to);
4227 void add_loan(loan_array * array, int bank_id, double amount, double to_be_paid);
4228 void remove_loan(loan_array * array, int index);
4229 
4230 void init_hbuyer_array(hbuyer_array * array);
4231 void reset_hbuyer_array(hbuyer_array * array);
4232 void free_hbuyer_array(hbuyer_array * array);
4233 void copy_hbuyer_array(hbuyer_array * from, hbuyer_array * to);
4234 void add_hbuyer(hbuyer_array * array, int buyer_id, int bank_id, double liquidity, double quarterly_income, double quarterly_mortgage_paid, int choice);
4235 void remove_hbuyer(hbuyer_array * array, int index);
4236 
4237 void init_hseller_array(hseller_array * array);
4238 void reset_hseller_array(hseller_array * array);
4239 void free_hseller_array(hseller_array * array);
4241 void add_hseller(hseller_array * array, int seller_id, double price, int quantity, int type);
4242 void remove_hseller(hseller_array * array, int index);
4243 
4244 void init_hbank_array(hbank_array * array);
4245 void reset_hbank_array(hbank_array * array);
4246 void free_hbank_array(hbank_array * array);
4247 void copy_hbank_array(hbank_array * from, hbank_array * to);
4248 void add_hbank(hbank_array * array, int id, double equity, double risky_assets, double amount_mortgaged);
4249 void remove_hbank(hbank_array * array, int index);
4250 
4251 void init_int_static_array(/*@out@*/ int * array, int size);
4252 void init_int_array(int_array * array);
4253 void reset_int_array(int_array * array);
4254 void free_int_array(int_array * array);
4255 void copy_int_array(int_array * from, int_array * to);
4256 //void sort_int_array(int_array array);
4257 //int quicksort_int(int array, int elements);
4258 void add_int(int_array * array, int new_int);
4259 void remove_int(int_array * array, int index);
4260 void print_int_array(int_array * array);
4261 void init_float_static_array(float * array, int size);
4262 void init_float_array(float_array * array);
4263 void reset_float_array(float_array * array);
4264 void free_float_array(float_array * array);
4265 void copy_float_array(float_array * from, float_array * to);
4266 //void sort_float_array(float_array array);
4267 //int quicksort_float(float array, int elements);
4268 void add_float(float_array * array, float new_float);
4269 void remove_float(float_array * array, int index);
4270 void print_float_array(float_array * array);
4271 void init_double_static_array(/*@out@*/ double* array, int size);
4272 void init_double_array(double_array * array);
4273 void reset_double_array(double_array * array);
4274 void free_double_array(double_array * array);
4275 void copy_double_array(double_array * from, double_array * to);
4276 //void sort_double_array(double_array array);
4277 //int quicksort_double(double array, int elements);
4278 void add_double(double_array * array, double new_double);
4279 void remove_double(double_array * array, int index);
4280 void print_double_array(double_array * array);
4281 void init_char_static_array(/*@out@*/ char * array, int size);
4282 void init_char_array(char_array * array);
4283 void reset_char_array(char_array * array);
4284 void free_char_array(char_array * array);
4285 void copy_char_array(char_array * from, char_array * to);
4286 void add_char(char_array * array, char new_char);
4287 void remove_char(char_array * array, int index);
4288 char * copy_array_to_str(char_array * array);
4289 void print_char_array(char_array * array);
4290 int idle(void);
4291 /* xml.c */
4292 int read_int_static_array(char * buffer, int buffer_size, int * j, int * int_static_array, int size);
4293 int read_float_static_array(char * buffer, int buffer_size, int * j, float * float_static_array, int size);
4294 int read_double_static_array(char * buffer, int buffer_size, int * j, double * double_static_array, int size);
4295 int read_char_static_array(char * buffer, int buffer_size, int * j, char * char_static_array, int size);
4296 int read_int_dynamic_array(char * buffer, int buffer_size, int * j, int_array * int_dynamic_array);
4297 int read_float_dynamic_array(char * buffer, int buffer_size, int * j, float_array * float_dynamic_array);
4298 int read_double_dynamic_array(char * buffer, int buffer_size, int * j, double_array * double_dynamic_array);
4299 int read_char_dynamic_array(char * buffer, int buffer_size, int * j, char_array * char_dynamic_array);
4300 
4301 void init_transaction(/*@out@*/ transaction * temp);
4302 void init_transaction_static_array(/*@out@*/ transaction * array, int size);
4303 int read_transaction(char * buffer, int buffer_size, int * j, transaction * temp_datatype);
4304 int read_transaction_dynamic_array(char * buffer, int buffer_size, int * j, transaction_array * temp_datatype_array);
4305 int read_transaction_static_array(char * buffer, int buffer_size, int * j, transaction * temp_datatype_array, int size);
4306 void write_transaction(FILE *file, transaction * temp_datatype);
4307 void write_transaction_static_array(FILE *file, transaction * temp_datatype, int size);
4308 void write_transaction_dynamic_array(FILE *file, transaction_array * temp_datatype);
4309 void init_buyer(/*@out@*/ buyer * temp);
4310 void init_buyer_static_array(/*@out@*/ buyer * array, int size);
4311 int read_buyer(char * buffer, int buffer_size, int * j, buyer * temp_datatype);
4312 int read_buyer_dynamic_array(char * buffer, int buffer_size, int * j, buyer_array * temp_datatype_array);
4313 int read_buyer_static_array(char * buffer, int buffer_size, int * j, buyer * temp_datatype_array, int size);
4314 void write_buyer(FILE *file, buyer * temp_datatype);
4315 void write_buyer_static_array(FILE *file, buyer * temp_datatype, int size);
4316 void write_buyer_dynamic_array(FILE *file, buyer_array * temp_datatype);
4317 void init_seller(/*@out@*/ seller * temp);
4318 void init_seller_static_array(/*@out@*/ seller * array, int size);
4319 int read_seller(char * buffer, int buffer_size, int * j, seller * temp_datatype);
4320 int read_seller_dynamic_array(char * buffer, int buffer_size, int * j, seller_array * temp_datatype_array);
4321 int read_seller_static_array(char * buffer, int buffer_size, int * j, seller * temp_datatype_array, int size);
4322 void write_seller(FILE *file, seller * temp_datatype);
4323 void write_seller_static_array(FILE *file, seller * temp_datatype, int size);
4324 void write_seller_dynamic_array(FILE *file, seller_array * temp_datatype);
4325 void init_vacancy(/*@out@*/ vacancy * temp);
4326 void init_vacancy_static_array(/*@out@*/ vacancy * array, int size);
4327 int read_vacancy(char * buffer, int buffer_size, int * j, vacancy * temp_datatype);
4328 int read_vacancy_dynamic_array(char * buffer, int buffer_size, int * j, vacancy_array * temp_datatype_array);
4329 int read_vacancy_static_array(char * buffer, int buffer_size, int * j, vacancy * temp_datatype_array, int size);
4330 void write_vacancy(FILE *file, vacancy * temp_datatype);
4331 void write_vacancy_static_array(FILE *file, vacancy * temp_datatype, int size);
4332 void write_vacancy_dynamic_array(FILE *file, vacancy_array * temp_datatype);
4333 void init_employee(/*@out@*/ employee * temp);
4334 void init_employee_static_array(/*@out@*/ employee * array, int size);
4335 int read_employee(char * buffer, int buffer_size, int * j, employee * temp_datatype);
4336 int read_employee_dynamic_array(char * buffer, int buffer_size, int * j, employee_array * temp_datatype_array);
4337 int read_employee_static_array(char * buffer, int buffer_size, int * j, employee * temp_datatype_array, int size);
4338 void write_employee(FILE *file, employee * temp_datatype);
4339 void write_employee_static_array(FILE *file, employee * temp_datatype, int size);
4340 void write_employee_dynamic_array(FILE *file, employee_array * temp_datatype);
4341 void init_mortgage(/*@out@*/ mortgage * temp);
4342 void init_mortgage_static_array(/*@out@*/ mortgage * array, int size);
4343 int read_mortgage(char * buffer, int buffer_size, int * j, mortgage * temp_datatype);
4344 int read_mortgage_dynamic_array(char * buffer, int buffer_size, int * j, mortgage_array * temp_datatype_array);
4345 int read_mortgage_static_array(char * buffer, int buffer_size, int * j, mortgage * temp_datatype_array, int size);
4346 void write_mortgage(FILE *file, mortgage * temp_datatype);
4347 void write_mortgage_static_array(FILE *file, mortgage * temp_datatype, int size);
4348 void write_mortgage_dynamic_array(FILE *file, mortgage_array * temp_datatype);
4349 void init_loan(/*@out@*/ loan * temp);
4350 void init_loan_static_array(/*@out@*/ loan * array, int size);
4351 int read_loan(char * buffer, int buffer_size, int * j, loan * temp_datatype);
4352 int read_loan_dynamic_array(char * buffer, int buffer_size, int * j, loan_array * temp_datatype_array);
4353 int read_loan_static_array(char * buffer, int buffer_size, int * j, loan * temp_datatype_array, int size);
4354 void write_loan(FILE *file, loan * temp_datatype);
4355 void write_loan_static_array(FILE *file, loan * temp_datatype, int size);
4356 void write_loan_dynamic_array(FILE *file, loan_array * temp_datatype);
4357 void init_hbuyer(/*@out@*/ hbuyer * temp);
4358 void init_hbuyer_static_array(/*@out@*/ hbuyer * array, int size);
4359 int read_hbuyer(char * buffer, int buffer_size, int * j, hbuyer * temp_datatype);
4360 int read_hbuyer_dynamic_array(char * buffer, int buffer_size, int * j, hbuyer_array * temp_datatype_array);
4361 int read_hbuyer_static_array(char * buffer, int buffer_size, int * j, hbuyer * temp_datatype_array, int size);
4362 void write_hbuyer(FILE *file, hbuyer * temp_datatype);
4363 void write_hbuyer_static_array(FILE *file, hbuyer * temp_datatype, int size);
4364 void write_hbuyer_dynamic_array(FILE *file, hbuyer_array * temp_datatype);
4365 void init_hseller(/*@out@*/ hseller * temp);
4366 void init_hseller_static_array(/*@out@*/ hseller * array, int size);
4367 int read_hseller(char * buffer, int buffer_size, int * j, hseller * temp_datatype);
4368 int read_hseller_dynamic_array(char * buffer, int buffer_size, int * j, hseller_array * temp_datatype_array);
4369 int read_hseller_static_array(char * buffer, int buffer_size, int * j, hseller * temp_datatype_array, int size);
4370 void write_hseller(FILE *file, hseller * temp_datatype);
4371 void write_hseller_static_array(FILE *file, hseller * temp_datatype, int size);
4372 void write_hseller_dynamic_array(FILE *file, hseller_array * temp_datatype);
4373 void init_hbank(/*@out@*/ hbank * temp);
4374 void init_hbank_static_array(/*@out@*/ hbank * array, int size);
4375 int read_hbank(char * buffer, int buffer_size, int * j, hbank * temp_datatype);
4376 int read_hbank_dynamic_array(char * buffer, int buffer_size, int * j, hbank_array * temp_datatype_array);
4377 int read_hbank_static_array(char * buffer, int buffer_size, int * j, hbank * temp_datatype_array, int size);
4378 void write_hbank(FILE *file, hbank * temp_datatype);
4379 void write_hbank_static_array(FILE *file, hbank * temp_datatype, int size);
4380 void write_hbank_dynamic_array(FILE *file, hbank_array * temp_datatype);
4381 
4382 void readinitialstates(char * filename, char * filelocation, int * itno, double cloud_data[],
4383  int partition_method, int flag);
4384 void saveiterationdata(int iteration_number);
4385 
4386 void free_transaction(transaction * temp);
4387 void free_transaction_static_array(transaction * array, int size);
4388 void copy_transaction(transaction * from, transaction * to);
4389 void copy_transaction_static_array(transaction * from, transaction * to, int size);
4390 void free_buyer(buyer * temp);
4391 void free_buyer_static_array(buyer * array, int size);
4392 void copy_buyer(buyer * from, buyer * to);
4393 void copy_buyer_static_array(buyer * from, buyer * to, int size);
4394 void free_seller(seller * temp);
4395 void free_seller_static_array(seller * array, int size);
4396 void copy_seller(seller * from, seller * to);
4397 void copy_seller_static_array(seller * from, seller * to, int size);
4398 void free_vacancy(vacancy * temp);
4399 void free_vacancy_static_array(vacancy * array, int size);
4400 void copy_vacancy(vacancy * from, vacancy * to);
4401 void copy_vacancy_static_array(vacancy * from, vacancy * to, int size);
4402 void free_employee(employee * temp);
4403 void free_employee_static_array(employee * array, int size);
4404 void copy_employee(employee * from, employee * to);
4405 void copy_employee_static_array(employee * from, employee * to, int size);
4406 void free_mortgage(mortgage * temp);
4407 void free_mortgage_static_array(mortgage * array, int size);
4408 void copy_mortgage(mortgage * from, mortgage * to);
4409 void copy_mortgage_static_array(mortgage * from, mortgage * to, int size);
4410 void free_loan(loan * temp);
4411 void free_loan_static_array(loan * array, int size);
4412 void copy_loan(loan * from, loan * to);
4413 void copy_loan_static_array(loan * from, loan * to, int size);
4414 void free_hbuyer(hbuyer * temp);
4415 void free_hbuyer_static_array(hbuyer * array, int size);
4416 void copy_hbuyer(hbuyer * from, hbuyer * to);
4417 void copy_hbuyer_static_array(hbuyer * from, hbuyer * to, int size);
4418 void free_hseller(hseller * temp);
4419 void free_hseller_static_array(hseller * array, int size);
4420 void copy_hseller(hseller * from, hseller * to);
4421 void copy_hseller_static_array(hseller * from, hseller * to, int size);
4422 void free_hbank(hbank * temp);
4423 void free_hbank_static_array(hbank * array, int size);
4424 void copy_hbank(hbank * from, hbank * to);
4425 void copy_hbank_static_array(hbank * from, hbank * to, int size);
4426 
4432 void add_firm_agent(int id, int bank_id, int isconstructor, int day_of_month_to_act, int isinsolvent, int it_no, int day_of_week_to_act, double average_goods_price, int_array * employees, int manager, double wage_offer, double average_wage, int no_employees, int vacancies, int employees_needed, int day_of_month_wages_paid, double labour_productivity, double capital_productivity, int capital_goods, double capital_goods_price, int production_current, int expected_sales, int production_plan, double unit_goods_price, double unit_cost, int day_of_month_production_completed, double unit_house_price, int projects[], double loans_interest_rate, double debt, int inventory, int sales, double revenues, double total_assets, double operating_costs, double labour_costs, double total_interest_payments, double dividends_paid, double dividends_to_be_paid, double retained_earnings, double net_earnings, double ebit, double equity, double liquidity, int isliquidshort, int hasloan, int hasinvestment, int isilliquid, double planned_investment_costs, double liquidity_need, loan loan_list[], double labour_tax_rate, double delta_housing_price);
4440 void add_household_agent(int id, int bank_id, int it_no, int day_of_week_to_act, double weekly_consumption_budget, double mall_budget, double quarterly_price_change, int my_employer_id, double wage, int ismanager, double government_benefits, int day_of_month_to_act, int day_of_month_wage_recieved, double mortgages_interest_rate, double labour_tax_rate, mortgage_array * mortgages_list, double mortgages, double housing_payment, double equity, double housing_price, int housing_units, int n_shares, double liquidity, double capital_income, double previous_wages[], double previous_benefits[], double labour_income, double total_assets, double housing_value, double expected_housing_payment, int hmarket_role, double equity_ratio, double minimum_equity_ratio, double mortgage_costs[], double delta_housing_value, int mortgage_choice);
4448 void add_equityfund_agent(int id, int it_no, int day_of_month_to_act, int day_of_month_wages_paid, double share_firms, double share_construction_firms, double share_banks, double equity, double liquidity, int n_shares, double dividends_recieved, double dividends_retained, double dividends_paid, double firm_investment, double capital_tax_rate);
4456 void add_bank_agent(int id, int day_of_month_to_act, int day_of_week_to_act, int it_no, double total_assets, double loans, double loans_start, double mortgages, double deposits, double centralbank_debt, double equity, double liquidity, double revenues, double total_writeoffs, double interest_rate, double interests_accrued, double interests_paid, double dividends_paid, double total_dividends, double retained_earnings, double net_earnings, double total_costs);
4464 void add_government_agent(int id, int it_no, double average_wage, double unemployment_rate, int population_size, double debt, double equity, double liquidity, int day_of_month_to_act, int day_of_month_wages_paid, double capital_tax_rate, double labour_tax_rate, double labour_tax_income, double capital_tax_income, double gov_general_benefit_rate, double gov_unemployment_rate, double general_benefits, double unemployment_benefits, double earnings, double centralbank_income, double expenditures);
4472 void add_centralbank_agent(int id, int day_of_month_to_act, double unemployment_rate, double inflation_rate, double consumption_goods_prices[], int it_no, int day_of_week_to_act, transaction goods, double weekly_price_averages[], int day_of_month_wages_paid, double interest_rate, double liquidity, double loans_banks, double loans_government, double fiat_money, double equity, double liquidity_banks, double liquidity_government, double liquidity_equityfund, double total_assets, double total_writeoffs, double interests_accrued, double revenues, double net_earnings, double total_costs, transaction houses);
4480 void add_jpoffice_agent(int id, int it_no, int day_of_month_to_act);
4488 void add_mall_agent(int id, int it_no, int day_of_week_to_act, transaction goods_transactions);
4496 void add_reagency_agent(int id, int day_of_month_to_act, int it_no, double mortgages_interest_rate, transaction housing_transactions);
4499 
4500 void add_firm_bank_init_loans_message(int bank_id, double amount);
4505 
4506 void add_firm_bank_init_deposit_message(int bank_id, double amount);
4511 
4512 void add_firm_bank_update_deposit_message(int bank_id, double amount);
4517 
4518 void add_household_bank_init_mortgages_message(int bank_id, double amount);
4523 
4524 void add_household_bank_init_deposit_message(int bank_id, double amount);
4529 
4530 void add_household_bank_update_deposit_message(int bank_id, double amount);
4535 
4536 void add_bank_centralbank_init_debt_message(int bank_id, double amount);
4541 
4542 void add_bank_centralbank_init_deposit_message(int bank_id, double amount);
4547 
4548 void add_bank_centralbank_update_deposit_message(int bank_id, double amount);
4553 
4554 void add_fund_centralbank_init_deposit_message(double amount);
4559 
4565 
4566 void add_gov_centralbank_init_deposit_message(double amount);
4571 
4572 void add_gov_centralbank_update_deposit_message(double amount);
4577 
4578 void add_interest_rate_message(double rate);
4582 void freeinterest_ratemessages(void);
4583 
4584 void add_capital_tax_rate_message(double value);
4588 void freecapital_tax_ratemessages(void);
4589 
4590 void add_labour_tax_rate_message(double value);
4594 void freelabour_tax_ratemessages(void);
4595 
4596 void add_household_jpoffice_id_message(int household_id);
4601 
4602 void add_jpoffice_household_employer_message(int household_id, int employer_id, int position);
4607 
4608 void add_firm_jpoffice_id_message(int firm_id, int isconstructor);
4612 void freefirm_jpoffice_idmessages(void);
4613 
4614 void add_jpoffice_firm_employee_message(int firm_id, int employee_id, int position);
4619 
4620 void add_buy_message(int id, double budget);
4623 m_buy * get_next_buy_message(m_buy * current);
4624 void freebuymessages(void);
4625 
4626 void add_bought_message(int id, double money_spent, int received_quantity);
4630 void freeboughtmessages(void);
4631 
4632 void add_sell_message(int id, double price, int inventory);
4635 m_sell * get_next_sell_message(m_sell * current);
4636 void freesellmessages(void);
4637 
4638 void add_sold_message(int id, int sold_quantities);
4641 m_sold * get_next_sold_message(m_sold * current);
4642 void freesoldmessages(void);
4643 
4644 void add_goods_transactions_summary_message(int quantity, double avg_price);
4649 
4655 
4656 void add_fired_message(int employee_id);
4660 void freefiredmessages(void);
4661 
4662 void add_vacancy_stage1_message(int employer_id, double wage);
4666 void freevacancy_stage1messages(void);
4667 
4668 void add_job_application_stage2_message(int employee_id);
4673 
4674 void add_job_application_stage1_message(int employee_id, double wage);
4679 
4680 void add_job_match_stage1_message(int employer_id, int employee_id, double wage);
4684 void freejob_match_stage1messages(void);
4685 
4686 void add_job_change_message(int employer_id, int employee_id);
4690 void freejob_changemessages(void);
4691 
4692 void add_vacancy_stage2_message(int employer_id, double wage);
4696 void freevacancy_stage2messages(void);
4697 
4698 void add_job_match_stage2_message(int employer_id, int employee_id, double wage);
4702 void freejob_match_stage2messages(void);
4703 
4704 void add_employment_status_message(int employer_id, double wage, int nshares);
4709 
4710 void add_firm_household_wage_payment_message(int firm_id, double wage);
4715 
4716 void add_firm_bank_loan_request_1_message(int firm_id, int bank_id, double amount);
4721 
4722 void add_firm_bank_loan_request_2_message(int firm_id, int bank_id, double amount);
4727 
4728 void add_bank_firm_loan_acknowledge_1_message(int bank_id, int firm_id, double amount);
4733 
4734 void add_bank_firm_loan_acknowledge_2_message(int bank_id, int firm_id, double amount);
4739 
4740 void add_bank_centralbank_debt_request_message(int bank_id, double amount);
4745 
4746 void add_household_share_message(double amount);
4750 void freehousehold_sharemessages(void);
4751 
4752 void add_capital_tax_message(double amount);
4756 void freecapital_taxmessages(void);
4757 
4758 void add_labour_tax_message(double amount);
4762 void freelabour_taxmessages(void);
4763 
4764 void add_unemployment_benefit_message(double amount);
4769 
4770 void add_general_benefit_message(double amount);
4774 void freegeneral_benefitmessages(void);
4775 
4776 void add_fund_request_message(int firm_id, double amount);
4780 void freefund_requestmessages(void);
4781 
4782 void add_fund_request_ack_message(int firm_id, double amount);
4786 void freefund_request_ackmessages(void);
4787 
4788 void add_new_entrant_loan_message(int firm_id, int bank_id, double amount);
4792 void freenew_entrant_loanmessages(void);
4793 
4794 void add_firm_bank_interest_on_loan_message(int bank_id, double amount);
4799 
4800 void add_loan_writeoff_message(int bank_id, double amount);
4804 void freeloan_writeoffmessages(void);
4805 
4806 void add_firm_bank_insolvent_account_message(int bank_id, double liquidity);
4811 
4812 void add_firm_net_profit_message(int id, int isconstructor, double net_income);
4816 void freefirm_net_profitmessages(void);
4817 
4818 void add_bank_net_profit_message(int id, double net_income);
4822 void freebank_net_profitmessages(void);
4823 
4824 void add_bank_centralbank_interest_payment_message(int id, double amount);
4829 
4830 void add_bank_centralbank_debt_payment_message(int id, double amount);
4835 
4836 void add_gov_centralbank_debt_request_message(double amount);
4841 
4842 void add_gov_centralbank_debt_payment_message(double amount);
4847 
4848 void add_centralbank_government_profit_message(double amount);
4853 
4854 void add_housing_price_message(double price);
4858 void freehousing_pricemessages(void);
4859 
4860 void add_buy_housing_message(int buyer_id, int bank_id, double liquidity, double quarterly_income, double quarterly_mortgage_paid, int mortgage_choice);
4864 void freebuy_housingmessages(void);
4865 
4866 void add_sell_housing_message(int seller_id, double price, int quantity, int type);
4870 void freesell_housingmessages(void);
4871 
4872 void add_bought_housing_message(int buyer_id, double liquidity_spent, double mortgage_used, double annuity);
4876 void freebought_housingmessages(void);
4877 
4878 void add_sold_housing_message(int seller_id, int quantity_sold, double price_sold);
4882 void freesold_housingmessages(void);
4883 
4884 void add_bank_reagency_credibility_message(int bank_id, double equity, double risky_assets);
4889 
4890 void add_mortgage_requests_message(int bank_id, double amount);
4895 
4896 void add_mortgage_payment_from_sale_message(int bank_id, double amount);
4901 
4902 void add_mortgage_payment_message(int bank_id, double interest, double principal);
4906 void freemortgage_paymentmessages(void);
4907 
4908 void add_mortgage_writeoff_message(int bank_id, double amount);
4913 
4914 void add_housing_transactions_summary_message(int quantity, double avg_price);
4919 
4920 
4921 void set_id(int id);
4922 int get_id();
4923 void set_bank_id(int bank_id);
4924 int get_bank_id();
4925 void set_isconstructor(int isconstructor);
4926 int get_isconstructor();
4927 void set_day_of_month_to_act(int day_of_month_to_act);
4929 void set_isinsolvent(int isinsolvent);
4930 int get_isinsolvent();
4931 void set_it_no(int it_no);
4932 int get_it_no();
4933 void set_day_of_week_to_act(int day_of_week_to_act);
4935 void set_average_goods_price(double average_goods_price);
4936 double get_average_goods_price();
4938 void set_manager(int manager);
4939 int get_manager();
4940 void set_wage_offer(double wage_offer);
4941 double get_wage_offer();
4942 void set_average_wage(double average_wage);
4943 double get_average_wage();
4944 void set_no_employees(int no_employees);
4945 int get_no_employees();
4946 void set_vacancies(int vacancies);
4947 int get_vacancies();
4948 void set_employees_needed(int employees_needed);
4949 int get_employees_needed();
4950 void set_day_of_month_wages_paid(int day_of_month_wages_paid);
4952 void set_labour_productivity(double labour_productivity);
4953 double get_labour_productivity();
4954 void set_capital_productivity(double capital_productivity);
4955 double get_capital_productivity();
4956 void set_capital_goods(int capital_goods);
4957 int get_capital_goods();
4958 void set_capital_goods_price(double capital_goods_price);
4959 double get_capital_goods_price();
4960 void set_production_current(int production_current);
4962 void set_expected_sales(int expected_sales);
4963 int get_expected_sales();
4964 void set_production_plan(int production_plan);
4965 int get_production_plan();
4966 void set_unit_goods_price(double unit_goods_price);
4967 double get_unit_goods_price();
4968 void set_unit_cost(double unit_cost);
4969 double get_unit_cost();
4970 void set_day_of_month_production_completed(int day_of_month_production_completed);
4972 void set_unit_house_price(double unit_house_price);
4973 double get_unit_house_price();
4974 int * get_projects();
4975 void set_loans_interest_rate(double loans_interest_rate);
4976 double get_loans_interest_rate();
4977 void set_debt(double debt);
4978 double get_debt();
4979 void set_inventory(int inventory);
4980 int get_inventory();
4981 void set_sales(int sales);
4982 int get_sales();
4983 void set_revenues(double revenues);
4984 double get_revenues();
4985 void set_total_assets(double total_assets);
4986 double get_total_assets();
4987 void set_operating_costs(double operating_costs);
4988 double get_operating_costs();
4989 void set_labour_costs(double labour_costs);
4990 double get_labour_costs();
4991 void set_total_interest_payments(double total_interest_payments);
4993 void set_dividends_paid(double dividends_paid);
4994 double get_dividends_paid();
4995 void set_dividends_to_be_paid(double dividends_to_be_paid);
4996 double get_dividends_to_be_paid();
4997 void set_retained_earnings(double retained_earnings);
4998 double get_retained_earnings();
4999 void set_net_earnings(double net_earnings);
5000 double get_net_earnings();
5001 void set_ebit(double ebit);
5002 double get_ebit();
5003 void set_equity(double equity);
5004 double get_equity();
5005 void set_liquidity(double liquidity);
5006 double get_liquidity();
5007 void set_isliquidshort(int isliquidshort);
5008 int get_isliquidshort();
5009 void set_hasloan(int hasloan);
5010 int get_hasloan();
5011 void set_hasinvestment(int hasinvestment);
5012 int get_hasinvestment();
5013 void set_isilliquid(int isilliquid);
5014 int get_isilliquid();
5015 void set_planned_investment_costs(double planned_investment_costs);
5017 void set_liquidity_need(double liquidity_need);
5018 double get_liquidity_need();
5019 loan * get_loan_list();
5020 void set_labour_tax_rate(double labour_tax_rate);
5021 double get_labour_tax_rate();
5022 void set_delta_housing_price(double delta_housing_price);
5023 double get_delta_housing_price();
5024 void set_weekly_consumption_budget(double weekly_consumption_budget);
5026 void set_mall_budget(double mall_budget);
5027 double get_mall_budget();
5028 void set_quarterly_price_change(double quarterly_price_change);
5030 void set_my_employer_id(int my_employer_id);
5031 int get_my_employer_id();
5032 void set_wage(double wage);
5033 double get_wage();
5034 void set_ismanager(int ismanager);
5035 int get_ismanager();
5036 void set_government_benefits(double government_benefits);
5037 double get_government_benefits();
5038 void set_day_of_month_wage_recieved(int day_of_month_wage_recieved);
5040 void set_mortgages_interest_rate(double mortgages_interest_rate);
5043 void set_mortgages(double mortgages);
5044 double get_mortgages();
5045 void set_housing_payment(double housing_payment);
5046 double get_housing_payment();
5047 void set_housing_price(double housing_price);
5048 double get_housing_price();
5049 void set_housing_units(int housing_units);
5050 int get_housing_units();
5051 void set_n_shares(int n_shares);
5052 int get_n_shares();
5053 void set_capital_income(double capital_income);
5054 double get_capital_income();
5055 double * get_previous_wages();
5056 double * get_previous_benefits();
5057 void set_labour_income(double labour_income);
5058 double get_labour_income();
5059 void set_housing_value(double housing_value);
5060 double get_housing_value();
5061 void set_expected_housing_payment(double expected_housing_payment);
5063 void set_hmarket_role(int hmarket_role);
5064 int get_hmarket_role();
5065 void set_equity_ratio(double equity_ratio);
5066 double get_equity_ratio();
5067 void set_minimum_equity_ratio(double minimum_equity_ratio);
5068 double get_minimum_equity_ratio();
5069 double * get_mortgage_costs();
5070 void set_delta_housing_value(double delta_housing_value);
5071 double get_delta_housing_value();
5072 void set_mortgage_choice(int mortgage_choice);
5073 int get_mortgage_choice();
5074 void set_share_firms(double share_firms);
5075 double get_share_firms();
5076 void set_share_construction_firms(double share_construction_firms);
5078 void set_share_banks(double share_banks);
5079 double get_share_banks();
5080 void set_dividends_recieved(double dividends_recieved);
5081 double get_dividends_recieved();
5082 void set_dividends_retained(double dividends_retained);
5083 double get_dividends_retained();
5084 void set_firm_investment(double firm_investment);
5085 double get_firm_investment();
5086 void set_capital_tax_rate(double capital_tax_rate);
5087 double get_capital_tax_rate();
5088 void set_loans(double loans);
5089 double get_loans();
5090 void set_loans_start(double loans_start);
5091 double get_loans_start();
5092 void set_deposits(double deposits);
5093 double get_deposits();
5094 void set_centralbank_debt(double centralbank_debt);
5095 double get_centralbank_debt();
5096 void set_total_writeoffs(double total_writeoffs);
5097 double get_total_writeoffs();
5098 void set_interest_rate(double interest_rate);
5099 double get_interest_rate();
5100 void set_interests_accrued(double interests_accrued);
5101 double get_interests_accrued();
5102 void set_interests_paid(double interests_paid);
5103 double get_interests_paid();
5104 void set_total_dividends(double total_dividends);
5105 double get_total_dividends();
5106 void set_total_costs(double total_costs);
5107 double get_total_costs();
5108 void set_unemployment_rate(double unemployment_rate);
5109 double get_unemployment_rate();
5110 void set_population_size(int population_size);
5111 int get_population_size();
5112 void set_labour_tax_income(double labour_tax_income);
5113 double get_labour_tax_income();
5114 void set_capital_tax_income(double capital_tax_income);
5115 double get_capital_tax_income();
5116 void set_gov_general_benefit_rate(double gov_general_benefit_rate);
5118 void set_gov_unemployment_rate(double gov_unemployment_rate);
5119 double get_gov_unemployment_rate();
5120 void set_general_benefits(double general_benefits);
5121 double get_general_benefits();
5122 void set_unemployment_benefits(double unemployment_benefits);
5123 double get_unemployment_benefits();
5124 void set_earnings(double earnings);
5125 double get_earnings();
5126 void set_centralbank_income(double centralbank_income);
5127 double get_centralbank_income();
5128 void set_expenditures(double expenditures);
5129 double get_expenditures();
5130 void set_inflation_rate(double inflation_rate);
5131 double get_inflation_rate();
5132 double * get_consumption_goods_prices();
5134 double * get_weekly_price_averages();
5135 void set_loans_banks(double loans_banks);
5136 double get_loans_banks();
5137 void set_loans_government(double loans_government);
5138 double get_loans_government();
5139 void set_fiat_money(double fiat_money);
5140 double get_fiat_money();
5141 void set_liquidity_banks(double liquidity_banks);
5142 double get_liquidity_banks();
5143 void set_liquidity_government(double liquidity_government);
5144 double get_liquidity_government();
5145 void set_liquidity_equityfund(double liquidity_equityfund);
5146 double get_liquidity_equityfund();
5150 int agent_get_id(void);
5151 double agent_get_x(void);
5152 double agent_get_y(void);
5153 double agent_get_z(void);
5154 /* partitioning.c */
5155 void partition_data(int totalnodes, xmachine ** agent_list, double cloud_data[], int partition_method);
5156 
5157 
5158 void save_partition_data(void);
5159 void generate_partitions(double cloud_data[], int partitions, int partition_method);
5160 
5161 /* messageboard.c */
5163 
5164 
5165 
5167 
5168 
5169 
5171 
5172 
5173 
5175 
5176 
5177 
5179 
5180 
5181 
5183 
5184 
5185 
5187 
5188 
5189 
5191 
5192 
5193 
5195 
5196 
5197 
5199 
5200 
5201 
5203 
5204 
5205 
5207 
5208 
5209 
5211 
5212 
5213 
5215 
5216 
5217 
5219 
5220 
5221 
5223 
5224 
5225 
5227 
5228 
5229 
5231 
5232 
5233 
5235 
5236 
5237 
5239 
5240 
5241 
5243 
5244 
5245 
5247 
5248 
5249 
5251 
5252 
5253 
5255 
5256 
5257 
5259 
5260 
5261 
5263 
5264 
5265 
5267 
5268 
5269 
5271 
5272 
5273 
5275 
5276 
5277 
5279 
5280 
5281 
5283 
5284 
5285 
5287 
5288 
5289 
5291 
5292 
5293 
5295 
5296 
5297 
5299 
5300 
5301 
5303 
5304 
5305 
5307 
5308 
5309 
5311 
5312 
5313 
5315 
5316 
5317 
5319 
5320 
5321 
5323 
5324 
5325 
5327 
5328 
5329 
5331 
5332 
5333 
5335 
5336 
5337 
5339 
5340 
5341 
5343 
5344 
5345 
5347 
5348 
5349 
5351 
5352 
5353 
5355 
5356 
5357 
5359 
5360 
5361 
5363 
5364 
5365 
5367 
5368 
5369 
5371 
5372 
5373 
5375 
5376 
5377 
5379 
5380 
5381 
5383 
5384 
5385 
5387 
5388 
5389 
5391 
5392 
5393 
5395 
5396 
5397 
5399 
5400 
5401 
5403 
5404 
5405 
5407 
5408 
5409 
5411 
5412 
5413 
5415 
5416 
5417 
5419 
5420 
5421 
5423 
5424 
5425 
5427 
5428 
5429 
5431 
5432 
5433 
5435 
5436 
5437 
5439 
5440 
5441 
5442 
5443 /* memory.c */
5444 xmachine * add_xmachine(void);
5473 
5474 
5475 /* rules.c */
5476 int FLAME_integer_in_array(int a, int * b, int size);
5477 
5478 /* timing.c */
5479 double get_time(void);
5480 
5481 
5483 
5485 int firm_init_post_id(void);
5486 int firm_init_employment(void);
5488 int firm_init_balancesheet(void);
5489 int firm_iterate(void);
5490 
5492 int firm_update_bank_account(void);
5494 
5496 
5498 
5500 int firm_consumption_supply(void);
5505 
5509 
5511 int firm_labour_fire(void);
5517 int firm_labour_update(void);
5521 
5525 
5527 int firm_labour_pay_wages(void);
5529 int firm_labour_trace_wages(void);
5530 
5532 
5534 int firm_production_skip(void);
5536 
5538 
5540 
5544 int firm_production_set_price(void);
5546 int firm_production_plan(void);
5553 
5560 
5562 int firm_credit_demand_loans_1(void);
5564 int firm_credit_borrow_loans_1(void);
5566 
5568 int firm_credit_borrow_loans_2(void);
5571 
5575 
5580 
5585 int firm_credit_pay_dividends(void);
5587 
5591 
5595 int firm_credit_check_tax_rate(void);
5596 
5598 
5600 
5602 int firm_housing_enter_market(void);
5607 
5609 
5611 int household_init_post_id(void);
5612 int household_init_employment(void);
5614 int household_init_balancesheet(void);
5615 int household_iterate(void);
5616 
5620 
5624 
5630 
5634 
5641 
5643 int household_labour_turnover(void);
5646 int household_labour_employment(void);
5648 
5654 
5656 
5658 
5663 
5667 
5673 
5677 
5681 int household_housing_sell(void);
5683 int household_housing_fire_sell(void);
5687 
5691 int household_housing_buy(void);
5696 int equityfund_init(void);
5698 
5700 int equityfund_iterate(void);
5701 
5703 int equityfund_audit_dividends(void);
5705 
5712 
5718 
5720 
5722 int bank_init_loans(void);
5724 int bank_init_mortgages(void);
5726 int bank_init_deposits(void);
5729 int bank_init_balancesheet(void);
5730 int bank_iterate(void);
5731 
5733 int bank_update_deposits(void);
5737 
5754 
5758 
5768 int bank_housing_debt_writeoff(void);
5770 int government_init(void);
5772 
5774 int government_iterate(void);
5776 
5780 
5786 
5791 int government_do_balance_sheet(void);
5793 
5795 
5798 int centralbank_iterate(void);
5799 
5803 
5807 
5811 
5816 
5823 
5827 
5829 
5831 int jpoffice_init_employment(void);
5834 int jpoffice_iterate(void);
5835 
5837 int jpoffice_labour_stage1(void);
5841 int jpoffice_labour_stage2(void);
5844 int mall_init(void);
5845 
5847 int mall_consumption_shopping(void);
5850 int mall_consumption_summary(void);
5851 int reagency_init(void);
5852 
5856 
5858 int reagency_housing_process(void);
5861 int reagency_housing_summary(void);
5862 #endif