diff --git a/grouping/PPO_cg.py b/grouping/PPO_cg.py index da999b608fee838d5dbb894c070777cbb43bd49b..e83e6cb5a4ae12e26fe0dd989b32b5b540951b0c 100644 --- a/grouping/PPO_cg.py +++ b/grouping/PPO_cg.py @@ -43,9 +43,9 @@ full_filepath = None def set_component_names_from_solutions(filename_, solutions): - with open(filename_, 'r+') as f: - data = json.load(f) - + f = open(filename_, 'r+') + data = json.load(f.read()) + f.close() no_of_components = data['Number_of_components'] component_index_map={} name_of_components=[] @@ -890,7 +890,7 @@ def initial_groupings(full_filepath,app_id,uri_notification,request_type): for element in range(1, Number_components+1): initial_combination.append([element]) print("Initial grouping {0}".format(set_component_names_from_solutions(full_filepath,initial_combination))) - logging.info("Initial grouping {0}".format(set_component_names_from_solutions(full_filepath,initial_combination))) + #logging.info("Initial grouping {0}".format(set_component_names_from_solutions(full_filepath,initial_combination))) time.sleep(5) data_to_send_to_ps = {"utility": initial_utility, "application_id": app_id,"uri_notification": uri_notification, "request_type":request_type, "result": initial_combination, "json_path": full_filepath} print('data to send to ps: {0}'.format(data_to_send_to_ps))