diff --git a/Car.py b/Car.py index 9ade0fe..4d93845 100644 --- a/Car.py +++ b/Car.py @@ -61,7 +61,7 @@ class Car(): self.nu = 0.1 self.gamma = 10 self.delta = 0 - self.T = 1.3#uniform(0.9,1.6) + self.T = uniform(0.9,1.6) self.size = 3 self.vroom = 0 @@ -186,7 +186,11 @@ class Car(): if prevInd < 0: return None inter = self.route[edgeInd-1].getFromNode() - connection = self.route[prevInd].getConnections(self.route[edgeInd])[0] + connections = self.route[prevInd].getConnections(self.route[edgeInd]) + if(len(connections)==0): + print("aaaaaaaaa") + return + connection = connections[0] linkInd = inter.getLinkIndex(connection) if(linkInd == -1): # Ca devrait pas arriver, mais de toute évidence ça arrive return; @@ -335,7 +339,7 @@ class Car(): if self.distToInter > self.minSpace or (tti + leader.T + marg) < ltti: self.v = min(vmax, self.v + self.a*dt) else:# sinon on s'arrete net - self.v = 0 + self.v = 0#max(0, self.v - self.b*dt) self.updateGraph(self.v, vmax, 0) return diff --git a/test16.rou.xml b/test16.rou.xml index a70a250..b6c0416 100644 --- a/test16.rou.xml +++ b/test16.rou.xml @@ -5,7 +5,7 @@ - +