From e8bb5ee1570841452cd8e768f3e1341995b9eb6d Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 10 May 2022 22:13:43 +0200 Subject: [PATCH] =?UTF-8?q?2nd=20mesures+jtencule=20si=20je=20suis=20deja?= =?UTF-8?q?=20ins=C3=A9r=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Car.py | 4 +-- rdpt_polytech_burst.rou.xml | 26 +++++++++++++----- rdpt_polytech_burst_2.rou.xml | 52 +++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 rdpt_polytech_burst_2.rou.xml diff --git a/Car.py b/Car.py index 9e38d47..3447cc8 100644 --- a/Car.py +++ b/Car.py @@ -55,7 +55,7 @@ class Car(): self.v=0 self.a=10 self.b=20 - self.minSpace=20 + self.minSpace=10 self.leaderBefore=False self.distToInter=0 self.timeStopped=0 @@ -421,7 +421,7 @@ class Car(): # ou si on as le temps d'arriver à l'intersection avant le leader (plus un marge pour garder un distance de sécu) # alors on accelere pour s'inserer #print(tti, leader.T, marg, ltti) - if self.distToInter > self.minSpace + dts or (tti + leader.T + marg) < ltti: + if self.distToInter > self.minSpace + dts or self.distToInter < 5 or (tti + leader.T + marg) < ltti: self.v = min(vmax, self.v + self.a*dt) #print(self.id, "ca passe") else:# sinon on freine diff --git a/rdpt_polytech_burst.rou.xml b/rdpt_polytech_burst.rou.xml index c20d5e8..5708022 100644 --- a/rdpt_polytech_burst.rou.xml +++ b/rdpt_polytech_burst.rou.xml @@ -1,40 +1,52 @@ - - - + + - - + + - - + + + + + + + + + + + + + + diff --git a/rdpt_polytech_burst_2.rou.xml b/rdpt_polytech_burst_2.rou.xml new file mode 100644 index 0000000..97f34a7 --- /dev/null +++ b/rdpt_polytech_burst_2.rou.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +