From f4a9110e931dbb0ad2031dcb079bb8982f5889ab Mon Sep 17 00:00:00 2001 From: Antonio Andriella <aandriella@iri.upc.educlear> Date: Fri, 18 Sep 2020 15:07:45 +0200 Subject: [PATCH] Fix bug on correct move counter --- main.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index ada999e..66133a8 100644 --- a/main.py +++ b/main.py @@ -32,6 +32,7 @@ def compute_next_state(user_action, task_progress_counter, attempt_counter, corr max_attempt_counter ''' + # if then else are necessary to classify the task game state into beg, mid, end if user_action == 1: @@ -51,7 +52,6 @@ def compute_next_state(user_action, task_progress_counter, attempt_counter, corr attempt_counter = 1 max_attempt_counter += 1 task_progress_counter +=1 - correct_move_counter += 1 # TODO call the function to compute the state of the game (beg, mid, end) @@ -65,6 +65,7 @@ def compute_next_state(user_action, task_progress_counter, attempt_counter, corr else: game_state_counter = 3 + next_state = (game_state_counter, attempt_counter, user_action) return next_state, task_progress_counter, game_state_counter, attempt_counter, correct_move_counter, wrong_move_counter, timeout_counter, max_attempt_counter @@ -280,12 +281,14 @@ def simulation(bn_model_user_action, var_user_action_target_action, bn_model_use print("current_state ", current_state, " next_state ", next_state) ####################################END of EPISODE####################################### - print("task_evolution {}, attempt_counter {}, correct_counter {}, wrong_counter {}, timeout_counter {}".format(game_state_counter, iter_counter, correct_move_counter, wrong_move_counter, timeout_counter)) - print("robot_assistance_per_action {}".format(robot_assistance_per_action)) - print("attempt_counter_per_action {}".format(attempt_counter_per_action)) - print("game_state_counter_per_action {}".format(game_state_counter_per_action)) - print("robot_feedback_per_action {}".format(robot_feedback_per_action)) - print("iter {}, correct {}, wrong {}, timeout {}".format(iter_counter, correct_move_counter, wrong_move_counter, timeout_counter)) + print("game_state_counter {}, iter_counter {}, correct_counter {}, wrong_counter {}, " + "timeout_counter {}, max_attempt {}".format(game_state_counter, iter_counter, correct_move_counter, + wrong_move_counter, timeout_counter, max_attempt_counter)) + # print("robot_assistance_per_action {}".format(robot_assistance_per_action)) + # print("attempt_counter_per_action {}".format(attempt_counter_per_action)) + # print("game_state_counter_per_action {}".format(game_state_counter_per_action)) + # print("robot_feedback_per_action {}".format(robot_feedback_per_action)) + # print("iter {}, correct {}, wrong {}, timeout {}".format(iter_counter, correct_move_counter, wrong_move_counter, timeout_counter)) #save episode episodes.append(episode) @@ -349,7 +352,7 @@ def simulation(bn_model_user_action, var_user_action_target_action, bn_model_use #SIMULATION PARAMS -epochs = 100 +epochs = 10 #initialise the robot bn_model_robot_assistance = bnlearn.import_DAG('bn_robot_model/robot_assistive_model.bif') -- GitLab