本文整理汇总了Python中node.Node.getId方法的典型用法代码示例。如果您正苦于以下问题:Python Node.getId方法的具体用法?Python Node.getId怎么用?Python Node.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类node.Node
的用法示例。
在下文中一共展示了Node.getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __addNode
# 需要导入模块: from node import Node [as 别名]
# 或者: from node.Node import getId [as 别名]
def __addNode(self, current_time, nodeStatData):
# adding nodes
key = nodeStatData[0] #(file_path, ligne_number, method_name)
value = nodeStatData[1] #(count, countWithRecursive, exclusiveTime, cummulatedTime, callersData)
node = self.__searchNode(key)
count_data = StampedData(value[0], value[1], value[2], value[3])
if node is None:
node = Node(key[0], key[1], key[2], self.__program_folder, self.__program_path)
self.__nodes.append(node)
node.setStats(current_time, count_data)
# adding edges
callersData = value[4]
for c in callersData.items():
caller = c[0] # same structure as key: (file_path, ligne_number, method_name)
callerStats = c[1] # same structure as value (without callersData): (count, countWithRecursive, exclusiveTime, cummulatedTime)
count_data = StampedData(callerStats[0], callerStats[1], callerStats[2], callerStats[3])
callerNode = self.__searchNode(caller)
if callerNode is None:
callerNode = Node(caller[0], caller[1], caller[2], self.__program_folder, self.__program_path)
self.__nodes.append(callerNode)
edge = self.__searchEdge(callerNode.getId(), node.getId())
if edge is None:
edge = Edge(callerNode.getId(), node.getId())
self.__edges.append(edge)
edge.setStats(current_time, count_data)
示例2: loadNodes
# 需要导入模块: from node import Node [as 别名]
# 或者: from node.Node import getId [as 别名]
def loadNodes(self, data):
nodeData = data['nodes']
for nodeDatum in nodeData:
node = Node(nodeDatum)
nodeId = node.getId()
self.nodeMap[nodeId] = node
示例3: loadNodes
# 需要导入模块: from node import Node [as 别名]
# 或者: from node.Node import getId [as 别名]
def loadNodes(self, data):
nodeData = data['nodes']
for nodeDatum in nodeData:
node = Node(nodeDatum)
nodeId = node.getId()
self.nodeMap[nodeId] = node
if node.isTerminal():
self.terminalNodeId = nodeId
示例4: readNodeFile
# 需要导入模块: from node import Node [as 别名]
# 或者: from node.Node import getId [as 别名]
def readNodeFile(path):
fd = open(path)
nodeList = {}
for line in fd:
if 0 < len(line):
split = line.split("->")
id = int(split[0].strip())
link = split[1].strip()
node = Node(id, link, readFile("data/%d.txt" % (id)))
nodeList[node.getId()] = node
fd.close()
return nodeList