ICEACE Model: Closed Economy  1.0.0
Design Documentation of ICEACE Model
 All Data Structures Files Functions Variables Typedefs Macros Pages
rules.c
Go to the documentation of this file.
1 
6 #include "header.h"
7 
15 int FLAME_integer_in_array(int a, int * b, int size)
16 {
17  int i;
18 
19  for(i = 0; i < size; i++)
20  {
21  if(a == b[i]) return 1;
22  }
23 
24  return 0;
25 }
26 
35 void* cparams_create(int agent_number, int * agent_count, size_t * agent_struct_size, size_t * cparam_size)
36 {
37  /* Pointer to the memory created that is going to be returned */
38  void *data;
39  /* Variable used in for loops */
40  int i;
41  /* Variable to hold total size of memory required for agent structures */
42  size_t total_param_size = 0;
43 
44  /* For each agent type add required memory for agent structures */
45  for(i = 0; i < agent_number; i++)
46  {
47  total_param_size += agent_count[i] * agent_struct_size[i];
48  }
49 
50  //assert(count > 0);
51  //assert(total_param_size > 0);
52  /* Does libmboard free this memory? */
53 
54  /* Allocate required memory, where memory holds the number
55  * of each agent type, in order, and the total required
56  * memory for agent structures */
57  data = malloc(agent_number*sizeof(int) + total_param_size);
58  /* Make the memory size parameter equal to the actual memory size */
59  *cparam_size = agent_number*sizeof(int) + total_param_size;
60  /* Assert that the created memory was successfully created and not null */
61  assert(data != NULL);
62 
63  /* Return the pointer to the created memory */
64  return data;
65 }
66 
67 
74 {
75  if((a->it_no == 0)) return 1;
76  else return 0;
77 }
78 
79 
86 {
87  if((a->it_no != 0)) return 1;
88  else return 0;
89 }
90 
91 
98 {
99  if(!(iteration_loop%20 == 0)) return 1;
100  else return 0;
101 }
102 
103 
110 {
111  if((iteration_loop%20 == 0)) return 1;
112  else return 0;
113 }
114 
115 
122 {
123  if((a->isconstructor == 1)) return 1;
124  else return 0;
125 }
126 
127 
134 {
135  if((a->isconstructor != 1)) return 1;
136  else return 0;
137 }
138 
139 
146 {
147  if(!(iteration_loop%5 == a->day_of_week_to_act)) return 1;
148  else return 0;
149 }
150 
151 
158 {
159  if((iteration_loop%5 == a->day_of_week_to_act)) return 1;
160  else return 0;
161 }
162 
163 
170 {
171  if(!(iteration_loop%20 == a->day_of_month_to_act)) return 1;
172  else return 0;
173 }
174 
175 
182 {
183  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
184  else return 0;
185 }
186 
187 
194 {
195  if((a->vacancies == 0)) return 1;
196  else return 0;
197 }
198 
199 
206 {
207  if((a->vacancies < 0)) return 1;
208  else return 0;
209 }
210 
211 
218 {
219  if((a->vacancies > 0)) return 1;
220  else return 0;
221 }
222 
223 
230 {
231  if((a->vacancies >= 1)) return 1;
232  else return 0;
233 }
234 
235 
242 {
243  if((a->vacancies < 1)) return 1;
244  else return 0;
245 }
246 
247 
254 {
255  if(!(iteration_loop%20 == a->day_of_month_wages_paid)) return 1;
256  else return 0;
257 }
258 
259 
266 {
267  if((iteration_loop%20 == a->day_of_month_wages_paid)) return 1;
268  else return 0;
269 }
270 
271 
278 {
280  else return 0;
281 }
282 
283 
290 {
292  else return 0;
293 }
294 
295 
302 {
303  if((a->isinsolvent == 1)) return 1;
304  else return 0;
305 }
306 
307 
314 {
315  if((a->isinsolvent != 1)) return 1;
316  else return 0;
317 }
318 
319 
326 {
327  if((a->isconstructor == 0)) return 1;
328  else return 0;
329 }
330 
331 
338 {
339  if((a->isconstructor != 0)) return 1;
340  else return 0;
341 }
342 
343 
350 {
351  if((iteration_loop%20 == a->day_of_month_production_completed)) return 1;
352  else return 0;
353 }
354 
355 
362 {
363  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
364  else return 0;
365 }
366 
367 
374 {
375  if((iteration_loop%20 == a->day_of_month_production_completed)) return 1;
376  else return 0;
377 }
378 
379 
386 {
387  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
388  else return 0;
389 }
390 
391 
398 {
399  if(!(iteration_loop%60 == 1)) return 1;
400  else return 0;
401 }
402 
403 
410 {
411  if((iteration_loop%60 == 1)) return 1;
412  else return 0;
413 }
414 
415 
422 {
423  if((a->isliquidshort == 0)) return 1;
424  else return 0;
425 }
426 
427 
434 {
435  if((a->isliquidshort != 0)) return 1;
436  else return 0;
437 }
438 
439 
446 {
447  if((a->hasloan == 1)) return 1;
448  else return 0;
449 }
450 
451 
458 {
459  if((a->hasloan != 1)) return 1;
460  else return 0;
461 }
462 
463 
470 {
471  if((a->hasloan == 1)) return 1;
472  else return 0;
473 }
474 
475 
482 {
483  if((a->hasloan != 1)) return 1;
484  else return 0;
485 }
486 
487 
494 {
495  if((a->liquidity_need == 0)) return 1;
496  else return 0;
497 }
498 
499 
506 {
507  if((a->liquidity_need != 0)) return 1;
508  else return 0;
509 }
510 
511 
518 {
519  if((a->hasinvestment == 1)) return 1;
520  else return 0;
521 }
522 
523 
530 {
531  if((a->hasinvestment != 1)) return 1;
532  else return 0;
533 }
534 
535 
542 {
543  if((a->isinsolvent != 1)) return 1;
544  else return 0;
545 }
546 
547 
554 {
555  if((a->isinsolvent == 1)) return 1;
556  else return 0;
557 }
558 
559 
566 {
567  if(!(iteration_loop%60 == 0)) return 1;
568  else return 0;
569 }
570 
571 
578 {
579  if((iteration_loop%60 == 0)) return 1;
580  else return 0;
581 }
582 
583 
590 {
591  if((a->isconstructor == 0)) return 1;
592  else return 0;
593 }
594 
595 
602 {
603  if((a->isconstructor != 0)) return 1;
604  else return 0;
605 }
606 
607 
614 {
615  if(!(iteration_loop%20 == a->day_of_month_to_act)) return 1;
616  else return 0;
617 }
618 
619 
626 {
627  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
628  else return 0;
629 }
630 
631 
638 {
639  if((a->it_no == 0)) return 1;
640  else return 0;
641 }
642 
643 
650 {
651  if((a->it_no != 0)) return 1;
652  else return 0;
653 }
654 
655 
662 {
663  if(!(iteration_loop%20 == 0)) return 1;
664  else return 0;
665 }
666 
667 
674 {
675  if((iteration_loop%20 == 0)) return 1;
676  else return 0;
677 }
678 
679 
686 {
687  if(!(iteration_loop%20 == a->day_of_month_to_act)) return 1;
688  else return 0;
689 }
690 
691 
698 {
699  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
700  else return 0;
701 }
702 
703 
710 {
711  if(!(iteration_loop%5 == a->day_of_week_to_act)) return 1;
712  else return 0;
713 }
714 
715 
722 {
723  if((iteration_loop%5 == a->day_of_week_to_act)) return 1;
724  else return 0;
725 }
726 
727 
734 {
735  if(!(iteration_loop%20 == 0)) return 1;
736  else return 0;
737 }
738 
739 
746 {
747  if((iteration_loop%20 == 0)) return 1;
748  else return 0;
749 }
750 
751 
758 {
759  if(!(iteration_loop%20 == a->day_of_month_to_act)) return 1;
760  else return 0;
761 }
762 
763 
770 {
771  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
772  else return 0;
773 }
774 
775 
782 {
783  if((a->my_employer_id > 0)) return 1;
784  else return 0;
785 }
786 
787 
794 {
795  if(!(a->my_employer_id > 0)) return 1;
796  else return 0;
797 }
798 
799 
806 {
807  if(!(iteration_loop%20 == a->day_of_month_wage_recieved)) return 1;
808  else return 0;
809 }
810 
811 
818 {
819  if((iteration_loop%20 == a->day_of_month_wage_recieved)) return 1;
820  else return 0;
821 }
822 
823 
830 {
831  if(!(iteration_loop%60 == 1)) return 1;
832  else return 0;
833 }
834 
835 
842 {
843  if((iteration_loop%60 == 1)) return 1;
844  else return 0;
845 }
846 
847 
854 {
855  if((a->n_shares == 0)) return 1;
856  else return 0;
857 }
858 
859 
866 {
867  if((a->n_shares > 0)) return 1;
868  else return 0;
869 }
870 
871 
878 {
879  if(!(iteration_loop%20 == a->day_of_month_wage_recieved)) return 1;
880  else return 0;
881 }
882 
883 
890 {
891  if((iteration_loop%20 == a->day_of_month_wage_recieved)) return 1;
892  else return 0;
893 }
894 
895 
902 {
903  if(!(iteration_loop%60 == 0)) return 1;
904  else return 0;
905 }
906 
907 
914 {
915  if((iteration_loop%60 == 0)) return 1;
916  else return 0;
917 }
918 
919 
926 {
927  if(!(iteration_loop%20 == a->day_of_month_to_act)) return 1;
928  else return 0;
929 }
930 
931 
938 {
939  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
940  else return 0;
941 }
942 
943 
950 {
951  if((a->hmarket_role == 0)) return 1;
952  else return 0;
953 }
954 
955 
962 {
963  if((a->hmarket_role == 3)) return 1;
964  else return 0;
965 }
966 
967 
974 {
975  if((a->hmarket_role == 2)) return 1;
976  else return 0;
977 }
978 
979 
986 {
987  if((a->hmarket_role == 1)) return 1;
988  else return 0;
989 }
990 
991 
998 {
999  if((a->equity_ratio < a->minimum_equity_ratio)) return 1;
1000  else return 0;
1001 }
1002 
1003 
1010 {
1011  if((a->equity_ratio >= a->minimum_equity_ratio)) return 1;
1012  else return 0;
1013 }
1014 
1015 
1022 {
1023  if((a->it_no == 0)) return 1;
1024  else return 0;
1025 }
1026 
1027 
1034 {
1035  if((a->it_no != 0)) return 1;
1036  else return 0;
1037 }
1038 
1039 
1046 {
1047  if(!(iteration_loop%20 == a->day_of_month_wages_paid)) return 1;
1048  else return 0;
1049 }
1050 
1051 
1058 {
1059  if((iteration_loop%20 == a->day_of_month_wages_paid)) return 1;
1060  else return 0;
1061 }
1062 
1063 
1070 {
1071  if(!(iteration_loop%60 == 1)) return 1;
1072  else return 0;
1073 }
1074 
1075 
1082 {
1083  if((iteration_loop%60 == 1)) return 1;
1084  else return 0;
1085 }
1086 
1087 
1094 {
1095  if(!(iteration_loop%60 == 0)) return 1;
1096  else return 0;
1097 }
1098 
1099 
1106 {
1107  if((iteration_loop%60 == 0)) return 1;
1108  else return 0;
1109 }
1110 
1111 
1118 {
1119  if((a->it_no == 0)) return 1;
1120  else return 0;
1121 }
1122 
1123 
1130 {
1131  if((a->it_no != 0)) return 1;
1132  else return 0;
1133 }
1134 
1135 
1142 {
1143  if(!(iteration_loop%20 == 0)) return 1;
1144  else return 0;
1145 }
1146 
1147 
1154 {
1155  if((iteration_loop%20 == 0)) return 1;
1156  else return 0;
1157 }
1158 
1159 
1166 {
1167  if(!(iteration_loop%60 == 1)) return 1;
1168  else return 0;
1169 }
1170 
1171 
1178 {
1179  if((iteration_loop%60 == 1)) return 1;
1180  else return 0;
1181 }
1182 
1183 
1190 {
1191  if(!(iteration_loop%60 == 0)) return 1;
1192  else return 0;
1193 }
1194 
1195 
1202 {
1203  if((iteration_loop%60 == 0)) return 1;
1204  else return 0;
1205 }
1206 
1207 
1214 {
1215  if(!(iteration_loop%20 == a->day_of_month_to_act)) return 1;
1216  else return 0;
1217 }
1218 
1219 
1226 {
1227  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
1228  else return 0;
1229 }
1230 
1231 
1238 {
1239  if((a->it_no == 0)) return 1;
1240  else return 0;
1241 }
1242 
1243 
1250 {
1251  if((a->it_no != 0)) return 1;
1252  else return 0;
1253 }
1254 
1255 
1262 {
1263  if(!(iteration_loop%60 == 1)) return 1;
1264  else return 0;
1265 }
1266 
1267 
1274 {
1275  if((iteration_loop%60 == 1)) return 1;
1276  else return 0;
1277 }
1278 
1279 
1286 {
1287  if(!(iteration_loop%20 == a->day_of_month_wages_paid)) return 1;
1288  else return 0;
1289 }
1290 
1291 
1298 {
1299  if((iteration_loop%20 == a->day_of_month_wages_paid)) return 1;
1300  else return 0;
1301 }
1302 
1303 
1310 {
1311  if(!(iteration_loop%60 == 0)) return 1;
1312  else return 0;
1313 }
1314 
1315 
1322 {
1323  if((iteration_loop%60 == 0)) return 1;
1324  else return 0;
1325 }
1326 
1327 
1334 {
1335  if((a->it_no == 0)) return 1;
1336  else return 0;
1337 }
1338 
1339 
1346 {
1347  if((a->it_no != 0)) return 1;
1348  else return 0;
1349 }
1350 
1351 
1358 {
1359  if(!(iteration_loop%5 == a->day_of_week_to_act)) return 1;
1360  else return 0;
1361 }
1362 
1363 
1370 {
1371  if((iteration_loop%5 == a->day_of_week_to_act)) return 1;
1372  else return 0;
1373 }
1374 
1375 
1382 {
1383  if(!(iteration_loop%20 == 0)) return 1;
1384  else return 0;
1385 }
1386 
1387 
1394 {
1395  if((iteration_loop%20 == 0)) return 1;
1396  else return 0;
1397 }
1398 
1399 
1406 {
1407  if(!(iteration_loop%20 == a->day_of_month_wages_paid)) return 1;
1408  else return 0;
1409 }
1410 
1411 
1418 {
1419  if((iteration_loop%20 == a->day_of_month_wages_paid)) return 1;
1420  else return 0;
1421 }
1422 
1423 
1430 {
1431  if(!(iteration_loop%60 == 1)) return 1;
1432  else return 0;
1433 }
1434 
1435 
1442 {
1443  if((iteration_loop%60 == 1)) return 1;
1444  else return 0;
1445 }
1446 
1447 
1454 {
1455  if(!(iteration_loop%60 == 0)) return 1;
1456  else return 0;
1457 }
1458 
1459 
1466 {
1467  if((iteration_loop%60 == 0)) return 1;
1468  else return 0;
1469 }
1470 
1471 
1478 {
1479  if(!(iteration_loop%20 == a->day_of_month_to_act)) return 1;
1480  else return 0;
1481 }
1482 
1483 
1490 {
1491  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
1492  else return 0;
1493 }
1494 
1495 
1502 {
1503  if((a->it_no == 0)) return 1;
1504  else return 0;
1505 }
1506 
1507 
1514 {
1515  if((a->it_no != 0)) return 1;
1516  else return 0;
1517 }
1518 
1519 
1526 {
1527  if(!(iteration_loop%20 == a->day_of_month_to_act)) return 1;
1528  else return 0;
1529 }
1530 
1531 
1538 {
1539  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
1540  else return 0;
1541 }
1542 
1543 
1550 {
1551  if(!(iteration_loop%5 == a->day_of_week_to_act)) return 1;
1552  else return 0;
1553 }
1554 
1555 
1562 {
1563  if((iteration_loop%5 == a->day_of_week_to_act)) return 1;
1564  else return 0;
1565 }
1566 
1567 
1574 {
1575  if(!(iteration_loop%60 == 0)) return 1;
1576  else return 0;
1577 }
1578 
1579 
1586 {
1587  if((iteration_loop%60 == 0)) return 1;
1588  else return 0;
1589 }
1590 
1591 
1598 {
1599  if(!(iteration_loop%20 == a->day_of_month_to_act)) return 1;
1600  else return 0;
1601 }
1602 
1603 
1610 {
1611  if((iteration_loop%20 == a->day_of_month_to_act)) return 1;
1612  else return 0;
1613 }
1614 
1615 
1616 
1624 {
1625  //printf("**** FLAME_filter_firm_firm_init_employment_FirmInitEmployment_FirmInitBalanceSheet_jpoffice_firm_employee(const void *msg, const void *params)\n");
1626 
1627  /* Cast the message pointer to the correct message type */
1629  /* Cast the params pointer to the correct agent type */
1631 
1632  /* The filter */
1633  if((a->id == m->firm_id)) return 1;
1634  else return 0;
1635 }
1636 
1644 {
1645  //printf("**** FLAME_filter_firm_firm_consumption_receive_sales_FirmReceiveSales_FirmConsumptionPrice_sold(const void *msg, const void *params)\n");
1646 
1647  /* Cast the message pointer to the correct message type */
1648  m_sold *m = (m_sold*)msg;
1649  /* Cast the params pointer to the correct agent type */
1651 
1652  /* The filter */
1653  if((a->id == m->id)) return 1;
1654  else return 0;
1655 }
1656 
1664 {
1665  //printf("**** FLAME_filter_firm_firm_labour_job_offer_stage1_FirmLabourStage1Application_FirmLabourStage1End_job_match_stage1(const void *msg, const void *params)\n");
1666 
1667  /* Cast the message pointer to the correct message type */
1669  /* Cast the params pointer to the correct agent type */
1671 
1672  /* The filter */
1673  if((a->id == m->employer_id)) return 1;
1674  else return 0;
1675 }
1676 
1684 {
1685  //printf("**** FLAME_filter_firm_firm_labour_update_FirmLabourStage1End_FirmLabourStage2_job_change(const void *msg, const void *params)\n");
1686 
1687  /* Cast the message pointer to the correct message type */
1688  m_job_change *m = (m_job_change*)msg;
1689  /* Cast the params pointer to the correct agent type */
1691 
1692  /* The filter */
1693  if((a->id == m->employer_id)) return 1;
1694  else return 0;
1695 }
1696 
1704 {
1705  //printf("**** FLAME_filter_firm_firm_labour_job_offer_stage2_FirmLabourStage2End_FirmConsumptionStart_job_match_stage2(const void *msg, const void *params)\n");
1706 
1707  /* Cast the message pointer to the correct message type */
1709  /* Cast the params pointer to the correct agent type */
1711 
1712  /* The filter */
1713  if((a->id == m->employer_id)) return 1;
1714  else return 0;
1715 }
1716 
1724 {
1725  //printf("**** FLAME_filter_firm_firm_credit_borrow_loans_1_FirmCreditLoanBorrow1_FirmCreditLoanBorrow2_bank_firm_loan_acknowledge_1(const void *msg, const void *params)\n");
1726 
1727  /* Cast the message pointer to the correct message type */
1729  /* Cast the params pointer to the correct agent type */
1731 
1732  /* The filter */
1733  if((a->id == m->firm_id)) return 1;
1734  else return 0;
1735 }
1736 
1744 {
1745  //printf("**** FLAME_filter_firm_firm_credit_borrow_loans_2_FirmCreditLoanBorrow2_FirmCreditIlliquidityStatus_bank_firm_loan_acknowledge_2(const void *msg, const void *params)\n");
1746 
1747  /* Cast the message pointer to the correct message type */
1749  /* Cast the params pointer to the correct agent type */
1751 
1752  /* The filter */
1753  if((a->id == m->firm_id)) return 1;
1754  else return 0;
1755 }
1756 
1764 {
1765  //printf("**** FLAME_filter_firm_firm_credit_check_equityfund_investment_FirmCreditLiquidityRecheck_FirmCreditBankruptcy_fund_request_ack(const void *msg, const void *params)\n");
1766 
1767  /* Cast the message pointer to the correct message type */
1769  /* Cast the params pointer to the correct agent type */
1771 
1772  /* The filter */
1773  if((a->id == m->firm_id)) return 1;
1774  else return 0;
1775 }
1776 
1784 {
1785  //printf("**** FLAME_filter_firm_firm_housing_collect_sale_revenues_FirmHousingSell_FirmHousingPrice_sold_housing(const void *msg, const void *params)\n");
1786 
1787  /* Cast the message pointer to the correct message type */
1788  m_sold_housing *m = (m_sold_housing*)msg;
1789  /* Cast the params pointer to the correct agent type */
1791 
1792  /* The filter */
1793  if((a->id == m->seller_id)) return 1;
1794  else return 0;
1795 }
1796 
1804 {
1805  //printf("**** FLAME_filter_household_household_init_employment_HouseholdInitEmployment_HouseholdInitBalanceSheet_jpoffice_household_employer(const void *msg, const void *params)\n");
1806 
1807  /* Cast the message pointer to the correct message type */
1809  /* Cast the params pointer to the correct agent type */
1811 
1812  /* The filter */
1813  if((a->id == m->household_id)) return 1;
1814  else return 0;
1815 }
1816 
1824 {
1825  //printf("**** FLAME_filter_household_household_consumption_recieve_goods_HHConsumptionRecieveGoods_HHConsumptionMonthly_bought(const void *msg, const void *params)\n");
1826 
1827  /* Cast the message pointer to the correct message type */
1828  m_bought *m = (m_bought*)msg;
1829  /* Cast the params pointer to the correct agent type */
1831 
1832  /* The filter */
1833  if((a->id == m->id)) return 1;
1834  else return 0;
1835 }
1836 
1844 {
1845  //printf("**** FLAME_filter_household_household_labour_check_fired_HHLabourStart_HHLabourStage1_fired(const void *msg, const void *params)\n");
1846 
1847  /* Cast the message pointer to the correct message type */
1848  m_fired *m = (m_fired*)msg;
1849  /* Cast the params pointer to the correct agent type */
1851 
1852  /* The filter */
1853  if((a->id == m->employee_id)) return 1;
1854  else return 0;
1855 }
1856 
1864 {
1865  //printf("**** FLAME_filter_household_household_labour_turnover_HHLabourStage2_HHConsumptionStart_job_match_stage1(const void *msg, const void *params)\n");
1866 
1867  /* Cast the message pointer to the correct message type */
1869  /* Cast the params pointer to the correct agent type */
1871 
1872  /* The filter */
1873  if((a->id == m->employee_id)) return 1;
1874  else return 0;
1875 }
1876 
1884 {
1885  //printf("**** FLAME_filter_household_household_labour_employment_HHLabourStage1Placement_HHConsumptionStart_job_match_stage2(const void *msg, const void *params)\n");
1886 
1887  /* Cast the message pointer to the correct message type */
1889  /* Cast the params pointer to the correct agent type */
1891 
1892  /* The filter */
1893  if((a->id == m->employee_id)) return 1;
1894  else return 0;
1895 }
1896 
1904 {
1905  //printf("**** FLAME_filter_household_household_labour_receive_wage_HHLabourPayroll_HHLabourEmploymentStatus_firm_household_wage_payment(const void *msg, const void *params)\n");
1906 
1907  /* Cast the message pointer to the correct message type */
1909  /* Cast the params pointer to the correct agent type */
1911 
1912  /* The filter */
1913  if((a->my_employer_id == m->firm_id)) return 1;
1914  else return 0;
1915 }
1916 
1924 {
1925  //printf("**** FLAME_filter_household_household_housing_collect_sale_revenue_HHHousingRevenue_HHHousingPrice_sold_housing(const void *msg, const void *params)\n");
1926 
1927  /* Cast the message pointer to the correct message type */
1928  m_sold_housing *m = (m_sold_housing*)msg;
1929  /* Cast the params pointer to the correct agent type */
1931 
1932  /* The filter */
1933  if((a->id == m->seller_id)) return 1;
1934  else return 0;
1935 }
1936 
1944 {
1945  //printf("**** FLAME_filter_household_household_housing_buy_HHHousingBargain_HHHousingPrice_bought_housing(const void *msg, const void *params)\n");
1946 
1947  /* Cast the message pointer to the correct message type */
1949  /* Cast the params pointer to the correct agent type */
1951 
1952  /* The filter */
1953  if((a->id == m->buyer_id)) return 1;
1954  else return 0;
1955 }
1956 
1964 {
1965  //printf("**** FLAME_filter_bank_bank_init_loans_BankInitLoans_BankInitMortgages_firm_bank_init_loans(const void *msg, const void *params)\n");
1966 
1967  /* Cast the message pointer to the correct message type */
1969  /* Cast the params pointer to the correct agent type */
1971 
1972  /* The filter */
1973  if((a->id == m->bank_id)) return 1;
1974  else return 0;
1975 }
1976 
1984 {
1985  //printf("**** FLAME_filter_bank_bank_init_mortgages_BankInitMortgages_BankInitDeposits_household_bank_init_mortgages(const void *msg, const void *params)\n");
1986 
1987  /* Cast the message pointer to the correct message type */
1989  /* Cast the params pointer to the correct agent type */
1991 
1992  /* The filter */
1993  if((a->id == m->bank_id)) return 1;
1994  else return 0;
1995 }
1996 
2004 {
2005  //printf("**** FLAME_filter_bank_bank_init_deposits_BankInitDeposits_BankInitBalanceSheet_household_bank_init_deposit(const void *msg, const void *params)\n");
2006 
2007  /* Cast the message pointer to the correct message type */
2009  /* Cast the params pointer to the correct agent type */
2011 
2012  /* The filter */
2013  if((a->id == m->bank_id)) return 1;
2014  else return 0;
2015 }
2016 
2024 {
2025  //printf("**** FLAME_filter_bank_bank_init_deposits_BankInitDeposits_BankInitBalanceSheet_firm_bank_init_deposit(const void *msg, const void *params)\n");
2026 
2027  /* Cast the message pointer to the correct message type */
2029  /* Cast the params pointer to the correct agent type */
2031 
2032  /* The filter */
2033  if((a->id == m->bank_id)) return 1;
2034  else return 0;
2035 }
2036 
2044 {
2045  //printf("**** FLAME_filter_bank_bank_update_deposits_BankUpdateDeposits_BankCreditPolicyChecks_household_bank_update_deposit(const void *msg, const void *params)\n");
2046 
2047  /* Cast the message pointer to the correct message type */
2049  /* Cast the params pointer to the correct agent type */
2051 
2052  /* The filter */
2053  if((a->id == m->bank_id)) return 1;
2054  else return 0;
2055 }
2056 
2064 {
2065  //printf("**** FLAME_filter_bank_bank_update_deposits_BankUpdateDeposits_BankCreditPolicyChecks_firm_bank_update_deposit(const void *msg, const void *params)\n");
2066 
2067  /* Cast the message pointer to the correct message type */
2069  /* Cast the params pointer to the correct agent type */
2071 
2072  /* The filter */
2073  if((a->id == m->bank_id)) return 1;
2074  else return 0;
2075 }
2076 
2084 {
2085  //printf("**** FLAME_filter_bank_bank_credit_process_loan_requests_1_BankCreditRequest1_BankCreditRequest2_firm_bank_loan_request_1(const void *msg, const void *params)\n");
2086 
2087  /* Cast the message pointer to the correct message type */
2089  /* Cast the params pointer to the correct agent type */
2091 
2092  /* The filter */
2093  if((a->id == m->bank_id)) return 1;
2094  else return 0;
2095 }
2096 
2104 {
2105  //printf("**** FLAME_filter_bank_bank_credit_process_loan_requests_2_BankCreditRequest2_BankCreditLoanWriteOffs_firm_bank_loan_request_2(const void *msg, const void *params)\n");
2106 
2107  /* Cast the message pointer to the correct message type */
2109  /* Cast the params pointer to the correct agent type */
2111 
2112  /* The filter */
2113  if((a->id == m->bank_id)) return 1;
2114  else return 0;
2115 }
2116 
2124 {
2125  //printf("**** FLAME_filter_bank_bank_credit_recieve_loan_writeoffs_BankCreditLoanWriteOffs_BankCreditNewEntrants_loan_writeoff(const void *msg, const void *params)\n");
2126 
2127  /* Cast the message pointer to the correct message type */
2128  m_loan_writeoff *m = (m_loan_writeoff*)msg;
2129  /* Cast the params pointer to the correct agent type */
2131 
2132  /* The filter */
2133  if((a->id == m->bank_id)) return 1;
2134  else return 0;
2135 }
2136 
2144 {
2145  //printf("**** FLAME_filter_bank_bank_credit_recieve_loan_writeoffs_BankCreditLoanWriteOffs_BankCreditNewEntrants_firm_bank_insolvent_account(const void *msg, const void *params)\n");
2146 
2147  /* Cast the message pointer to the correct message type */
2149  /* Cast the params pointer to the correct agent type */
2151 
2152  /* The filter */
2153  if((a->id == m->bank_id)) return 1;
2154  else return 0;
2155 }
2156 
2164 {
2165  //printf("**** FLAME_filter_bank_bank_credit_recieve_new_entrant_loan_requests_BankCreditNewEntrants_BankCreditLoanInterests_new_entrant_loan(const void *msg, const void *params)\n");
2166 
2167  /* Cast the message pointer to the correct message type */
2169  /* Cast the params pointer to the correct agent type */
2171 
2172  /* The filter */
2173  if((a->id == m->bank_id)) return 1;
2174  else return 0;
2175 }
2176 
2184 {
2185  //printf("**** FLAME_filter_bank_bank_credit_collect_loan_interests_BankCreditLoanInterests_BankHousingMarket_firm_bank_interest_on_loan(const void *msg, const void *params)\n");
2186 
2187  /* Cast the message pointer to the correct message type */
2189  /* Cast the params pointer to the correct agent type */
2191 
2192  /* The filter */
2193  if((a->id == m->bank_id)) return 1;
2194  else return 0;
2195 }
2196 
2204 {
2205  //printf("**** FLAME_filter_bank_bank_housing_deliver_mortages_BankHousingCrediting_BankHousingSales_mortgage_requests(const void *msg, const void *params)\n");
2206 
2207  /* Cast the message pointer to the correct message type */
2209  /* Cast the params pointer to the correct agent type */
2211 
2212  /* The filter */
2213  if((a->id == m->bank_id)) return 1;
2214  else return 0;
2215 }
2216 
2224 {
2225  //printf("**** FLAME_filter_bank_bank_housing_recieve_mortgage_principals_BankHousingSales_BankHousingMortgages_mortgage_payment_from_sale(const void *msg, const void *params)\n");
2226 
2227  /* Cast the message pointer to the correct message type */
2229  /* Cast the params pointer to the correct agent type */
2231 
2232  /* The filter */
2233  if((a->id == m->bank_id)) return 1;
2234  else return 0;
2235 }
2236 
2244 {
2245  //printf("**** FLAME_filter_bank_bank_housing_recieve_mortgages_BankHousingMortgages_BankHousingWriteOff_mortgage_payment(const void *msg, const void *params)\n");
2246 
2247  /* Cast the message pointer to the correct message type */
2249  /* Cast the params pointer to the correct agent type */
2251 
2252  /* The filter */
2253  if((a->id == m->bank_id)) return 1;
2254  else return 0;
2255 }
2256 
2264 {
2265  //printf("**** FLAME_filter_bank_bank_housing_debt_writeoff_BankHousingWriteOff_BankUpdateDeposits_mortgage_writeoff(const void *msg, const void *params)\n");
2266 
2267  /* Cast the message pointer to the correct message type */
2269  /* Cast the params pointer to the correct agent type */
2271 
2272  /* The filter */
2273  if((a->id == m->bank_id)) return 1;
2274  else return 0;
2275 }
2276 
2277 
2279 {
2280  if( ((m_household_jpoffice_id *)x)->household_id < ((m_household_jpoffice_id *)y)->household_id ) return -1;
2281  else if( ((m_household_jpoffice_id *)x)->household_id > ((m_household_jpoffice_id *)y)->household_id ) return 1;
2282  else return 0;
2283 }
2285 {
2286  if( ((m_firm_jpoffice_id *)x)->firm_id < ((m_firm_jpoffice_id *)y)->firm_id ) return -1;
2287  else if( ((m_firm_jpoffice_id *)x)->firm_id > ((m_firm_jpoffice_id *)y)->firm_id ) return 1;
2288  else return 0;
2289 }
2291 {
2292  if( ((m_vacancy_stage1 *)x)->wage > ((m_vacancy_stage1 *)y)->wage ) return -1;
2293  else if( ((m_vacancy_stage1 *)x)->wage < ((m_vacancy_stage1 *)y)->wage ) return 1;
2294  else return 0;
2295 }
2297 {
2298  if( ((m_job_application_stage1 *)x)->employee_id < ((m_job_application_stage1 *)y)->employee_id ) return -1;
2299  else if( ((m_job_application_stage1 *)x)->employee_id > ((m_job_application_stage1 *)y)->employee_id ) return 1;
2300  else return 0;
2301 }
2303 {
2304  if( ((m_vacancy_stage2 *)x)->wage > ((m_vacancy_stage2 *)y)->wage ) return -1;
2305  else if( ((m_vacancy_stage2 *)x)->wage < ((m_vacancy_stage2 *)y)->wage ) return 1;
2306  else return 0;
2307 }
2309 {
2310  if( ((m_job_application_stage2 *)x)->employee_id < ((m_job_application_stage2 *)y)->employee_id ) return -1;
2311  else if( ((m_job_application_stage2 *)x)->employee_id > ((m_job_application_stage2 *)y)->employee_id ) return 1;
2312  else return 0;
2313 }
2315 {
2316  if( ((m_sell *)x)->price < ((m_sell *)y)->price ) return -1;
2317  else if( ((m_sell *)x)->price > ((m_sell *)y)->price ) return 1;
2318  else return 0;
2319 }
2321 {
2322  if( ((m_sell_housing *)x)->price < ((m_sell_housing *)y)->price ) return -1;
2323  else if( ((m_sell_housing *)x)->price > ((m_sell_housing *)y)->price ) return 1;
2324  else return 0;
2325 }
2326