Beispiel #1
0
def map_test02():
    """ 0 bits """
    blocks = [
        [W, W, W, W, W],
        [W, I, E, E, W],
        [W, E, W, E, W],
        [W, S, W, I, W],
        [W, W, W, W, W],
    ]
    return GridMap(blocks=blocks)
Beispiel #2
0
def map_test04():
    """ 0 bits, 1 state, 3 trajectories """
    blocks = [
        [W, W, W, W, W, W, W],
        [W, E, E, S, E, E, W],
        [W, E, W, W, W, E, W],
        [W, I, W, W, W, E, W],
        [W, I, W, W, W, I, W],
        [W, W, W, W, W, W, W],
    ]
    return GridMap(blocks=blocks)
Beispiel #3
0
def map_test03():
    """ 1 bits, 2 states, 4 trajectories """
    blocks = [
        [W, W, W, W, W, W, W],
        [W, E, E, S, E, E, W],
        [W, E, W, W, W, E, W],
        [W, I, W, W, W, I, W],
        [W, I, W, W, W, I, W],
        [W, W, W, W, W, W, W],
    ]
    return GridMap(blocks=blocks)
Beispiel #4
0
def map_intruder_4s():
    """ shorter """
    blocks = [
        [W, W, W, W, W, W, W],
        [W, E, W, S, W, I, W],
        [W, E, W, E, W, I, W],
        [W, E, W, E, W, E, W],
        [W, E, E, E, W, E, W],
        [W, E, W, E, W, E, W],
        [W, I, W, E, E, E, W],
        [W, I, W, E, W, E, W],
        [W, W, W, W, W, W, W],
    ]
    return GridMap(blocks=blocks)
Beispiel #5
0
def map_intruder_3():
    blocks = [
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, E, E, E, E, I, I, I, E, E, E, E, E, W],
        [W, E, E, W, W, W, W, W, W, W, W, W, E, W],
        [W, E, E, E, E, E, S, E, E, E, E, E, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W]
    ]
    return GridMap(blocks=blocks)
Beispiel #6
0
def map_rmaze():
    blocks = [
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W],
        [W, S, E, E, W, W, W, W, W, W, E, E, E, W],
        [W, E, E, E, W, W, W, W, W, W, E, E, E, W],
        [W, E, E, E, W, W, W, W, W, W, E, E, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, E, E, E, W, W, W, W, W, W, E, E, E, W],
        [W, E, E, E, W, W, W, W, W, W, E, E, E, W],
        [W, E, E, E, W, W, W, W, W, W, E, E, G, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W],
    ]
    return GridMap(blocks=blocks)
Beispiel #7
0
def map_intruder_9():
    """ 2 rooms, full of area """
    blocks = [
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, E, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, E, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, W, W, W, W, W, W, W, W, W, E, W],
        [W, E, E, E, E, E, S, E, E, E, E, E, E, W],
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W]
    ]
    return GridMap(blocks=blocks)
Beispiel #8
0
def map_intruder_4d():
    """ Vede uno prima dell'altro """
    blocks = [
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W],
        [W, E, W, I, E, E, E, W, E, E, I, W, E, W],
        [W, E, W, E, E, E, E, W, E, E, E, W, E, W],
        [W, E, W, E, E, E, E, W, E, E, E, W, E, W],
        [W, E, W, E, E, E, E, W, E, E, E, E, E, W],
        [W, E, W, E, E, E, E, W, E, E, E, W, E, W],
        [W, E, E, E, I, E, E, W, E, E, E, W, E, W],
        [W, E, W, E, E, E, E, W, E, E, I, W, E, W],
        [W, E, W, E, E, E, E, W, W, W, W, W, E, W],
        [W, E, W, E, E, E, E, W, W, W, W, W, E, W],
        [W, E, W, W, W, W, W, W, W, W, W, W, E, W],
        [W, E, E, E, S, E, E, E, E, E, E, E, E, W],
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W]
    ]
    return GridMap(blocks=blocks)
