[RE] A Cyber-Physical System for Freeway Ramp Meter Signal Control Using Deep Reinforcement Learning in a Connected Environment
Original article: Hou, Y., Zhang, X., Graf, P., Tripp, C., & Biagioni, D. (2021). A Cyber-Physical System for Freeway Ramp Meter Signal Control Using Deep Reinforcement Learning in a Connected Environment. In 2021 IEEE Intelligent Transportation Systems Conference (ITSC), pp. 1--8." doi: 10.1109/ITSC48978.2021.9564699.
PDF URL: https://github.com/DerKevinRiehl/replication_ramp_metering_rl_2021_houetal/blob/main/_latex_paper/Full-Paper.pdf Metadata URL: https://github.com/DerKevinRiehl/replication_ramp_metering_rl_2021_houetal/blob/main/_latex_paper/overleaf_folder/metadata.yaml Code URL: https://github.com/DerKevinRiehl/replication_ramp_metering_rl_2021_houetal/
Scientific domain: Reinforcement Learning Based Control Programming language: Python Suggested editor: @rougier
Thanks you for you submission and vey sorry for the (very) late answer. I'll handle your submission.
Since we're are a bit overwhelmed by submissions, can you, you and your co-authors review other submissions? You'll find the list here. Just say you can review in the relevant issue.
Since you have several pending submissions, please review at least 3 submissions (excluding yours of course).
I can review this one. @rougier
Hi @DerKevinRiehl I think all of your links are in private repos. I am getting 404s for all three links. Can you make the public please?
@guygrigsby sorry I didnt notice, I made public now. Thank you for your review!
@rougier will do, I am probably starting by this in week two of September.
@guygrigsby Thank you.
My expertise is in ML and software engineering, not traffic. Therefore my review focuses on that. I recommend three revisions.
Baselines reproduce to the digit and the table arithmetic is exact.
Ran in a container, no network, non-root, checkout read-only, Python 3.11, SUMO 1.26. Probes are in this gist. noRM episode 0, mixed, defaults gave 3772.6273726273726, 14.29228379124843, 0.45722433460076045, matching your result_noRM_ep00.csv.
Revisions Recommended
- The network has no bottleneck. Passes 5337 veh/h without breaking down.
- The reward pays maximum for an empty ramp.
- Training doesn't run as is in this repo. Crashes two iterations in.
1. The network has no bottleneck
This is the trickiest for me, but I think I got it right.
Section 3.2 adopts 3600 to 3700 veh/h from the original. Running demand past 5400 vph and counting outflow at seg7, where env.py measures throughput (p3_capacity.py):
| freeway (vph) | ramp (vph) | τ | sustained outflow at seg7 (vph) |
|---|---|---|---|
| 3900 | 1500 | 1.00 | 5337 |
| 3900 | 900 | 1.00 | 4711 |
| 3000 | 900 | 1.00 | 3924 |
| 3900 | 1500 | 1.04 | 5339 |
| 3900 | 900 | 1.04 | 4675 |
| 3000 | 900 | 1.04 | 3852 |
Demand is 5337 veh/h and the merge never breaks down. Nothing queued so that's the floor rather than a measurement of capacity. Table 4 shows the same thing.
2. The reward pays for an empty ramp
env.py:_get_reward builds v_bar = (v6 + v9 + v10) / 3 from traci.edge.getLastStepMeanSpeed, which returns the lane speed limit for an empty edge not zero. Empty network (p1_empty_edge.py):
seg6 vehicles=0 speed_limit= 29.06 getLastStepMeanSpeed= 29.06
seg9 vehicles=0 speed_limit= 17.88 getLastStepMeanSpeed= 17.88
seg10 vehicles=0 speed_limit= 17.88 getLastStepMeanSpeed= 17.88
v_bar = 21.607 m/s -> speed_term = 0.744
0.744 is also the ceiling, since seg9 and seg10 cap at 17.88 m/s. An empty network scores the max. Red puts slow vehicles on seg9 and drops the reward. Releasing them then restores it. The reward is an incentive not to meter.
The paper's definition ranks the fixed-time meter first and speeds agree (Fixed 17.18 m/s against noRM 14.29 m/s). So the agents optimized roughly "stay green." Section 6.3 then reports A3C matches no ramp metering and mostly holds green. I am thinking that the agent does well at the implemented objective and does not appear to be about Hou et al. I am going from your work here because I couldn't train an agent myself.
Two fixes: weight by vehicles present, and handle the empty segment explicitly. The unweighted mean of three per-edge means is a deviation on its own, since seg6 carries far more vehicles than seg9 and seg10.
3. Training doesn't run
ray[rllib]>=2.5,<2.10 resolves to 2.9.3, where Algorithm.save() returns a _TrainingResult rather than a path. PPO.py:190 hands that to shutil.copytree:
TypeError: scandir: path should be string, bytes, os.PathLike, integer or None, not _TrainingResult
Couldn't dup RL results from the paper as is. Pinning the Ray version would work, I think.
Faithfulness
Original used Flow and your work doesn't mention it. Hou et al. Section IV-A: "We ran RL experiments using Flow [46] [...]." Flow is publicly available.
As such, runtime environment was available and Flow sets its own SUMO vehicle params. Your claim that their scripts are missing is fair, but it's not the whole story.
Hou et al. justify c_r = 9 with at most 9 vehicles in seg9. Your seg9 is 100 m. At SUMO's default 5m length + 2.5m gap is ~ 13.
Segment distances differing from the original:
seg10 63.63m != 75
seg5 87.69 != 100
seg6 162.62 != 150
I think nothing explains why seg6 is longer. Also, speed limits of 65 and 40 mph and s_max = 29.0576 should be in the paper too.
Analysis
Agents not converging dilutes your conclusion. Section 6.2 reports Ape-X DQN never reaches a stable trend and PPO ends about 200 reward points down. Non-converging agents can't support a claim that the original is wrong.
ReScience uses [Re] for a successful replication and [¬Re] for a failed one. Your paper suggests a failed replication so I think that is more appropriate.
@rougier If this still needs a second reviewer, I'd be glad to do it. I'd rerun the training and evaluation from a clean environment, as far as is feasible on CPU, and check the results against both the article and the original paper. I'll write the review myself. Background: distributed systems and ML systems engineering (see ReScience/ReScience#27). No conflicts with the authors.