Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] [WinError 10061]

Hello to all

My basic simulation code is written below. While I am running the same code
without restarting the Kernel, the following error message pops up.

*Could not connect to TraCI server at localhost:57376 [WinError 10061] No
connection could be made because the target machine actively refused it*

Due to this error message, I am unable to run the code in the loop. I also
checked for the firewall. There is nothing except "Windows Defender" which I
do not want to close. Is there any mistake in the code that I can rectify?


/import os, sys
if 'SUMO_HOME' in os.environ:
    tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
    sys.path.append(tools)
    shapes = os.path.join(os.environ['SUMO_HOME'], 'tools','sumolib',
'shapes')
    sys.path.append(shapes)
else:
     sys.exit("please declare environment variable 'SUMO_HOME'")

import time
import random

start_time=time.time() 
#traci.vehicle.subscribe(vehID, (tc.VAR_ROAD_ID, tc.VAR_LANEPOSITION))
#print(traci.vehicle.getSubscriptionResults(vehID))

sumoBinary = "C:\Program Files (x86)/Eclipse/Sumo/bin/sumo-gui"
sumoCmd = [sumoBinary, "-c", "roundabout-1.sumocfg", "--start"]

for i in range (5):
    
    random.seed()

    
    import traci

    #traci.start(sumoCmd,traceFile="traci.log")
    traci.start(sumoCmd)
    print("Starting SUMO")
    
    traci.gui.setSchema("View #0", "real world")
    
    traci.gui.setZoom("View #0", 190)


    vehID = traci.vehicle.getIDList();
    lights=traci.trafficlight.getIDList();
    
    junctionID=traci.junction.getIDList();
    
            
    South_Light='1886728151'
    North_Light='2273469505'
    West_Light='268032054'
    East_Light='454336319'
    
    print ("Simulation has been started")
    
    traci.trafficlight.setProgram(East_Light,1)
    
    
    for step in range(5400):
        traci.simulationStep()
                
    traci.close(sumoCmd)
    
print ("finish",'\n')
/



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/


Back to the top