Example #1
0
# create a wall
b = 18.5
door_width = 2  # in meters
wall_right = Wall(b, door_width)
wall_left = Wall(0, 0)
wall_up = Wall(room_length, 0)
wall_down = Wall(0, 0)

p_i_range = (0.9, 1)
Rv_range = (
    100,
    101,
)  # this means everyone knows where is the exit and do not follow others.
p_list, circle_list = create_people(
    100, room_width, room_length, wall_right.get_pos(), p_i_range, Rv_range
)


def init():
    """
    init() function serves to setup the plot for animating:
        1. create the first frame to display
    """
    for c in circle_list:
        ax.add_patch(c)
    # add door representation
    p_lower = (
        wall_right.door_pos[0][0] - 0.1,
        wall_right.door_pos[0][1],
    )  # door thickness = 10cm
Example #2
0
# create a wall
b = 18.5
door_width = 2  # in meters
wall_right = Wall(b, door_width)
wall_left = Wall(0, 0)
wall_up = Wall(room_length, 0)
wall_down = Wall(0, 0)

p_i_range = (0.9, 1)
Rv_range = (
    3,
    5,
)  # this means everyone knows where is the exit and do not follow others.
p_list, circle_list = create_people(100, room_width, room_length,
                                    wall_right.get_pos(), p_i_range, Rv_range)


def init():
    """
    init() function serves to setup the plot for animating:
        1. create the first frame to display
    """
    for c in circle_list:
        ax.add_patch(c)
    # add door representation
    p_lower = (
        wall_right.door_pos[0][0] - 0.1,
        wall_right.door_pos[0][1],
    )  # door thickness = 10cm
    rectangle = plt.Rectangle(p_lower, 0.1, wall_right.door_width)