当前位置: 首页>>代码示例>>Python>>正文


Python Node.getId方法代码示例

本文整理汇总了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)
开发者ID:Noxy,项目名称:callGraphAnalysis,代码行数:30,代码来源:graph.py

示例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
开发者ID:Cleo-Stanford-CS,项目名称:CS221-Car,代码行数:9,代码来源:agentGraph.py

示例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
开发者ID:joefan123,项目名称:cs221,代码行数:11,代码来源:agentGraph.py

示例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
开发者ID:thomas-lack,项目名称:mebminingexercises,代码行数:14,代码来源:datautils.py


注:本文中的node.Node.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。