File size: 1,220 Bytes
a853d77
fbd53e3
 
 
 
 
 
 
a853d77
 
 
 
 
 
 
 
 
 
 
fbd53e3
 
 
 
 
 
 
 
a853d77
fbd53e3
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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()