stall adv

This commit is contained in:
leo 2022-04-25 22:01:40 +02:00
parent 8434ba6d29
commit a820bd99e3
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB

5
Car.py
View File

@ -380,7 +380,7 @@ class Car():
# alors on accelere pour s'inserer # alors on accelere pour s'inserer
if self.distToInter > self.minSpace + dts or (tti + leader.T + marg) < ltti: if self.distToInter > self.minSpace + dts or (tti + leader.T + marg) < ltti:
self.v = min(vmax, self.v + self.a*dt) self.v = min(vmax, self.v + self.a*dt)
print(self.id, "ca passe") #print(self.id, "ca passe")
else:# sinon on freine else:# sinon on freine
self.v = max(0, self.v - self.b*dt) self.v = max(0, self.v - self.b*dt)
self.updateGraph(self.v, vmax, 0) self.updateGraph(self.v, vmax, 0)
@ -406,6 +406,9 @@ class Car():
if self.controller.t < self.startTime: if self.controller.t < self.startTime:
return return
if self.v < 1 and self.getCurrentEdge().isSpecial():
print(f"{self.id} stalled where he souldn't have")
self.leader=self.getLeader(100) self.leader=self.getLeader(100)
self.conduiteKrauss(self.vmax,self.leader,dt) self.conduiteKrauss(self.vmax,self.leader,dt)