Skip to content
Snippets Groups Projects
Commit 82c595f8 authored by Your Name's avatar Your Name
Browse files

update

parent cb68cca0
No related branches found
No related tags found
No related merge requests found
...@@ -107,7 +107,7 @@ for scenario in scenarios: ...@@ -107,7 +107,7 @@ for scenario in scenarios:
plt.tight_layout() # Garante que todos os elementos estejam visíveis plt.tight_layout() # Garante que todos os elementos estejam visíveis
plt.legend(loc= 'lower right') plt.legend(loc= 'lower right')
if cap_conf_info['UE1_slice'] != '-' and cap_conf_info['UE2_slice'] != '-': if cap_conf_info['UE1_slice'] != '-' and cap_conf_info['UE2_slice'] != '-':
conf_list.append(f"({cap_conf_info['UE1_slice']}% / {cap_conf_info['UE2_slice']}%)") conf_list.append(f"({cap_conf_info['UE1_slice']}%/{cap_conf_info['UE2_slice']}%)")
save_path_throughput = os.path.join(scenario_path, f"{cap_conf_info['UE1_slice']}_{cap_conf_info['UE2_slice']}.png") save_path_throughput = os.path.join(scenario_path, f"{cap_conf_info['UE1_slice']}_{cap_conf_info['UE2_slice']}.png")
plt.savefig(save_path_throughput, dpi=300, bbox_inches='tight') plt.savefig(save_path_throughput, dpi=300, bbox_inches='tight')
else: else:
...@@ -117,16 +117,15 @@ for scenario in scenarios: ...@@ -117,16 +117,15 @@ for scenario in scenarios:
pl_ue2.append((ue_dataframes[scenario][cap_conf_folder]['ue2']["PacketsLost"].sum()/ue_dataframes[scenario][cap_conf_folder]['ue2']["TotalPackets"].sum())*100) pl_ue2.append((ue_dataframes[scenario][cap_conf_folder]['ue2']["PacketsLost"].sum()/ue_dataframes[scenario][cap_conf_folder]['ue2']["TotalPackets"].sum())*100)
plt.show() plt.show()
# Configurar a posição das barras no eixo x # Configurar a posição das barras no eixo x
conf_list = [f"Cenário {j + 1} \n {conf_list[i]}" for j, i in enumerate([0, 3, 6]) if i < len(conf_list)] #conf_list = [f"Cenário {j + 1} \n {conf_list[i]}" for j, i in enumerate([0, 3, 6]) if i < len(conf_list)]
conf_list = [f"C{j + 1} \n {conf}" for j, conf in enumerate(conf_list)]
x = np.arange(len(conf_list)) # Posições das scenarios x = np.arange(len(conf_list)) # Posições das scenarios
largura = 0.4 # Largura das barras largura = 0.4 # Largura das barras
# Criar as barras # Criar as barras
pl_ue1 = [pl_ue1[i] for i in [0, 3, 6] if i < len(pl_ue1)] #pl_ue1 = [pl_ue1[i] for i in [0, 3, 6] if i < len(pl_ue1)]
pl_ue2 = [pl_ue2[i] for i in [0, 3, 6] if i < len(pl_ue2)] #pl_ue2 = [pl_ue2[i] for i in [0, 3, 6] if i < len(pl_ue2)]
print(pl_ue1)
print(pl_ue2)
plt.bar(x - largura / 2, pl_ue1, width=largura, label=f"UE1 (Banda: {scenario_info['UE1_bandwidth']} Mbps)", color='#ff7f0e') # Barras para UE1 plt.bar(x - largura / 2, pl_ue1, width=largura, label=f"UE1 (Banda: {scenario_info['UE1_bandwidth']} Mbps)", color='#ff7f0e') # Barras para UE1
plt.bar(x + largura / 2, pl_ue2, width=largura, label=f"UE2 (Banda: {scenario_info['UE2_bandwidth']} Mbps)", color='#1f77b4') # Barras para UE2 plt.bar(x + largura / 2, pl_ue2, width=largura, label=f"UE2 (Banda: {scenario_info['UE2_bandwidth']} Mbps)", color='#1f77b4') # Barras para UE2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment