本文整理汇总了Python中networkx.DiGraph.node["start"]["socksproxy"]方法的典型用法代码示例。如果您正苦于以下问题:Python DiGraph.node["start"]["socksproxy"]方法的具体用法?Python DiGraph.node["start"]["socksproxy"]怎么用?Python DiGraph.node["start"]["socksproxy"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类networkx.DiGraph
的用法示例。
在下文中一共展示了DiGraph.node["start"]["socksproxy"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import node["start"]["socksproxy"] [as 别名]
def generate(self):
server_str = ','.join(self.tgen_servers)
g = DiGraph()
g.add_node("start", serverport=self.tgen_port, peers=server_str, loglevel="info", heartbeat="1 minute")
if self.socksproxy is not None:
g.node["start"]["socksproxy"] = self.socksproxy
g.add_node("pause", time="5 minutes")
g.add_node("transfer50k", type="get", protocol="tcp", size="50 KiB", timeout="295 seconds", stallout="300 seconds")
g.add_node("transfer1m", type="get", protocol="tcp", size="1 MiB", timeout="1795 seconds", stallout="1800 seconds")
g.add_node("transfer5m", type="get", protocol="tcp", size="5 MiB", timeout="3595 seconds", stallout="3600 seconds")
g.add_edge("start", "pause")
# after the pause, we start another pause timer while *at the same time* choosing one of
# the file sizes and downloading it from one of the servers in the server pool
g.add_edge("pause", "pause")
# these are chosen with weighted probability, change edge 'weight' attributes to adjust probability
g.add_edge("pause", "transfer50k", weight="12.0")
g.add_edge("pause", "transfer1m", weight="2.0")
g.add_edge("pause", "transfer5m", weight="1.0")
return g