Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Inconsistency between Traci and Output File

Hi Mirko,

Thanks for your reply, but I don't think it addresses my problem (actually I have tried it). Note that both "t" and simulation time equal zero in the beginning. After calling simulationStep(), simulation time advances with one second (simulation step is one second). Thus it is reasonable to consider "t+1" instead of "t" in the if statement. 

By the way, I also reset the attribute "period" of induction loops as 1 second and called the traci methods such as inductionloop.getLastStepMeanSpeed(). I still found the inconsistent results.

Best,
Yu



Mirko Barthauer <m.barthauer@xxxxxxxxxxx> 于2023年7月24日周一 05:00写道:

Hi Yu,

 

please review your condition for calling the TraCI functions. You check for the next step, but actually you should check the current step:

 

if (t+1) % 30 == 0 # no, replace t+1 by t

 

You can call traci.simulation.getTime() to get a better understanding, too.

 

Best regards

Mirko

 

 

 

-----Original-Nachricht-----

Betreff: [sumo-user] Inconsistency between Traci and Output File

Datum: 2023-07-22T22:28:24+0200

Von: "yu tang via sumo-user" <sumo-user@xxxxxxxxxxx>

An: "Sumo project User discussions" <sumo-user@xxxxxxxxxxx>

 

 

 

Hi all,
 
I found inconsistent results from Traci and simulation outputs of induction loops. I used SUMO 1.18.0 and traci 1.18.0. My project simulates traffic for one hour, where induction loops collect flow, speed, occupancy every 30 second. Using traci, I applied inductionloop.getLastIntervalMeanSpeed(), inductionloop.getLastIntervalOccupancy(), inductionloop.getLastIntervalVehicleNumber() at time 30, 60, 90, .... Unfortunately, I found these data are slightly different from the 30-second results indicated by the xml output file; see the attached figures. Besides, I failed to replicate the results of xml output file by using other methods such as inductionloop.getIntervalMeanSpeed(). Is it a bug? For better understanding my problem, I also attach a zip file containing the simulation file and the code. 
 
Best,
Yu


Back to the top