MCPcopy Create free account
hub / github.com/BIT-MCS/DRL-eFresh / plot_reward_lines

Function plot_reward_lines

utils/base_utils.py:308–324  ·  view source on GitHub ↗
(uav_reward_list, uav_penalty_list,full_path)

Source from the content-addressed store, hash-verified

306
307
308def plot_reward_lines(uav_reward_list, uav_penalty_list,full_path):
309 uav_reward_array=np.array(uav_reward_list).transpose((1,0))
310 uav_penalty_array = np.array(uav_penalty_list).transpose((1, 0))
311 uav_num = uav_reward_array.shape[0]
312 for i in range(uav_num):
313 if params.trainable is True:
314 plt.xlabel("Training episode")
315 else:
316 plt.xlabel("Step")
317 plt.ylabel("Reward/Penalty")
318 plt.plot(uav_reward_array[i],label="positive gain")
319 plt.plot(uav_penalty_array[i], label="negative penalty")
320 plt.grid(True)
321 plt.grid(linestyle='--')
322 plt.legend()
323 plt.savefig(full_path + "/" + "Reward_uav_%d"%i + '.png')
324 plt.close()
325
326def plot_fairness_lines(jain_fairness_list,gs_fairness_list,full_path):
327 plt.plot(jain_fairness_list,label="jain_fairness")

Callers 1

draw_pathMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected