detect rof in internal
This commit is contained in:
parent
9d38c3afab
commit
d7dd8e2fa2
10
Car.py
10
Car.py
@ -168,15 +168,15 @@ class Car():
|
||||
if(ind == -1):
|
||||
continue
|
||||
conn[ind] = c
|
||||
cars = None
|
||||
cars = []
|
||||
for i,f in enumerate(reversed(resp)):
|
||||
if(f == '0'):
|
||||
continue
|
||||
edge = conn[i].getFrom()
|
||||
cars = self.controller.getCarsOnLane(edge.getID(), conn[i].getFromLane().getIndex())
|
||||
if(cars is None):
|
||||
return
|
||||
cars = list(cars)
|
||||
cars += list(self.controller.getCarsOnLane(edge.getID(), conn[i].getFromLane().getIndex())) # doit y avoir moyen de le faire en gardant les filters, flemme
|
||||
intLane = self.map.getLane(conn[i].getViaLaneID())
|
||||
intEdge = intLane.getEdge()
|
||||
cars += list(self.controller.getCarsOnLane(intEdge.getID(), intLane.getIndex()))
|
||||
if(len(cars) == 0):
|
||||
return None
|
||||
return cars[0] # TODO: récuperer la voiture la plus proche au lieu d'un au hasard
|
||||
|
Loading…
x
Reference in New Issue
Block a user