[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] TraCI quits on "Error: bad allocation"
|
I have experimented some more with my code to find the issue.
I feel like I have found the problem but I am not 100% sure.
My SUMO config has the following parameters at the start of the simulation:
*<routing>
<device.rerouting.probability value="1.0"/>
<device.rerouting.period value="300"/>
</routing>*
During the simulation I am trying to "turn off" the rerouting device for
some vehicles so I used the following TraCI function:
*traci.vehicle.setParameter(vid, "device.rerouting.period", "0")*
It seems that setting it to 0 somehow causes the unexpected error.
When I changed it to
*traci.vehicle.setParameter(vid, "device.rerouting.period", "99999")*
everything seems to be working fine but the desired behavior (prevent
dynamic rerouting for specific vehicles) is not happening anymore!
It seems that setting "device.rerouting.period" to a different value has no
effect because I can see in the "vehroute-output" that vehicles are still
being rerouting by the device with the initial period value.
Here is an example:
This is a snippet of my code for rerouting:
*# Do some travel time adaptation to some edges
...
traci.vehicle.rerouteTraveltime(vid, False)
# Disable rerouting through the rerouting device so that vehicle will stay
on this route
traci.vehicle.setParameter(vid, "device.rerouting.period", "99999")*
In the "vehroute-output" I still see the following (note the attributes
"reason" and "replacedAtTime"):
*<vehicle id="106840401_5" depart="120.00" color="red" arrival="750.00"
routeLength="6181.50">
<routeDistribution>
<route cost="528.38" savings="0.00" replacedOnEdge="-8590558"
reason="traci:rerouteTraveltime" replacedAtTime="121.00" probability="0"
edges="..."/>
<route cost="606.71" savings="899819.02" replacedOnEdge="-4409396#2"
reason="device.rerouting" replacedAtTime="420.00" probability="0"
edges="..."/>
<route cost="287.47" savings="75.74" edges="..."/>
</routeDistribution>
</vehicle>*
I thought this would work based on the documentation I read here:
https://sumo.dlr.de/docs/Demand/Automatic_Routing.html#traci
Is there a different/recommended way for disabling periodic rerouting for
specific vehicles?
Thank you very much!
Best regards
Marcel
--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/