本文整理汇总了Python中network.Network.draw方法的典型用法代码示例。如果您正苦于以下问题:Python Network.draw方法的具体用法?Python Network.draw怎么用?Python Network.draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类network.Network
的用法示例。
在下文中一共展示了Network.draw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from network import Network [as 别名]
# 或者: from network.Network import draw [as 别名]
def main():
"""
1. Input parser constructs the network.
2. Event handler is constructed, initial events loaded.
3. Begin simulation
"""
# Input parser
N = Network()
N.load('testfile.json')
N.draw()
# Event handler
# Begin simulation
pass
示例2: LabArm
# 需要导入模块: from network import Network [as 别名]
# 或者: from network.Network import draw [as 别名]
class LabArm():
def __init__(self):
pygame.init()
self.imgs = Images()
self.canvas = Canvas()
self.netw = Network()
self.fonts = Fonts()
self.events = PCEvents()
self.buttons = Buttons()
self.screen = pygame.display.set_mode(SCREEN_SIZE)
def run(self):
while True:
self.events.handle(self.screen, self.netw)
self.canvas.draw(self.screen)
self.buttons.draw(self.screen)
self.fonts.draw(self.screen)
self.netw.draw(self.screen)
pygame.display.flip()
示例3: Network
# 需要导入模块: from network import Network [as 别名]
# 或者: from network.Network import draw [as 别名]
#!/usr/bin/env python
#
import networkx as nx
import matplotlib.pyplot as plt
from network import Network
from directional_antenna import KNN, MST
network = Network(number_of_nodes=40, relays=6, width=20.0, height=20.0)
network.beamsets()
print("DAKNN: ", KNN(network.copy(), K=3, beams=8))
print("DAMST: ", MST(network, beams=8))
network.draw()
plt.show()