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

setScale value is not used in flows #13707

Closed
YDLin9784 opened this issue Aug 14, 2023 · 5 comments
Closed

setScale value is not used in flows #13707

YDLin9784 opened this issue Aug 14, 2023 · 5 comments
Assignees
Milestone

Comments

@YDLin9784
Copy link

Hi all,

I am trying to use traci.vehicleType.setScale() to manipulate the density of my flow. so I has this piece of code in my .py:
image
That returns "100.0" as the scale, in the meanwhile in my route file I have this :
image
but when I run simulations, the flow "hdv" is still having 12 vehicles instead of 1,200 as I expected.
I tried other traci.vehicleType command, seems they are all working except this one.

Any help would be appreciated!

@m-kro
Copy link
Contributor

m-kro commented Aug 14, 2023

You have discovered a bug. Getters and setters were implemented in #10161 but the scale value is not checked for updates after the simulation has been initialised. So currently it is not possible but we will fix that.

@YDLin9784
Copy link
Author

Hi,

thank you for your information!

Just a follow up question if you don’t mind. Are there other ways to change the flow capacity from the code like the setScale function? I am trying to run multiple simulations with different vehsPerHour of flows.

@m-kro
Copy link
Contributor

m-kro commented Aug 14, 2023

It may be a bit cumbersome but you can always replicate flows yourself by adding single vehicles (traci.vehicle.add). But you are probably better off waiting for the bug fix (expected for today).

@m-kro m-kro added this to the 1.19.0 milestone Aug 14, 2023
@m-kro m-kro self-assigned this Aug 14, 2023
m-kro added a commit that referenced this issue Aug 14, 2023
Signed-off-by: m-kro <m.barthauer@t-online.de>
@m-kro
Copy link
Contributor

m-kro commented Aug 14, 2023

@YDLin9784 I added the fix to the repository, Either build SUMO from fresh Github source or wait for development version binaries of tomorrow.

@m-kro m-kro changed the title setScale doesn't change the density of flow setScale value is not used in flows Aug 14, 2023
@YDLin9784
Copy link
Author

Thank you for the quick response!

@m-kro m-kro closed this as completed Aug 15, 2023
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

2 participants