# Implementation of the moldule {front}. # Last edited on 2021-10-10 03:27:46 by stolfi def get_one(R, rev): nel = len(R) for kel in range(nel): elk = R[kel] if not rev else R[nel-1-kel] if elk.htini != None: return [ elk ] return [] def get_initial_fringe (R): L = [] for elk in R: ctk = path.contacts(elk) if (len(ctk) == 0) and (elk.htini == None): L.append(elk) return L def get_initial_all(R): L = [] for elk in R: if (elk.htini == None): L.append(elk) return L def add_element(L, el): if el not in L and el.htini != None: L.append(el_new) return True else: return False