ICEACE Model: Closed Economy  1.0.0
Design Documentation of ICEACE Model
 All Data Structures Files Functions Variables Typedefs Macros Pages
reagency_functions_top.c
Go to the documentation of this file.
1 #include "header.h"
3 
4 /*
5  * \fn: int reagency_init()
6  * \brief: notifies its id by printing out agent id.
7  */
9 {
11  if (IT_NO == 0) {
12  char * filename;
13  FILE * file1;
14  filename = malloc(40*sizeof(char));
15 
16  /* @\fn: int reagency_housing_summary() */
17  filename[0]=0;
18  strcpy(filename, "./outputs/data/REAgency_snapshot.txt");
19  file1 = fopen(filename,"w");
20  fprintf(file1,"%s %s %s\n","IT_NO", "TRANSACTION_QUANTITY", "AVG_HOUSING_PRICE");
21  //fprintf(file1,"%d %d %f\n",IT_NO, HOUSING_TRANSACTIONS.quantity,HOUSING_TRANSACTIONS.avg_price);
22  fclose(file1);
23 
24 
25  /* @\fn: int reagency_housing_process() */
26  filename[0]=0;
27  strcpy(filename, "./outputs/data/REAgency_sales.txt");
28  file1 = fopen(filename,"w");
29  fprintf(file1,"%s %s %s %s %s %s %s\n","IT_NO", "HHFireA", "HHRegularA", "FirmA", "HHFireS", "HHRegularS", "FirmS");
30  //fprintf(file1,"%d %d %d %d %d %d\n",IT_NO, fire_seller_attempts, regular_seller_attempts, firm_seller_attempts, fire_sales, regular_sales, firm_sales);
31  fclose(file1);
32 
33  free(filename);
34  }
35  }
36 
37  IT_NO++;
38  return 0; /* Returning zero means the agent is not removed */
39 }
40