# Additional {Contact} functions for the HotPath heuristic. # Last edited on 2021-05-19 21:18:45 by jstolfi # In addition to the fields defined in the {contact} interface, each {Contact} # object also has some mutable fields that are used during the # {hotpath.best_path} algorithm. They are handled by the procedures in # this section. # # These attributes are not defined automatically. Their initial values # are undefined and must be properly defined by the {set_*} procedures # below, just before or during the heuristic. import contact_hp_IMP import block # BLOCKS CONTAINING THE SIDES def set_side_block(ct, i, bc): # Sets the block {bc} that contains the move which is # side {i} (0 or 1) of contact {ct}. Note that the move may occur in multiple # paths (alternatives) of that block, but must not occur in any other block. # ??? May be superfluous given the {seam} interface. ??? return contact_hp_IMP.set_side_block(ct, i, bc) def side_block(ct, i): # A mutable link that returns the block that contains the move which is # side {i} (0 or 1) of contact {ct}. # ??? May be superfluous given the {seam} interface. ??? return contact_hp_IMP.side_block(ct, i) # PATHS CONTAINING SIDES OF CONTACT def set_side_path(ct, i, oph): # Attaches to contact {ct} the udnerlying {Path} object of the # oriented path {oph}, which must contain the {Move} # object which is side i (0 or 1) of {ct}, in any orientation. The # orientation of {oph} is ignored. Assumes that there is only one {Path} object # of interest for each side. The path {oph} may be {None}. contact_hp_IMP.set_side_path(ct, i, oph) def side_path(ct, i): # Returns the {Path} object which contains the {Move} object which is # side {i} (0 or 1) {ct}, in some orientation, as set by the most # recent call of {set_side_path}. If there was no such call, returns # {None}. return contact_hp_IMP.side_path(ct, i) # ELIS def get_raster_links(ct): # ??? return contact_hp_IMP.get_raster_links(ct) def set_raster_links(ct, rl0, rl1): # ??? return contact_hp_IMP.set_raster_links(ct, rl0, rl1)