def process(g): for i in range(len(capacities)): nc = g(i) ns = T.makeLeaf(nc, state) if(isNewContents(ns)): T.addSubtree(state, ns) nss.append(ns)
def extendSolution(n): nss = [] for i in D: nc = i st = T.makeLeaf(nc, n) if(shouldBeAdded(st)): T.addSubtree(n, st) nss.append(st) return nss
def extendSolution(n): nss = [] for i in choices: ncs = process(i) for nc in ncs: st = T.makeLeaf(nc, n) if(shouldBeAdded(st)): T.addSubtree(n, st) nss.append(st) return nss