def generate_room(self, section):

        middle_height = section_height(section) // 2
        middle_width = section_width(section) // 2

        if len([x for x in section_connections(section)
                if x.direction == 'right']) > 0:
            room_left_edge = self.rng.randint(2, middle_width - 2)
        else:
            room_left_edge = 1

        if len([x for x in section_connections(section)
                if x.direction == 'left']) > 0:
            room_right_edge = self.rng.randint(middle_width + 2,
                                               section_width(section) - 2)
        else:
            room_right_edge = section_width(section) - 1

        if len([x for x in section_connections(section)
                if x.direction == 'down']) > 0:
            room_top_edge = self.rng.randint(2, middle_height - 2)
        else:
            room_top_edge = 1

        if len([x for x in section_connections(section)
                if x.direction == 'up']) > 0:
            room_bottom_edge = self.rng.randint(middle_height + 2,
                                                section_height(section) - 2)
        else:
            room_bottom_edge = section_height(section) - 1

        for loc_y in range(room_top_edge + 1, room_bottom_edge):
            for loc_x in range(room_left_edge + 1, room_right_edge):
                section_floor(section, (loc_x, loc_y), self.floor_tile, 'room')
                section_wall(section, (loc_x, loc_y), self.empty_tile, None)

        center_x = (room_right_edge - room_left_edge) // 2 + room_left_edge
        center_y = (room_bottom_edge - room_top_edge) // 2 + room_top_edge

        add_room_connection(section, (center_x, room_top_edge), "up")
        add_room_connection(section, (center_x, room_bottom_edge), "down")
        add_room_connection(section, (room_left_edge, center_y), "left")
        add_room_connection(section, (room_right_edge, center_y), "right")

        self.add_corridors(section)

        self.room_corners = []
        self.room_corners.append((room_left_edge + 1, room_top_edge + 1))
        self.room_corners.append((room_right_edge - 1, room_top_edge + 1))
        self.room_corners.append((room_right_edge - 1, room_bottom_edge - 1))
        self.room_corners.append((room_left_edge + 1, room_bottom_edge - 1))

        self.add_rows()
Stops all child threads and activities and closes associated
dataset/ETHPy150Open tuturto/pyherc/src/pyherc/generators/level/room/squareroom.py/SquareRoomGenerator.generate_room--crossover with--dataset/ETHPy150Open osrg/ryu/ryu/services/protocols/bgp/base.py/Activity.stop