stability fix
This commit is contained in:
parent
33d2e7ee26
commit
afe65943aa
10
Car.py
10
Car.py
@ -61,7 +61,7 @@ class Car():
|
|||||||
self.nu = 0.1
|
self.nu = 0.1
|
||||||
self.gamma = 10
|
self.gamma = 10
|
||||||
self.delta = 0
|
self.delta = 0
|
||||||
self.T = 1.3#uniform(0.9,1.6)
|
self.T = uniform(0.9,1.6)
|
||||||
self.size = 3
|
self.size = 3
|
||||||
|
|
||||||
self.vroom = 0
|
self.vroom = 0
|
||||||
@ -186,7 +186,11 @@ class Car():
|
|||||||
if prevInd < 0:
|
if prevInd < 0:
|
||||||
return None
|
return None
|
||||||
inter = self.route[edgeInd-1].getFromNode()
|
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)
|
linkInd = inter.getLinkIndex(connection)
|
||||||
if(linkInd == -1): # Ca devrait pas arriver, mais de toute évidence ça arrive
|
if(linkInd == -1): # Ca devrait pas arriver, mais de toute évidence ça arrive
|
||||||
return;
|
return;
|
||||||
@ -335,7 +339,7 @@ class Car():
|
|||||||
if self.distToInter > self.minSpace or (tti + leader.T + marg) < ltti:
|
if self.distToInter > self.minSpace or (tti + leader.T + marg) < ltti:
|
||||||
self.v = min(vmax, self.v + self.a*dt)
|
self.v = min(vmax, self.v + self.a*dt)
|
||||||
else:# sinon on s'arrete net
|
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)
|
self.updateGraph(self.v, vmax, 0)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
|
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
|
||||||
<flow id="f_0" begin="0.00" end="3600.00" vehsPerHour="1500.00">
|
<flow id="f_0" begin="0.00" end="3600.00" vehsPerHour="1500.00">
|
||||||
<param key="random" value="500"/>
|
<param key="random" value="0"/>
|
||||||
<route edges="E1 E9 E8 E7 E40"/>
|
<route edges="E1 E9 E8 E7 E40"/>
|
||||||
</flow>
|
</flow>
|
||||||
<flow id="f_1" begin="0.00" end="3600.00" vehsPerHour="1500.00">
|
<flow id="f_1" begin="0.00" end="3600.00" vehsPerHour="1500.00">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user