# Fields and functions of {Block} objects for the hotpath heuristic. # Last edited on 2021-05-31 17:16:01 by jstolfi import block_hp_IMP import block import contact # USAGE STATUS OF BLOCK IN CURRENT PATH def used_choice(bc): # If some choice of the block {bc} has been used in the the current prefix path {Q}, # returns the index of that choice, else returns {None}. return block_hp_IMP.used_choice(bc) def set_used_choice(bc, us): # Sets the {used_choice} attribute of {bc} of {us}, which must be # {None} or the index of a choice of {bc}. block_hp_IMP.set_used_choice(bc, us) # CONTACTS OF BLOCK def clear_contacts(bc): # Resets the contact list of block {bc} to the empty (mutable) list. block_hp_IMP.clear_contacts(bc) def add_contact(bc, ct): # Appends the {Contact} object {ct} to the contacts list of block {bc}. # There must have been a prior call to {clear_contacts(bc)}. block_hp_IMP.add_contact(bc, ct) def get_contacts(bc): # Gets a copy of the contacts list of blck {bc}. # There must have been a prior call to {clear_contacts(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}. # This field is initially {None}. return block_hp_IMP.get_seams(bc) def set_seams(bc, SMSP): # Sets the {get_seams(bc)} attribute to {SMSP}, which must be a par of lists. block_hp_IMP.set_seams(bc, SMSP)