diff --git a/simulation/arena.py b/simulation/arena.py index 00caaa2..82b5d20 100644 --- a/simulation/arena.py +++ b/simulation/arena.py @@ -387,13 +387,16 @@ def simulate_one_avatar(self, avatar_id): avatar_.write_log(f"Is simulating avatar {avatar_id}") avatar_.exit_flag = False page_generator = self.page_generator(avatar_id) + current_page = 0 while not avatar_.exit_flag: # for i in range(2): + current_page += 1 id_on_page = next(page_generator, []) # get the next page, a list of item ids if(len(id_on_page) == 0): break movies_on_page = [self.movie_detail[idx] for idx in id_on_page] + movies_on_page_str = ''.join(movies_on_page) avatar_.write_log("============= Recommendation Page =============") for idx, movie in enumerate(movies_on_page): if(id_on_page[idx] in self.data.valid_user_list[avatar_id]): @@ -404,7 +407,7 @@ def simulate_one_avatar(self, avatar_id): avatar_.write_log("") #@ most important - response = avatar_.reaction_to_recommended_items(movies_on_page) + response = avatar_.reaction_to_recommended_items(movies_on_page_str, current_page) avatar_.write_log("") avatar_.write_log("============= Avatar Response =============")