-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_base.py
More file actions
36 lines (29 loc) · 1.03 KB
/
Copy pathtest_base.py
File metadata and controls
36 lines (29 loc) · 1.03 KB
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
35
36
import warnings
warnings.filterwarnings("ignore", category=UserWarning)
warnings.filterwarnings("ignore", category=UserWarning, module="stable_baselines")
import wandb
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines.common.callbacks import EvalCallback
from env import mEnv
nQueues = 3
boost = 0
wandb.init(project='process-scheduling1', config={"nQueues": nQueues, "boost": boost})
wandb.run.name = "Baseline"
wandb.config.update({"nQueues": nQueues, "boost": boost})
env= mEnv(boost,nQueues,False)
env=DummyVecEnv([lambda: env])
for i in range(100):
obs = env.reset()
init_quantum = env.quantum_list
total_reward = 0
for j in range(10000):
obs, reward, done, info = env.step(init_quantum)
total_reward += reward
if done:
break
print(f"Iteration {i}: reward =", total_reward)
wandb.log({"Iteration": i, "Reward": total_reward})
env.print_stats()
#env.render()
env.log_stats()
wandb.run.finish()