def addNode(self, id, type=None, coord=None, incLanes=None, intLanes=None): if id not in self._id2node: node = Vertex(id, coord, incLanes) self._nodes.append(node) self._id2node[id] = node self.setAdditionalNodeInfo(self._id2node[id], type, coord, incLanes) return self._id2node[id]
def newVertex(self): v = Vertex(len(self._vertices)) self._vertices.append(v) return v
def vertex_copy(v_id, data): return Vertex(vertex_id=v_id, properties=copy.copy(data))