Add flag auto_color flag to SumoParams and disable coloring if flag is off.#849
Add flag auto_color flag to SumoParams and disable coloring if flag is off.#849AboudyKreidieh merged 7 commits intomasterfrom
Conversation
Pull Request Test Coverage Report for Build 5265
💛 - Coveralls |
|
It seems like auto_color_vehicles is unnecessary and likely to cause confusion. Why not just leave default coloring on and override it if a color is specified? |
|
Otherwise, great minds think alike: #848 |
flow/core/params.py
Outdated
| if color: | ||
| type_params['color'] = color |
There was a problem hiding this comment.
This works?! That's amazing!
|
We're gonna end up in a situation here where one feature ( |
|
This is an improvement on my PR, but, I think we can just remove auto_color_vehicles completely and just override it if and only if a color is provided. |
|
you'd have to check if any inflow, vehicle, or route has a color defined before overriding, which is pretty cumbersome. I want to avoid setting the color every step if possible though, because it can cause flashing and that looks pretty bad |
|
Or you can just have color default to None and if it's None you don't override. Or something of that sort. |
|
Some mechanism is needed, expecting people to remember to set auto_color_vehicles to false when you add colors will cause a lot of confusion,. |
flow/core/kernel/vehicle/traci.py
Outdated
| try: | ||
| # color rl vehicles red | ||
| self.set_color(veh_id=veh_id, color=RED) | ||
| if force_update or 'color' not in self.type_parameters[self.get_type(veh_id)]: |
There was a problem hiding this comment.
Please add one comment explaining this line. It's the one thing that's confusing
flow/core/kernel/vehicle/traci.py
Outdated
| try: | ||
| color = CYAN if veh_id in self.get_observed_ids() else WHITE | ||
| self.set_color(veh_id=veh_id, color=color) | ||
| if force_update or 'color' not in self.type_parameters[self.get_type(veh_id)]: |
|
@eugenevinitsky and @AboudyKreidieh made it a lil cleaner, lmk |
Pull request information
Description
Added check in traci_kernel to turn off auto_coloring (for sumo). This allows us to specify custom colors for vehicle types, inflows, and routes.
i.e.

Colors can be set via:

or