def initialiseLeafNode(self,index,parentIndex,newSpans,newNumSpans): nprint("initialising a leaf node %s from the node %s"%(index,parentIndex)) self.spans[index] = mergeTwoDicts(self.spans[parentIndex],newSpans) self.numSpans[index] = mergeTwoDicts(self.numSpans[parentIndex],newNumSpans) self.cost[index] = 0 self.parent[index] = parentIndex self.children[index] = [] self.fullyExpanded[index] = False self.numberOfVisited[index] = 0
def mergeNumSpan(self,numSpansPath,numSpan): return mergeTwoDicts(numSpansPath, numSpan)
def mergeSpan(self,spansPath,span): return mergeTwoDicts(spansPath, span)