from baselines.common import plot_util as pu
results1 = pu.load_results('../Documents/GARLresults/testpmf2.2')
results2 = pu.load_results('./logs/test7.2')
results3 = pu.load_results('../Documents/GARLresults/testpaf3.2')
#print(len(results))

import matplotlib.pyplot as plt
import pandas as pd

r1 = results1[0]
r2 = results2[0]
r3 = results3[0]
#pu.plot_results_garl(results)
#print(type(r1.progress.eprewmean))
#r1s = r1.progress['misc/total_timesteps']
#r2s = r2.progress['misc/total_timesteps']
#r2s_2 = r2s.append(r1s[r1s > r2s[r2s.size-1]])
#r2_2 = pd.Series([r2.progress.eprewmean[r2.progress.eprewmean.size-1] for i in range(int(r2s_2.size-31))])
#r2_3 = r2.progress.eprewmean.append(r2_2)
plt.plot(r3.progress['wallclock_time'], r3.progress.eprewmean, label='ppo-pa')
plt.plot(r1.progress['wallclock_time'], r1.progress.eprewmean, label='ppo-pm')
plt.plot(r2.progress['wallclock_time'], r2.progress.eprewmean, label='ppo-combo')
#plt.plot(r2s_2, r2_3, label='group-agent')
#plt.xlim([0, 1e7])
plt.title('GARL')
plt.xlabel('wallclock time')
plt.ylabel('reward')
plt.legend()
plt.show()
