Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] two clients, one SUMO connection (python - TraCI)

When the sumo gui has been started, it is waiting for the second client to connect. Note that you have to call setOrder for all clients and to call simulationStep for each client to proceed with the simulation

 

e.g. for the second client:

 

traci.init(port=xxxx, label="sim2")

conn2 = traci.getConnection("sim2")

conn2.setOrder(2)

 

step = 0

while step < 1000:

    conn2.simulationStep()

    step += 1

 

conn2.close()

 

Von: sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx] Im Auftrag von ratzenmeier@xxxxxx
Gesendet: Donnerstag, 20. Dezember 2018 14:22
An: sumo-user@xxxxxxxxxxx
Betreff: Re: [sumo-user] two clients, one SUMO connection (python - TraCI)

 

thanks for the information Jakob!

 

So I implemented it, but when I start my runner script, it opens my sumo-gui as usually, but it's only displaying "starting server on port xxxx" and nothing happens, just loading. When I'm changing the --num-clients in the traci.start to "1" it starts normally.

 

Any ideas?

 

Greetings

 

Gesendet: Donnerstag, 20. Dezember 2018 um 11:31 Uhr
Von: "Jakob Erdmann" <namdre.sumo@xxxxxxxxx>
An: "Sumo project User discussions" <sumo-user@xxxxxxxxxxx>
Betreff: Re: [sumo-user] two clients, one SUMO connection (python - TraCI)

 

Am Do., 20. Dez. 2018 um 10:52 Uhr schrieb <ratzenmeier@xxxxxx>:

Hello everyone,

 

so i'm new to SUMO and want to connect two different clients (both python scripts, Interface: TraCI) to the same SUMO connection. 

How can I do that exactly? I read about the simulationSteps from the post yesterday, but I can't manage to implement it.

 

Thanks a lot.

 

Greetings!

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

_______________________________________________ sumo-user mailing list sumo-user@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user


Back to the top