| 22 | self.outOfAoI: dict[str, Vehicle] = {} |
| 23 | |
| 24 | def getRoadGraph(self) -> tuple[set[str]]: |
| 25 | ex, ey = self.localPos.x, self.localPos.y |
| 26 | currGeox = int(ex // 100) |
| 27 | currGeoy = int(ey // 100) |
| 28 | |
| 29 | sceGeohashIDs = ( |
| 30 | (currGeox-1, currGeoy-1), |
| 31 | (currGeox, currGeoy-1), |
| 32 | (currGeox+1, currGeoy-1), |
| 33 | (currGeox-1, currGeoy), |
| 34 | (currGeox, currGeoy), |
| 35 | (currGeox+1, currGeoy), |
| 36 | (currGeox-1, currGeoy+1), |
| 37 | (currGeox, currGeoy+1), |
| 38 | (currGeox+1, currGeoy+1), |
| 39 | ) |
| 40 | |
| 41 | edges: set = set() |
| 42 | juncs: set = set() |
| 43 | |
| 44 | for sgh in sceGeohashIDs: |
| 45 | try: |
| 46 | geohash = self.netInfo.geoHashes[sgh] |
| 47 | except KeyError: |
| 48 | continue |
| 49 | edges = edges | geohash.edges |
| 50 | juncs = juncs | geohash.junctions |
| 51 | |
| 52 | return edges, juncs |
| 53 | |
| 54 | def updateScene(self, dataQue: Queue, timeStep: int): |
| 55 | NowTLs = {} |