From 1f1212c464879058bd0f6efce96392221c81ed86 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 13 May 2022 00:33:29 +0200 Subject: [PATCH] fix IA --- Car.py | 4 +- rdpt_polytech_burst_2_shortcut.rou.xml | 12 +-- rdpt_polytech_shortcut.net.xml | 130 ++++++++++++++----------- 3 files changed, 81 insertions(+), 65 deletions(-) diff --git a/Car.py b/Car.py index 06f73ce..8a14647 100644 --- a/Car.py +++ b/Car.py @@ -434,7 +434,9 @@ class Car(): vb = (vleader + self.v) / 2 bb = (bleader + self.b) / 2 - vsec = vleader + (self.leaderDist - vleader * self.T - self.minSpace)/((vb/bb) + self.T) if vb != 0 else vleader + if vb == 0: + vb = bb + vsec = vleader + (self.leaderDist - vleader * self.T - self.minSpace)/((vb/bb) + self.T) vd = min(self.v + self.a * dt, vsec, vmax) self.v = max(0, vd-self.nu) self.updateGraph(self.v, vmax, vsec) diff --git a/rdpt_polytech_burst_2_shortcut.rou.xml b/rdpt_polytech_burst_2_shortcut.rou.xml index 2fdbb62..de932f4 100644 --- a/rdpt_polytech_burst_2_shortcut.rou.xml +++ b/rdpt_polytech_burst_2_shortcut.rou.xml @@ -1,13 +1,13 @@ - - + @@ -22,17 +22,17 @@ - + - + - + @@ -42,7 +42,7 @@ - + diff --git a/rdpt_polytech_shortcut.net.xml b/rdpt_polytech_shortcut.net.xml index 056539f..47ba40c 100644 --- a/rdpt_polytech_shortcut.net.xml +++ b/rdpt_polytech_shortcut.net.xml @@ -1,10 +1,10 @@ -