ICEACE Model: Closed Economy
1.0.0
Design Documentation of ICEACE Model
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Macros
Pages
IceaceModel1.0
mall_functions_top.c
Go to the documentation of this file.
1
#include "
header.h
"
2
#include "
mall_agent_header.h
"
3
4
/*
5
* \fn: int mall_init()
6
* \brief: notifies its id by printing out agent id.
7
*/
8
int
mall_init
()
9
{
10
if
(
DATA_COLLECTION_MODE
) {
11
if
(
IT_NO
== 0) {
12
char
* filename;
13
FILE * file1;
14
15
/* @\fn: mall_consumption_summary() */
16
filename = malloc(40*
sizeof
(
char
));
17
filename[0]=0;
18
strcpy(filename,
"./outputs/data/Mall_snapshot.txt"
);
19
file1 = fopen(filename,
"w"
);
20
fprintf(file1,
"%s %s %s\n"
,
"IT_NO"
,
"TRANSACTION_QUANTITY"
,
"AVG_GOODS_PRICE"
);
21
//fprintf(file1,"%d %d %f\n",IT_NO, GOODS_TRANSACTIONS.quantity,GOODS_TRANSACTIONS.avg_price);
22
fclose(file1);
23
free(filename);
24
}
25
}
26
27
IT_NO
++;
28
return
0;
/* Returning zero means the agent is not removed */
29
}
30
Generated on Tue Apr 8 2014 13:25:19 for ICEACE Model: Closed Economy by
1.8.3.1