# Tools and types to handle the "front" set of the HotPath heuristic. # Last edited on 2021-02-08 19:52:43 by jstolfi import front_IMP # During the heuristics, if # # When a path {ph} is part of a tentative tool-path, def get_one(R, rev): # Returns a list containing a single element of the filler set {R} # that has not been incorporated into the current tentative tool path. # # Assumes that element that have been incorporated have their field # {.htini} set to not a value different from {None}. Returns an empty # list if all elements are in the path. # # If {rev} is false, scans the list in increasing index order, else # scans it in the opposite order. return front_IMP.get_one(R, rev) def get_initial_fringe(R): # Retuns a list of filler elements of {R} that have not been # incorporated into the current tentative tool path # and have no contacts. Returns an empty # list if all elements are in the path. return front_IMP.get_initial_fringe(R) def get_initial_all (R): # Returns a list (possibly empty) with all filler elements of {R} that are not yet included # in the current tentative tool-path. return front_IMP.get_initial_all(R) def add_element(L, el): # If the filler element {el} is not in the list {L} and not # in the current tentative tool-path (that is, {el.htini} is {None}), # appends {el} to {L} and return {True}, else returns {False}. return front_IMP.add_element(L, el)