本文整理汇总了Python中Network.logToCount方法的典型用法代码示例。如果您正苦于以下问题:Python Network.logToCount方法的具体用法?Python Network.logToCount怎么用?Python Network.logToCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network.logToCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: import Network [as 别名]
# 或者: from Network import logToCount [as 别名]
for k in range(2, 2+botCount):
decoyAddr = networkAddr | k
decoyList.append(decoyAddr)
for src in botList:
interval = 5
startTime = 270000
for dst in decoyList:
elapsed = myNet.traceroute(src, dst, startTime)
startTime += elapsed + interval
# 各ASのログを保存
for node in myNet.as_dict.values():
as_number = node.as_number
countList = []
Network.logToCount(node.tracerouteLog, countList, 300, 1000)
path = "%s/%05d-%04d.txt" % (OUTPUT_DIR, as_number, i)
outputFile = open(path, 'w')
for c in countList:
line = "%d\n" % c
outputFile.write(line)
myNet.clearASLog()
"""
# 各ネットワークから一定の正規確率でtracerouteを実行
for i in range(100):
for net in myNet.as_list.values():
noiseCounts = np.random.poisson(80, 300)
for j in range(0, len(noiseCounts)):
startTime = j * 1000
for k in range(noiseCounts[j]):
dstNet = random.randint(1, 30 + 1)