Class cell represents a cell in the world which have the properties: position: represented by tuple of x and y coordinates initially set to (0,0). parent: Contains the parent cell object visited before we arrived at this cell. g, h, f: Parameters used when calling our heuristic func
| 17 | |
| 18 | |
| 19 | class Cell: |
| 20 | """ |
| 21 | Class cell represents a cell in the world which have the properties: |
| 22 | position: represented by tuple of x and y coordinates initially set to (0,0). |
| 23 | parent: Contains the parent cell object visited before we arrived at this cell. |
| 24 | g, h, f: Parameters used when calling our heuristic function. |
| 25 | """ |
| 26 | |
| 27 | def __init__(self): |
| 28 | self.position = (0, 0) |
| 29 | self.parent = None |
| 30 | self.g = 0 |
| 31 | self.h = 0 |
| 32 | self.f = 0 |
| 33 | |
| 34 | """ |
| 35 | Overrides equals method because otherwise cell assign will give |
| 36 | wrong results. |
| 37 | """ |
| 38 | |
| 39 | def __eq__(self, cell): |
| 40 | return self.position == cell.position |
| 41 | |
| 42 | def showcell(self): |
| 43 | print(self.position) |
| 44 | |
| 45 | |
| 46 | class Gridworld: |
no outgoing calls
no test coverage detected