forked from StavrosOrf/EV2Gym
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_RL_exp.py
34 lines (31 loc) · 1.31 KB
/
run_RL_exp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
This file is used to run various experiments in different tmux panes each.
"""
import os
import time
counter = 0
# for config in ['V2GProfitMax', 'PublicPST', 'V2GProfitPlusLoads']:
for config in ['V2GProfitPlusLoads']:
# for algorithm in ['ddpg', 'td3', 'sac','ppo', 'tqc','ars', 'rppo']:
# for algorithm in ['ddpg']:
for algorithm in ['ddpg', 'td3', 'sac', 'a2c', 'ppo', 'tqc', 'trpo', 'ars', 'rppo']:
command = 'tmux new-session -d \; send-keys "python3 train_stable_baselines.py' + \
' --algorithm ' + algorithm + \
' --device cuda:' + str(counter % 2) + \
' --config_file ev2gym/example_config_files/' + config + '.yaml' + \
'" Enter'
os.system(command=command)
print(command)
# wait for 10 seconds before starting the next experiment
time.sleep(10)
counter += 1
# for algorithm in ['ddpg', 'td3', 'sac', 'a2c', 'ppo', 'tqc', 'trpo', 'ars', 'rppo']:
# command = 'tmux new-session -d \; send-keys "python3 train_stable_baselines.py' + \
# ' --algorithm ' + algorithm + \
# ' --device cuda:' + str(counter % 2) + \
# '" Enter'
# os.system(command=command)
# print(command)
# # wait for 10 seconds before starting the next experiment
# time.sleep(10)
# counter += 1