Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Traci multiple consecutive simulation run

Hi,

for me the following structure works

The function runs handles one simulation, it calls traci start at the begin and at the end traci.close

The run function is called in a loop

Do you get the error at the first or the second simulation run?

> egrep -n "run|traci.[sc]" */*1c.py
315:def run(seed, gui = False, endTime = 60000):
344:  traci.start(sumoCmd)
348:  while traci.simulation.getMinExpectedNumber() > 0:
349:    traci.simulationStep()
382:  traci.close()

385:  for seed in range(10):

386:    run(seed, args.gui, args.last)

Regards, Harald


Am 28.06.22 um 15:32 schrieb Pearla Hajjar:
Thank you for your reply. I tried them but i have the following problems.

In my main function I am calling the run function that takes my input parameters and starts the simulation.
I have defined a stopping condition that if there is no more passengers to be served, the simulation ends.

When i use traci.start in the for loop in the main and call the run function, none of the choices are working for relaunching the simulation.

Regards, 

Perla HAJJAR

Ph.D Student- Universite de Versailles SQ and Communauté d’Agglomération de Saint Quentin en Yvelines

Direction des Mobilités- Navettes autonomes 


From: sumo-user <sumo-user-bounces@xxxxxxxxxxx> on behalf of Jakob Erdmann <namdre.sumo@xxxxxxxxx>
Sent: Tuesday, June 28, 2022 11:22:46 AM
To: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Subject: Re: [sumo-user] Traci multiple consecutive simulation run
 
Either:
traci.start()
traci.close()
traci.start()
traci.close()
...

or
traci.start()
traci.load()
traci.load()
....

Am Di., 28. Juni 2022 um 11:19 Uhr schrieb Pearla Hajjar <pearlahajjar@xxxxxxxxxxx>:
Hello,

I am trying to simulate many consecutive sumo runs with different inputs automatically i.e. when the first simulation ends, it will start the other simulation from the input of the for loop.

I don't care to run the simulation in gui, I just need the output files of every simulation.

I tried using traci.load but I get the following error:
File "C:\Users\hajjar.p\PycharmProjects\SUMO SA\Stopping cond.py", line 178, in <module>
    traci.load(["-c", "Sumo_SA_Conf.sumocfg", "--vehroute-output", "vehroute.xml", "--tripinfo-output",
  File "C:\Program Files (x86)\Eclipse\Sumo\tools\traci\main.py", line 190, in load
    raise FatalTraCIError("Not connected.")
traci.exceptions.FatalTraCIError: Not connected.

Your help is much appreciated.
Thank you in advance.
Regards,

Perla HAJJAR

Ph.D Student- Universite de Versailles SQ and Communauté d’Agglomération de Saint Quentin en Yvelines

Direction des Mobilités- Navettes autonomes 

_______________________________________________
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