nothing
This commit is contained in:
parent
88bbddbb7f
commit
63f145467b
8
DDPG.py
8
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']))
|
||||
|
|
10
PPO.py
10
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']))
|
||||
|
|
8
SAC.py
8
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']))
|
||||
|
|
8
TD3.py
8
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']))
|
||||
|
|
Loading…
Reference in New Issue