# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import numpy as np
from udntools.utils import DFSDictByDistance
from udntools.region import ServiceRegion
import matplotlib.pyplot as plt

service_region = ServiceRegion(0, 100, 0, 100, 100, 1000, if_fix_bs=True)

dfs_3 = DFSDictByDistance(service_region.bs_position_, 3.0)
dfs_5 = DFSDictByDistance(service_region.bs_position_, 5.0)
dfs_7 = DFSDictByDistance(service_region.bs_position_, 7.0)
dfs_10 = DFSDictByDistance(service_region.bs_position_, 10.0)
def get_comp_number(region):
    count = 0
    for key, values in region.cluster_set_.items():
        num = np.size(values)
        if num > 1:
            count += num
    return count


# +
import matplotlib
params = {'axes.labelsize': 15,'axes.titlesize':10, 'text.fontsize': 15, 'legend.fontsize': 15, 'xtick.labelsize': 15, 'ytick.labelsize': 15}
matplotlib.rcParams.update(params)
# 图片大小
fig = plt.figure(figsize=(13, 13))
# 使能中文字体
# -*- coding:utf-8 -*-
plt.subplot(221)
plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号



dfs_3.dfs_plot(service_region.bs_position_)

plt.xlim(0, 100)
plt.ylim(0, 100)

plt.xlabel("X(m)", size=13)
plt.ylabel("Y(m)", size=13)

plt.grid(True)
plt.title("(a) $\tau=3$",fontproperties = 'SimHei', size=15)

plt.subplot(222)



dfs_5.dfs_plot(service_region.bs_position_)

plt.xlim(0, 100)
plt.ylim(0, 100)

plt.xlabel("X(m)", size=13)
plt.ylabel("Y(m)", size=13)
plt.title("(b) $\tau=5$",fontproperties = 'SimHei', size=15)
plt.grid(True)

plt.subplot(223)




dfs_7.dfs_plot(service_region.bs_position_)

plt.xlim(0, 100)
plt.ylim(0, 100)

plt.xlabel("X(m)", size=13)
plt.ylabel("Y(m)", size=13)
plt.title("(c) $\tau=7$",fontproperties = 'SimHei', size=15)
plt.grid(True)

plt.subplot(224)


dfs_10.dfs_plot(service_region.bs_position_)

plt.xlim(0, 100)
plt.ylim(0, 100)

plt.xlabel("X(m)", size=13)
plt.ylabel("Y(m)", size=13)
plt.title("(d) $\tau=10$",fontproperties = 'SimHei', size=15)
plt.grid(True)

# 存储成为pdf
fig.savefig('dfs_network_show.pdf')
fig.savefig('dfs_network_show.png')

plt.show()
# -





StarcoderdataJupyterScriptsDedupFiltered