Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Fatal Error during vehicle Refueling using TraCI

Just checking but are you asking me to essentially build a state machine in Python, I am just trying to understand what seems to be missing in my code. If so, how do you go about building states in Python as a beginner? Any tips?

On Tue, Oct 26, 2021, 3:29 PM Ifezue Obiako <vincentobiako@xxxxxxxxx> wrote:
Harald

I am a little confused. Is the 'for loop' the issue and I need to make refuel commands for each of the simulated vehicles? Or are you saying that I need to leave the 'for loop' and make a 'running', 'goingToCharge', 'Charging' function in Python with TraCI?

On Tue, Oct 26, 2021 at 1:01 PM Harald Schaefer <fechsaer@xxxxxxxxx> wrote:

Hi Ifezue,

you should put the traci call at line 65 (actualFuelLevel = traci.vehicle.getParameter(e, "device.battery.actualBatteryCapacity") ) also in a try block, because at about 28000 secs Vehicle 0 disappears

You should issue the rerouting command only once. Create a state for each vehicle ('running', 'goingToCharge', 'Charging'). Send cars only to Charging if they are in state running, then put them in state 'goingToCharge' etc,

Regards, Harald

Am 26.10.21 um 16:35 schrieb vincentobiako:

Thanks for the response Harald. The arguments I used for the Python script look something like this:

 

python compute-pass-per-vehicle-with-sumo_3b.py -f 3600 -l 60000 -v 0 1 2 3 4 5 6 7 -g True -- -c test.sumocfg

 

-f 3600

-l 60000

-v 0 1 2 3 4 5 6 7

-g True

--

-c test.sumocfg

 

I ran the scenario in the sumo gui rather than in sumo to see how some of the vehicles in the simulation were behaving based on the commands in the Python script. That may be why the vehicles are teleporting when you run it in plain sumo as opposed to giving you a fatal error (as seen when you run in sumo gui).

 

Sent from Mail for Windows

 

From: Harald Schaefer
Sent: Tuesday, October 26, 2021 8:30 AM
To: sumo-user@xxxxxxxxxxx
Subject: Re: [sumo-user] Fatal Error during vehicle Refueling using TraCI

 

Hi Ifezue,

please provide also the arguments for the python script or add a simple run.bat file, which just calls compute-pass-per-vehicle-with-sumo_3b.py with the correct parameters

Running a program with traci is always slower than without.

If I run your scenario with plain sumo, I see that buses 3 and 4 are teleported:


Warning: Teleporting vehicle '3'; waited too long (wrong lane), lane='374986789.109.16_1', time=5435.00.
Warning:
Vehicle '3' ends teleporting on edge '374986789.138', time 5435.00.
Warning: Teleporting
vehicle '4'; waited too long (wrong lane), lane='374986789.109.16_1', time=34896.00.
Warning:
Vehicle '4' ends teleporting on edge '374986789.138', time 34896.00.
Warning: Teleporting
vehicle '4'; waited too long (wrong lane), lane='374986789.109.16_1', time=53365.00.
Warning:
Vehicle '4' ends teleporting on edge '374986789.138', time 53365.00.

If you have still trouble or fatal errors, please provide the scenario with the calling parameters, so I can reproduce your error.

Harald

Am 23.10.21 um 00:57 schrieb vincentobiako:

Hello Everyone

 

I have a simulation with buses that are running on multiple routes and when each bus reaches a certain fuel capacity and a bus capacity equal to 0, they are required to begin the process of refueling by going to a charging station. I have been able to get the vehicles to move to their recharging station when two conditions are met but once they get to the station and begin recharging they all seem to get stuck on the same lane or charging location and the SUMO gui crashes and I get a Fatal Error message in my command prompt.

 

I have tried shortening the charging delay and actual charging duration that each bus spends in the process of refueling or recharging to see if that will prevent the Fatal Error from occurring and allow the buses to move on to their next bus stop, but I keep getting a Fatal Error message. Another thing I noticed when I was doing this is that the simulation in the GUI seemed to run significantly slower than normal for some reason and I am not sure why.

 

Does anyone know why I am getting a Fatal Error message and how I can get the buses to refuel and then move on with rest of their bus routes after they are done refueling/recharging? Also, why is my simulation running slow when I execute my code in TraCI?

 

I have attached my testing files for reference.

 

Thank you

Ifezue

 

Sent from Mail for Windows

 



_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

 


_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top