3

I have a question about Flow the deep re-enforcement learning framework.

How do I add multiple RL vehicles among the human-driven vehicles so that the RL vehicles are distributed evenly?

I checked out the docs and examples but wasn't sure how to approach this goal.

Thanks!

Mark Stosberg
  • 12,961
  • 6
  • 44
  • 49

1 Answers1

4

Please see here: https://github.com/flow-project/flow/blob/master/flow/benchmarks/figureeight1.py

You can iteratively add several human-driven vehicles first and then some RL vehicles next.

for i in range(7):
vehicles.add(
    veh_id="human{}".format(i),
    acceleration_controller=(IDMController, {
        "noise": 0.2
    }),
    routing_controller=(ContinuousRouter, {}),
    car_following_params=SumoCarFollowingParams(
        speed_mode="obey_safe_speed",
    ),
    num_vehicles=1)
vehicles.add(
    veh_id="rl{}".format(i),
    acceleration_controller=(RLController, {}),
    routing_controller=(ContinuousRouter, {}),
    car_following_params=SumoCarFollowingParams(
        speed_mode="obey_safe_speed",
    ),
    num_vehicles=1)
Ashkan
  • 238
  • 1
  • 10