Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different output between libsumo and taci #15460

Open
way-thu opened this issue Sep 10, 2024 · 11 comments
Open

Different output between libsumo and taci #15460

way-thu opened this issue Sep 10, 2024 · 11 comments
Assignees

Comments

@way-thu
Copy link

way-thu commented Sep 10, 2024

I may meet a confusing mistake between libsumo and traci. Specifically, I want to obtain the cumulative waiting time of a vehicle, but using libsumo and traci, I got different results. Here are the details below.

First of all, my signal control method is actuated.
image

When I use traci, the result of the vehicle is 56.0.
image
image

However, if I change traci to libsumo, the result changes to 94.0.
image
image

What makes me more puzzled is that when my signal control method is static, the results obtained are consistent. However, when I change the signal control method to actuated, the results obtained by libsumo and traci will deviate. I don't know where the problem lies for the time being.

I hope to hear your reply, thanks for your help.

**SUMO-version: 1.18.0
**libsumo-version: 1.20
**operating system: windows

@namdre
Copy link
Contributor

namdre commented Sep 10, 2024

Results may change between versions due to bug fixes, so a difference in behavior between versions is not unexpected.
Your logging output also shows situations that are 48s apart in time. A vehicle that has accumulated 56s of waiting time may well have 94s accumulated waiting time at this later point (if it remains stationary for 38 out of 48s).

To compare two scenarios between versions, it is helpful to compare fcd-output and also traffic light output (https://sumo.dlr.de/docs/Simulation/Output/Traffic_Lights.html)

@way-thu
Copy link
Author

way-thu commented Sep 10, 2024

In fact, this vehicle will only stop once (because there is only one traffic light). To be precise, when using Traci, the vehicle completes its journey at time 113.5 and then disappears. However, when using libsumo, the vehicle continues until 151.5 seconds and also waits for a longer time.

@way-thu
Copy link
Author

way-thu commented Sep 10, 2024

I'm not sure if this is a version issue, but if you have time, you could give it a try and fix it.

@way-thu
Copy link
Author

way-thu commented Sep 10, 2024

I further checked my version and I found that both traci and libsumo are 1.20.0. As mentioned above, this seems to be related to the signal control method. When using static control, there doesn't seem to be an error, but when switching to actuated, the above error occurs.

@namdre
Copy link
Contributor

namdre commented Sep 10, 2024

Here is a description of what an error report needs to include to be actionable: https://sumo.dlr.de/docs/FAQ.html#how_do_i_report_erroneous_behavior_of_a_sumo_application

@way-thu
Copy link
Author

way-thu commented Sep 11, 2024

problems.zip
@namdre Hello, I upload the problems I meet, I hope to hear your reply.

@namdre
Copy link
Contributor

namdre commented Sep 11, 2024

On my system, both of your scripts return the same output.
My best guess is, that one of the scripts picks up the library from SUMO_HOME (version 1.18.0) and the other one picks the installed version (1.20.0).
For debugging, see https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html#determine_the_traci_library_being_loaded

@way-thu
Copy link
Author

way-thu commented Sep 11, 2024

image
image
I modified the import paths for traci and libsumo, but the results I'm getting are still different. Is there something wrong with what I'm doing?

@namdre
Copy link
Contributor

namdre commented Sep 11, 2024

Please check the path of the actually loaded modules as described in my link.

@way-thu
Copy link
Author

way-thu commented Sep 11, 2024

Sorry for my bad understanding, I still not solve it.
Is it possible that the issue arises because the version of libsumo I am using is 1.20, while the SUMO version is 1.18.0? Could the inconsistency between the versions of libsumo and SUMO cause this problem?

@namdre
Copy link
Contributor

namdre commented Sep 12, 2024

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants