diff --git a/DDPG.py b/DDPG.py index 03e7509..0f54c58 100644 --- a/DDPG.py +++ b/DDPG.py @@ -43,7 +43,7 @@ if __name__ == '__main__': # args.save_network=False # args.test_network=False # args.save_test_data=False - # args.compare_with_pyomo=False + # args.compare_with_gurobi=False if args.train: collect_data = True @@ -97,8 +97,8 @@ if __name__ == '__main__': with open(test_data_save_path, 'wb') as tf: pickle.dump(record, tf) - '''compare with pyomo data and results''' - if args.compare_with_pyomo: + '''compare with gurobi data and results''' + if args.compare_with_gurobi: month = record['init_info'][0][0] day = record['init_info'][0][1] initial_soc = record['init_info'][0][3] @@ -112,7 +112,7 @@ if __name__ == '__main__': plot_dir = make_dir(args.cwd, plot_args.feature_change) plot_optimization_result(base_result, plot_dir) plot_evaluation_information(args.cwd + '/' + 'test_data.pkl', plot_dir) - '''compare the different cost get from pyomo and DDPG''' + '''compare the different cost get from gurobi and DDPG''' ration = sum(eval_data['operation_cost']) / sum(base_result['step_cost']) print('operation_cost_sum:', sum(eval_data['operation_cost'])) print('step_cost_sum:', sum(base_result['step_cost'])) diff --git a/PPO.py b/PPO.py index 842b9d6..9602130 100644 --- a/PPO.py +++ b/PPO.py @@ -261,7 +261,7 @@ class Arguments: self.save_network = True self.test_network = True self.save_test_data = True - self.compare_with_pyomo = True + self.compare_with_gurobi = True self.plot_on = True def init_before_training(self, if_main): @@ -336,7 +336,7 @@ if __name__ == '__main__': # args.save_network=False # args.test_network=False # args.save_test_data=False - # args.compare_with_pyomo=False + # args.compare_with_gurobi=False if args.train: for i_episode in range(num_episode): with torch.no_grad(): @@ -379,8 +379,8 @@ if __name__ == '__main__': with open(test_data_save_path, 'wb') as tf: pickle.dump(record, tf) - '''compare with pyomo data and results''' - if args.compare_with_pyomo: + '''compare with gurobi data and results''' + if args.compare_with_gurobi: month = record['init_info'][0][0] day = record['init_info'][0][1] initial_soc = record['init_info'][0][3] @@ -394,7 +394,7 @@ if __name__ == '__main__': plot_dir = make_dir(args.cwd, plot_args.feature_change) plot_optimization_result(base_result, plot_dir) plot_evaluation_information(args.cwd + '/' + 'test_data.pkl', plot_dir) - '''compare the different cost get from pyomo and PPO''' + '''compare the different cost get from gurobi and PPO''' ration = sum(eval_data['operation_cost']) / sum(base_result['step_cost']) print('operation_cost_sum:', sum(eval_data['operation_cost'])) print('step_cost_sum:', sum(base_result['step_cost'])) diff --git a/SAC.py b/SAC.py index 6bfb1e2..1754cfb 100644 --- a/SAC.py +++ b/SAC.py @@ -46,7 +46,7 @@ if __name__ == '__main__': # args.save_network=False # args.test_network=False # args.save_test_data=False - # args.compare_with_pyomo=False + # args.compare_with_gurobi=False # if args.train: collect_data = True @@ -102,8 +102,8 @@ if __name__ == '__main__': with open(test_data_save_path, 'wb') as tf: pickle.dump(record, tf) - '''compare with pyomo data and results''' - if args.compare_with_pyomo: + '''compare with gurobi data and results''' + if args.compare_with_gurobi: month = record['init_info'][0][0] day = record['init_info'][0][1] initial_soc = record['init_info'][0][3] @@ -117,7 +117,7 @@ if __name__ == '__main__': plot_dir = make_dir(args.cwd, plot_args.feature_change) plot_optimization_result(base_result, plot_dir) plot_evaluation_information(args.cwd + '/' + 'test_data.pkl', plot_dir) - '''compare the different cost get from pyomo and SAC''' + '''compare the different cost get from gurobi and SAC''' ration = sum(eval_data['operation_cost']) / sum(base_result['step_cost']) print('operation_cost_sum:', sum(eval_data['operation_cost'])) print('step_cost_sum:', sum(base_result['step_cost'])) diff --git a/TD3.py b/TD3.py index 8c8baa0..109bafd 100644 --- a/TD3.py +++ b/TD3.py @@ -43,7 +43,7 @@ if __name__ == '__main__': # args.save_network=False # args.test_network=False # args.save_test_data=False - # args.compare_with_pyomo=False + # args.compare_with_gurobi=False if args.train: collect_data = True @@ -98,8 +98,8 @@ if __name__ == '__main__': with open(test_data_save_path, 'wb') as tf: pickle.dump(record, tf) - '''compare with pyomo data and results''' - if args.compare_with_pyomo: + '''compare with gurobi data and results''' + if args.compare_with_gurobi: month = record['init_info'][0][0] day = record['init_info'][0][1] initial_soc = record['init_info'][0][3] @@ -113,7 +113,7 @@ if __name__ == '__main__': plot_dir = make_dir(args.cwd, plot_args.feature_change) plot_optimization_result(base_result, plot_dir) plot_evaluation_information(args.cwd + '/' + 'test_data.pkl', plot_dir) - '''compare the different cost get from pyomo and TD3''' + '''compare the different cost get from gurobi and TD3''' ration = sum(eval_data['operation_cost']) / sum(base_result['step_cost']) print('operation_cost_sum:', sum(eval_data['operation_cost'])) print('step_cost_sum:', sum(base_result['step_cost'])) diff --git a/tools.py b/tools.py index ac1cb7b..6b2da0a 100644 --- a/tools.py +++ b/tools.py @@ -152,7 +152,7 @@ class Arguments: self.save_network = True self.test_network = True self.save_test_data = True - self.compare_with_pyomo = True + self.compare_with_gurobi = True self.plot_on = True def init_before_training(self, if_main):