Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] SUMO is encountering Fatal Error

Hello Everyone

 

I was running SUMO through TraCI to see if my simulation would run all the way through its intended simulation time of 61200 seconds of sim time, but the SUMO gui closed (or crashed – not sure) and I received these errors in both the command line/Python IDE when the simulation closed:

 

image.png

 

I am not fully sure what the issue is with TraCI or my Python code. I went to my Python code and added an if else statement to hopefully fix the issue but I still received the same error message. Does anyone know what may be occurring with my simulation? For reference, I have attached my Python script. If there is any other additional information or questions, please let me know.

 

Thank you

Ifezue

 

Sent from Mail for Windows

 

import traci
# import time
# import csv
from sumolib import checkBinary

sumoBinary = checkBinary ("sumo-gui")
sumoCmd = [sumoBinary, "-c", "test.sumocfg", "--quit-on-end", "--start"]
# sumoCmd= ([sumoBinary, "-n", "USA_Roads.net.xml", "-r", "SUMONewRoutingTest.rou.xml", "BusRoutingAlt.rou.xml", "PersonFlowTest_Red1_BASE.rou.xml",
#           "PersonFlowTest_Blue1_BASE.rou.xml", "PersonFlowTest_Blue2_BASE.rou.xml", "PersonFlowTest_Green1_BASE.rou.xml", "PersonFlowTest_Green2_BASE.rou.xml",
#           "PersonFlowTest_Yellow1_BASE.rou.xml", "PersonFlowTest_Yellow2_BASE.rou.xml","PersonFlowTest_Orange1_BASE.rou.xml", "-a", "USA_Additionals_Base.xml",
#           "--quit-on-end"])


traci.start(sumoCmd)
step = 0

# Execution for Beginning of Simulation
while step < 3600:
    if step < 3600:
        traci.simulationStep()
        step += 1
    else:
        break
    #time.sleep(1)  #Controls Speed of Simulation
    
# traci.close()

# Execution for collecting Ridership within Bus Vehicles
while step >= 3600:
    if step >= 3600:
        traci.simulationStep()
        step += 1
    
        # This set of code gets the number of riders currently within the bus
        simulation_runtime = traci.simulation.getTime()
        ridership_red = traci.vehicle.getPersonNumber("0")
        ridership_blue1 = traci.vehicle.getPersonNumber("1")
        ridership_blue2 = traci.vehicle.getPersonNumber("2")
        ridership_yellow1 = traci.vehicle.getPersonNumber("3")
        ridership_yellow2 = traci.vehicle.getPersonNumber("4")
        ridership_green1 = traci.vehicle.getPersonNumber("5")
        ridership_green2 = traci.vehicle.getPersonNumber("6")
        ridership_orange = traci.vehicle.getPersonNumber("7")
        list_of_ridership = [simulation_runtime, ridership_red, ridership_blue1, ridership_blue2, ridership_yellow1,
                            ridership_yellow2, ridership_green1, ridership_green2, ridership_orange]
    
        print(list_of_ridership)
        
    else:
        break
    
traci.close()


    

Back to the top