def _generate(): for room_left, room_front, room_width, room_depth in geometry.get_divided_rooms(width, depth, partitions): yield __optimize( room_left, room_front, room_width, room_depth, work, width, depth, light, light_height, light_positions, w_top_height, w_bottom_height, front_windows, left_windows, right_windows)
def test_get_divided_rooms_10_10_5__5(self): rooms = geometry.get_divided_rooms(10, 10, [5, -5]) self.assertEqual(rooms, [(0, 0, 5, 5), (5, 0, 5, 5), (0, 5, 5, 5), (5, 5, 5, 5)])
def test_get_divided_rooms_10_10_3_6__3__6(self): rooms = geometry.get_divided_rooms(10, 10, [3, 6, -3, -6]) self.assertEqual(rooms, [(0, 0, 3, 3), (3, 0, 3, 3), (6, 0, 4, 3), (0, 3, 3, 3), (3, 3, 3, 3), (6, 3, 4, 3), (0, 6, 3, 4), (3, 6, 3, 4), (6, 6, 4, 4)])