# Implementation of the moldule {front}. # Last edited on 2021-02-08 19:53:02 by jstolfi def get_one(R, rev): n = len(R) for k in range(n): elk = R[k] if not rev else R[n-1-k] 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