Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-dev] [sumo-devel] help

Thanks. But, I have runned the SUMO
simulation and the traci script  in the same local computer and i have
allways the same error. What shall I do?
Thanks.

Le mar. 3 avr. 2018 à 09:58, Jakob Erdmann <namdre.sumo@xxxxxxxxxxxxxx> a
écrit :

> Hello,
>
> traci.start() assumes that sumo will be started by the script on the local
> computer (it picks a random free port for that).
> If the traci client is on a different computer from the sumo simulation
> you must take these steps
> - select a port number (i.e. 9000)
> - start the simulation on one computer (assume this is called 'computer1')
> by calling sumo with option --remote-port 9000
> - in the traci client script call traci.init(port=9000, host="computer1")
>
> regards,
> Jakob
>
> 2018-04-01 23:14 GMT+02:00 Sagaama Insaf <sagaama.insaf@xxxxxxxxx>:
>
>> Dear all,
>> I want to make each vehicle in SUMO receives a TCP packet from an
>> external Server.
>>
>> I have implemented this  Python Script :
>> *import traci*
>> *traci.start(sumoCmd) *
>>
>> *while traci.simulation.getMinExpectedNumber() > 0: *
>> *  for veh_id in traci.vehicle.getIDList():*
>> *    position = traci.vehicle.getSpeed(veh_id)*
>> *    print(veh_id)*
>> *    print(traci.vehicle.getRoute(veh_id))*
>> *    traci.vehicle.setRoute("veh0", ["44468929", "189216027",
>> "371230575", "167920445"])*
>> * traci.close()*
>> *sys.stdout.flush()*
>>
>> This error is raising :
>> Could not connect to TraCI server at localhost:57613 [Errno 10061] No
>> connection could be made because the target machine actively refused it
>>  Retrying in 1 seconds
>> What is the problem ? Can you help me please ?
>>
>> Thanks.
>>
>>
>>
>>
>> --
>> ​
>> My Best Regards,
>> SAGAAMA Insaf.
>>
>> PhD student at CRISTAL Lab, RAMSIS Pole, ENSI- Tunisia.
>>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sumo-devel mailing list
sumo-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sumo-devel

Back to the top