From a820bd99e36a5fd0f1a8e5883920f84c0c76c3be Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Apr 2022 22:01:40 +0200 Subject: [PATCH] stall adv --- Car.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Car.py b/Car.py index c3995c1..b176d3d 100644 --- a/Car.py +++ b/Car.py @@ -380,7 +380,7 @@ class Car(): # alors on accelere pour s'inserer if self.distToInter > self.minSpace + dts or (tti + leader.T + marg) < ltti: self.v = min(vmax, self.v + self.a*dt) - print(self.id, "ca passe") + #print(self.id, "ca passe") else:# sinon on freine self.v = max(0, self.v - self.b*dt) self.updateGraph(self.v, vmax, 0) @@ -406,6 +406,9 @@ class Car(): if self.controller.t < self.startTime: 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.conduiteKrauss(self.vmax,self.leader,dt)