Beispiel #9
0
def map_intruder_12():
    """ This has 2 distinct rooms, full environment """
    blocks = [
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W],
        [W, I, W, I, I, I, I, W, I, I, I, W, I, W],
        [W, I, W, I, I, I, I, W, I, I, I, I, I, W],
        [W, I, W, I, I, I, I, W, I, I, I, W, I, W],
        [W, I, W, I, I, I, I, W, I, I, I, W, I, W],
        [W, I, W, I, I, I, I, W, I, I, I, W, I, W],
        [W, I, W, I, I, I, I, W, I, I, I, W, I, W],
        [W, I, W, I, I, I, I, W, I, I, I, W, I, W],
        [W, I, W, I, I, I, I, W, W, W, W, W, I, W],
        [W, I, I, I, I, I, I, W, E, S, E, W, I, W],
        [W, I, W, I, I, I, I, W, E, E, E, W, I, W],
        [W, I, W, I, I, I, I, W, E, E, E, W, I, W],
        [W, I, W, W, W, W, W, W, W, E, W, W, I, W],
        [W, I, I, I, I, I, I, I, I, E, I, I, I, W],
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W]
    ]
    return GridMap(blocks=blocks)
Beispiel #10
0
def map_intruder_10():
    """ This has 3 distinct rooms, full of intruders each, start in 4th room. """
    blocks = [
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, E, E, W],
        [W, E, E, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, W, W, W, W, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, I, I, I, W, E, W],
        [W, E, W, I, I, I, I, W, W, W, W, W, E, W],
        [W, E, E, I, I, I, I, W, S, E, E, W, E, W],
        [W, E, W, I, I, I, I, W, E, E, E, W, E, W],
        [W, E, W, I, I, I, I, W, E, E, E, W, E, W],
        [W, E, W, W, W, W, W, W, W, E, W, W, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W]
    ]
    return GridMap(blocks=blocks)
Beispiel #11
0
def map_intruder_6b():
    """ This has 3 distinct rooms. """
    blocks = [
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W],
        [W, E, W, I, E, E, E, W, I, E, E, W, E, W],
        [W, E, W, E, E, E, E, W, E, E, E, E, E, W],
        [W, E, E, E, E, E, E, W, E, E, E, W, E, W],
        [W, E, W, E, E, E, E, W, E, E, E, W, E, W],
        [W, E, W, I, E, E, E, W, E, E, E, W, E, W],
        [W, E, W, W, W, W, W, W, E, E, E, W, E, W],
        [W, E, W, W, I, E, E, W, E, E, I, W, E, W],
        [W, E, W, W, E, E, E, W, W, W, W, W, E, W],
        [W, E, E, E, E, E, E, W, S, E, E, W, E, W],
        [W, E, W, W, E, E, E, W, E, E, E, W, E, W],
        [W, E, W, W, I, E, E, W, E, E, E, W, E, W],
        [W, E, W, W, W, W, W, W, W, E, W, W, E, W],
        [W, E, E, E, E, E, E, E, E, E, E, E, E, W],
        [W, W, W, W, W, W, W, W, W, W, W, W, W, W],
    ]
    return GridMap(blocks=blocks)
Beispiel #12
0
def gridmap_test_occluded():
    W = GridMap.W
    E = GridMap.E
    blocks = [
        [W, W, W],
        [W, E, E],
        [W, W, W],
    ]
    gm = GridMap(blocks=blocks)

    c = [1, 1]
    assert lineofsight(gm, c, [0, 0])
    assert lineofsight(gm, c, [1, 0])
    assert lineofsight(gm, c, [2, 0])
    assert lineofsight(gm, c, [0, 1])
    assert lineofsight(gm, c, [2, 1])
    assert lineofsight(gm, c, [1, 2])
    assert lineofsight(gm, c, [2, 2])


    assert lineofsight(gm, c, [0, 2])