-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPPOS_States_Plot.py
21 lines (21 loc) · 3.08 KB
/
PPOS_States_Plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,25,25)
ppo_states=[[0.7621238116657905, 5.281581818717286, 2.7377083513118916, 0.0, 0.037185331795093646, 0.0, 0],[4.271128815798707, 14.979412403565288, 1.0254210018317795, 0.0, 0.6926884184042794, 0, 0],[2.4877073095468782, 8.138099217576574, 0.8183516729281568, 0.0, 0.16074492921785377, 0.0, 1],[5.9802436675487725, 2.664258686732306, 0.48207993251568326, 0.0, 0.8739125828986052, 0, 0],[0.18806961281174162, 12.783112526132019, 1.2768667466291912, 0.0, 0.5385871242906708, 0.0, 0],[3.9672552785179125, 4.848941503159154, 1.0956919886692136, 0.0, 1.9584751171981452, 0, 0],[4.250772099888893, 12.996028235489895, 1.3846336978168052, 0.0, 0.2800368258293249, 0, 0],[4.715731474248204, 6.404517456124749, 1.1648565564370135, 0.0, 0.5069359086573646, 0.0, 0],[4.851420858478316, 7.489321505334827, 0.8976234750191328, 0.0, 0.24576767420253698, 0.0, 0],[3.124326335696171, 3.534488721228931, 1.6158711236315944, 0.0, 0.7674014125854862, 0.0, 0],[1.849784959782129, 12.61429205085382, 1.8082869519096623, 0.0, 1.9205956971298015, 0, 0],[4.523364783622641, 8.039905750995434, 0.2491201538940604, 0.0, 0.4930671527956889, 0, 0],[2.425300125695964, 7.202035467102954, 1.8735777128769031, 0.0, 0.11671011394608422, 0.0, 0],[5.124636569212408, 5.466688744706562, 0.4984343968503233, 0.0, 0.44261698125197113, 0, 0],[0.8717879438227534, 8.440673198839697, 0.5007990083719704, 0.0, 0.05450307102873242, 0.0, 1],[4.923792632897356, 6.3857643958649195, 1.7670725093071178, 0.0, 1.88723126287526, 0, 0],[3.359834706581543, 13.480323718108355, 1.162840674537546, 0.8983161449432373, 0.33600057281534457, 0.0, 1],[5.925748978880774, 4.5806190328197385, 1.7354059644861983, 0.0, 1.5900246755614624, 0, 0],[4.331653541067753, 12.08672251436019, 1.6948153704372795, 0.0, 0.12473287302316738, 0.0, 1],[1.2749371551636353, 8.15823574624818, 0.9863646790837626, 0.0, 0.25354289793677354, 0.16399295044385967, 0],[0.06991678025376613, 12.623052789831549, 0.163483336725047, 0.0, 1.9231306574773344, 0, 0],[4.474178659731177, 6.890864195776837, 0.5515769270760671, 0.0, 0.8249048437622337, 0, 0],[2.3777708377653743, 11.110795479808136, 1.7850524151630962, 0.0, 0.31543005386041845, 0.0, 0],[1.2593814369143692, 0.6937936481280176, 1.7084011592516335, 0.0, 1.0225510866807055, 0, 0],[2.6775315664256247, 6.8943451171006025, 1.5559119119792106, 0.0, 1.5227948972806795, 0, 0]]
ppo_states=np.transpose(np.asarray(ppo_states))
plt.plot(x, ppo_states[0], color='palevioletred', label='W_t')
plt.plot(x, ppo_states[1], color='lightsalmon', label='PS_t')
plt.plot(x, ppo_states[2], color='gold', label='R_t')
plt.plot(x, ppo_states[3], color='lightsteelblue', label='H_t')
plt.plot(x, ppo_states[4], color='cadetblue', label='WS_t')
plt.plot(x, ppo_states[5], color='lightblue', label='EP_t')
plt.xticks(np.arange(min(x), max(x)+1, 2.0))
ax = plt.axes()
ax.set_xlim(left=0,right=24)
ax.set_ylim(bottom=0,top=20)
ax.legend(loc='upper left')
plt.title("PPOS Scheduler agent states at t=15")
plt.xlabel("Episodes")
plt.ylabel("States")
plt.savefig("./plots/PPO_States_plot.jpg",dpi=300)
plt.close()