Agent_Control_with_Language / plot_functions.py
ArseniyPerchik's picture
more
a853d77
from globals import *
def plot_env(ax, info):
ax.cla()
env = info['env']
agent_x, agent_y = env.agent_x, env.agent_y
goal_x, goal_y = env.goal_x, env.goal_y
# agent
ax.plot([agent_x], [agent_y], marker='o', color='b', alpha=0.5, linewidth=5, markersize=15)
# target
ax.plot([goal_x], [goal_y], marker='X', color='orange', alpha=0.5, linewidth=5, markersize=15)
circle = Circle((goal_x, goal_y), env.RADIUS_COVERAGE, color='orange', fill=True, alpha=0.3)
ax.add_patch(circle)
# ax.set_xlim([min(n_agents_list) - 20, max(n_agents_list) + 20])
ax.set_xlim([0, 100])
ax.set_ylim([0, 100])
# ax.set_xticks(n_agents_list)
# ax.set_xlabel('N agents', fontsize=27)
# ax.set_ylabel('Success Rate', fontsize=27)
# ax.set_title(f'{img_dir[:-4]} Map | time limit: {time_to_think_limit} sec.')
# set_plot_title(ax, f'{img_dir[:-4]} Map | time limit: {time_to_think_limit} sec.', size=11)
ax.set_title(f'Warehouse Env | step {env.step_counter}', fontweight="bold", size=10)
# set_legend(ax, size=18)
# labelsize = 20
# ax.xaxis.set_tick_params(labelsize=labelsize)
# ax.yaxis.set_tick_params(labelsize=labelsize)
plt.tight_layout()