# Fields and functions of {Block} objects for the HotPath heuristic. # Last edited on 2021-05-10 15:23:29 by jstolfi import block_hp_IMP import block import contact # Usage status of block in current path: def used(bc): # A mutable bool that tells whether {bc} has been used -- that is, # whether one of its choices has been included in the current prefix path {Q}. return block_hp_IMP.used(bc) def set_used(bc, us): # Sets the {used(bc)} attribute to the bool value {us}. block_hp_IMP.set_used(bc, us) # Contacts of block: def add_contact(bc, ct): # Adds the {Contact} object {ct} to the contacts list of blokc {bc}. block_hp_IMP.add_contact(bc, ct) def get_contacts(bc): # Gets a copy of the contacts list of blck {bc}. return block_hp_IMP.get_contacts(bc) # Seams of block: def get_seams(bc): # Returns a pair {SMSP} of lists such that {SMSP[i]} has # evey {seam.Seam} object {sm} from the input list {SMS} # with {seam.side(sm,i) == bc}. return block_hp_IMP.get_seams(bc) def set_seams(bc, SMSP): # Sets the {seams(bc)} attribute to the par of lists {SMSP}. block_hp_IMP.set_seams(bc, SMSP)