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

Improving Traffic Light Tutorial #642

Merged
merged 39 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a821c9a
Merge branch 'ashkan-development'
ashkan-software Mar 11, 2019
eefdb58
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Mar 19, 2019
eb95be5
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Mar 28, 2019
804b229
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Apr 4, 2019
92d142b
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Apr 18, 2019
4324cab
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Apr 23, 2019
1c1c284
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software May 7, 2019
6e40d09
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software May 13, 2019
ed26471
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software May 19, 2019
4c299ca
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software May 24, 2019
a30d153
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software May 27, 2019
6e42d67
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Jun 3, 2019
7b0321a
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Jun 5, 2019
9ea46cb
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Jun 9, 2019
ab2198e
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Jun 11, 2019
5717e86
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Jun 12, 2019
87cf3c8
Remove 'bin' from SUMO_HOME
ashkan-software Jun 13, 2019
4aa3954
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Jun 21, 2019
fecd85f
Change the intriduction paragraphs
ashkan-software Jun 29, 2019
4db1196
Revised the Section 2
ashkan-software Jul 1, 2019
04b8b5c
Update Section 3 of the tutorial
ashkan-software Jul 1, 2019
9921ac1
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Jul 7, 2019
dd64a1c
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Jul 8, 2019
9e90506
Fixed minor typo in readme
ashkan-software Jul 8, 2019
fab43d2
Reorder the ordering of the sections
ashkan-software Jul 8, 2019
30d2456
Revised section 3 (static tl) and section 4 (actualted tl)
ashkan-software Jul 8, 2019
c897095
Revised Section 5 (actuated baseline)
ashkan-software Jul 8, 2019
70a78d9
Revised "Controlling Your Traffic Lights via RL"
ashkan-software Jul 9, 2019
d9fc018
Revised the wording of observation and action space
ashkan-software Jul 9, 2019
4a72e81
Added reward and Apply RL actions
ashkan-software Jul 17, 2019
e45940e
Added function avg_delay_specified_vehicles
ashkan-software Jul 22, 2019
3b36cc1
Revert the changes. Going to add this as a new PR
ashkan-software Jul 22, 2019
4b19aff
Merge branch 'master' of https://github.com/flow-project/flow into as…
AboudyKreidieh Aug 2, 2019
b7f126c
fix typos, thanks to Eugene
ashkan-software Aug 12, 2019
9793f8e
Merge branch 'ashkan-development' of https://github.com/flow-project/…
ashkan-software Aug 12, 2019
df40521
Merge branch 'master' of https://github.com/flow-project/flow
ashkan-software Aug 18, 2019
7e400ce
Addressed Eugene's comments
ashkan-software Aug 20, 2019
4c8aab6
Last change
ashkan-software Aug 20, 2019
dd8f721
Merge branch 'master' into ashkan-development
ashkan-software Aug 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ See [our website](https://flow-project.github.io/) for more information on the a

# Technical questions

Please direct your techincal questions to [Stack Overflow](https://stackoverflow.com) using the [flow-project](https://stackoverflow.com/questions/tagged/flow-project) tag.
Please direct your technical questions to [Stack Overflow](https://stackoverflow.com) using the [flow-project](https://stackoverflow.com/questions/tagged/flow-project) tag.

# Getting involved

Expand Down
10 changes: 6 additions & 4 deletions flow/envs/green_wave_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ def _apply_rl_actions(self, rl_actions):
rl_mask = [int(x) for x in list('{0:0b}'.format(rl_actions))]
rl_mask = [0] * (self.num_traffic_lights - len(rl_mask)) + rl_mask
else:
# convert values less than 0.0 to zero and above to 1. 0's indicate
# that we should not switch the direction
# convert values less than 0 to zero and above 0 to 1. 0 indicates
# that should not switch the direction, and 1 indicates that switch
ashkan-software marked this conversation as resolved.
Show resolved Hide resolved
# should happen
rl_mask = rl_actions > 0.0

for i, action in enumerate(rl_mask):
Expand Down Expand Up @@ -690,8 +691,9 @@ def get_state(self):
for edge in self.k.scenario.get_edge_list():
ids = self.k.vehicle.get_ids_by_edge(edge)
if len(ids) > 0:
# TODO(cathywu) Why is there a 5 here?
density += [5 * len(ids) / self.k.scenario.edge_length(edge)]
vehicle_length = 5
density += [vehicle_length * len(ids) /
self.k.scenario.edge_length(edge)]
velocity_avg += [np.mean(
[self.k.vehicle.get_speed(veh_id) for veh_id in
ids]) / max_speed]
Expand Down