2 #include "../household_agent_header.h"
12 double disposable_income;
20 budget = disposable_income;
46 printf(
"Household ID = %d has no money to go to the mall!\n",
ID);
65 if (
ID > 50 &&
ID < 60) {
66 printf(
"Household ID = %d goes to market with a budget = %f \n",
ID,
MALL_BUDGET);
80 double total_money_spent, money_to_spend;
81 int bought, quantity_bought;
84 if (
ID > 50 &&
ID < 60) {
85 printf(
"Household ID = %d waiting to receive goods from the mall. \n",
ID);
90 total_money_spent = 0;
95 if (money_spent > 0 && bought > 0) {
96 total_money_spent += money_spent;
97 quantity_bought += bought;
105 if (
ID > 50 &&
ID < 60) {
106 printf(
"Household ID = %d bought %d goods \n",
ID, quantity_bought);
113 filename = malloc(100*
sizeof(
char));
115 strcpy(filename,
"./outputs/data/Household_Weekly.txt");
117 file1 = fopen(filename,
"a");