Пример #1
0
def neightborhood(s):
    neig = []
    for i in bp.state_Expansion(s): # add all valid states from the expansion of the given state
        if bp.state_Verify(i):
            neig.append(i)
    for i in neig:                    # adding all valid retractions of each state currently in the neightborhood
        for j in bp.state_Retract(i):
            if bp.state_Verify(j):
                neig.append(j)
    for i in bp.state_Retract(s): # add all valid states from the retraction of the given state
        if bp.state_Verify(i):
            neig.append(i)
    return neig
Пример #2
0
def neightborhood(s):
    neig = []
    for i in bp.state_Expansion(s): # add all valid states from the expansion of the given state
        if bp.state_Verify(i):
            neig.append(i)
    for i in bp.state_Retract(s): # add all valid states from the retraction of the given state
        if bp.state_Verify(i):
            neig.append(i)
    return neig
Пример #3
0
def neightborhood(s, T, OBJs):
    neig = []
    for i in bp.state_Expansion(
            s):  # adding all valid expansions of the given state
        if bp.state_Verify(i, T, OBJs):
            neig.append(i)
    # for i in neig:                    # adding all valid retractions of each state currently in the neightborhood
    #     for j in bp.state_Retract(i):
    #         if bp.state_Verify(j, T, OBJs):
    #             neig.append(j)
    for i in bp.state_Retract(
            s):  # adding all valid retractions of the given state
        if bp.state_Verify(i, T, OBJs):
            neig.append(i)
    return neig