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

Function plot_age_lines

utils/base_utils.py:285–305  ·  view source on GitHub ↗
(uav_aoi_list,move_aoi_list,collect_aoi_list,sendback_aoi_list,full_path)

Source from the content-addressed store, hash-verified

283 plt.close()
284
285def plot_age_lines(uav_aoi_list,move_aoi_list,collect_aoi_list,sendback_aoi_list,full_path):
286 uav_aoi_array=np.array(uav_aoi_list).transpose((1,0))
287 move_aoi_array = np.array(move_aoi_list).transpose((1, 0))
288 collect_aoi_array = np.array(collect_aoi_list).transpose((1, 0))
289 sendback_aoi_array = np.array(sendback_aoi_list).transpose((1, 0))
290 uav_num=uav_aoi_array.shape[0]
291 for i in range(uav_num):
292 if params.trainable is True:
293 plt.xlabel("Training episode")
294 else:
295 plt.xlabel("Step")
296 plt.ylabel("second")
297 plt.plot(uav_aoi_array[i],label="total_aoi")
298 plt.plot(move_aoi_array[i], label="move_aoi")
299 plt.plot(collect_aoi_array[i], label="collect_aoi")
300 plt.plot(sendback_aoi_array[i], label="sendback_aoi")
301 plt.grid(True)
302 plt.legend()
303 plt.grid(linestyle='--')
304 plt.savefig(full_path + "/" + "Age_uav_%d"%i + '.png')
305 plt.close()
306
307
308def plot_reward_lines(uav_reward_list, uav_penalty_list,full_path):

Callers 1

draw_pathMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected