Inteligentny_Wozek/grid.py

25 lines
763 B
Python
Raw Normal View History

2023-05-06 18:06:30 +02:00
from enum import Enum
from typing import Tuple, Dict
class GridCellType(Enum):
FREE = 0
RACK = 1
PLACE = 2
# dodać oznaczenie na miejsce dla paczek
class SearchGrid:
grid: Dict[Tuple[int, int], GridCellType] = {}
def __init__(self) -> None:
self._init_grid()
def _init_grid(self) -> None:
for i in range (0,14):
for j in range(0,14):
self.grid[(i, j)] = GridCellType.FREE
for r, c in [(2,2), (2,3), (3,2), (3,3), (10,2), (10,3), (11,2), (11,3),
(2,8), (2,9), (3,8), (3,9), (10,8), (10,9), (11,8), (11,9),]:
self.grid[(r,c)] = GridCellType.RACK
for m, n in [(6,5), (6,6), (7,5), (7,6)]:
self.grid[(m,n)] = GridCellType.PLACE