Skip to content

Commit

Permalink
Merge b3d8d30 into ad1bc36
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanlct committed Sep 10, 2019
2 parents ad1bc36 + b3d8d30 commit 6ff442c
Show file tree
Hide file tree
Showing 146 changed files with 6,908 additions and 7,091 deletions.
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions docs/source/examples.rst
Expand Up @@ -19,7 +19,7 @@ A few points of clarification:

Figure Eight
------------
The figure-eight is a closed-loop version of an intersection. The goal is to maximize
The figure-eight is a closed-ring version of an intersection. The goal is to maximize
the system-wide velocity for fourteen vehicles,
which necessitates spacing the vehicles so that they don't
run into conflicts at the merging points. The scenario is fully observed: all vehicles
Expand All @@ -32,7 +32,7 @@ is relatively light-weight and can be trained the quickest. It can serve both as
that the training process is working correctly and as a study of the difficulty of controlling
many vehicles simultaneously.

.. image:: ../img/figure8-corl2018.png
.. image:: ../img/figure_eight-corl2018.png
:width: 400
:align: center

Expand Down Expand Up @@ -63,7 +63,7 @@ Flow comes with a New York City style, configurable grid of traffic lights where
control both the traffic lights and the autonomous vehicles. The build-in reward is to minimize
the total system delay. The number of rows and columns can be adjusted by changing the values in
`N_ROWS` and `N_COLUMNS` and the inflows adjusted by changing `EDGE_INFLOW`. Relevant files are
`green_wave.py` in the examples folder and `grid_0.py` and `grid_1.py` in the benchmark folder.
`traffic_light_grid.py` in the examples folder and `grid_0.py` and `grid_1.py` in the benchmark folder.

.. image:: ../img/grid-corl2018.png
:width: 400
Expand Down
4 changes: 2 additions & 2 deletions docs/source/flow.envs.bay_bridge.rst
Expand Up @@ -4,10 +4,10 @@ flow.envs.bay\_bridge package
Submodules
----------

flow.envs.bay\_bridge.base module
flow.envs.bay\_bridge module
---------------------------------

.. automodule:: flow.envs.bay_bridge.base
.. automodule:: flow.envs.bay_bridge
:members:
:undoc-members:
:show-inheritance:
Expand Down
8 changes: 4 additions & 4 deletions docs/source/flow.envs.rst
Expand Up @@ -14,23 +14,23 @@ Submodules
flow.envs.base\_env module
--------------------------

.. automodule:: flow.envs.base_env
.. automodule:: flow.envs.base
:members:
:undoc-members:
:show-inheritance:

flow.envs.bottleneck\_env module
--------------------------------

.. automodule:: flow.envs.bottleneck_env
.. automodule:: flow.envs.bottleneck
:members:
:undoc-members:
:show-inheritance:

flow.envs.green\_wave\_env module
flow.envs.traffic\_light\_grid module
---------------------------------

.. automodule:: flow.envs.green_wave_env
.. automodule:: flow.envs.traffic_light_grid
:members:
:undoc-members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/multiagent.rst
Expand Up @@ -16,7 +16,7 @@ The keys of the dictionary are IDs of the agent policies.
A brief example of a multiagent environment:
::

from flow.envs.multiagent_env import MultiEnv
from flow.envs.multiagent.base import MultiEnv

class MultiAgentAccelEnv(AccelEnv, MultiEnv):
"""Example multiagent environment"""
Expand Down
10 changes: 2 additions & 8 deletions examples/README.md
Expand Up @@ -61,9 +61,9 @@ average speed of vehicles in the network.

![](https://raw.githubusercontent.com/flow-project/flow/master/docs/img/figure_eight.gif)

### grid.py
### traffic_light_grid.py

Performs a simulation of vehicles on a grid.
Performs a simulation of vehicles on a traffic light grid.

![](https://raw.githubusercontent.com/flow-project/flow/master/docs/img/grid.gif)

Expand All @@ -73,12 +73,6 @@ Example of an open multi-lane network with human-driven vehicles.

![](https://raw.githubusercontent.com/flow-project/flow/master/docs/img/highway.gif)

### loop_merges.py

Example of ring road with larger merging ring.

![](https://raw.githubusercontent.com/flow-project/flow/master/docs/img/loop_merge.gif)

### merge.py

Example of a merge network with human-driven vehicles.
Expand Down
2 changes: 1 addition & 1 deletion examples/aimsun/bottlenecks.py
Expand Up @@ -6,7 +6,7 @@
from flow.core.params import TrafficLightParams

from flow.scenarios.bottleneck import BottleneckScenario
from flow.envs.bottleneck_env import BottleneckEnv
from flow.envs.bottleneck import BottleneckEnv
from flow.core.experiment import Experiment

SCALING = 1
Expand Down
6 changes: 3 additions & 3 deletions examples/aimsun/figure_eight.py
Expand Up @@ -9,7 +9,7 @@
from flow.core.params import AimsunParams, EnvParams, NetParams
from flow.core.params import VehicleParams
from flow.envs import TestEnv
from flow.scenarios.figure_eight import Figure8Scenario, ADDITIONAL_NET_PARAMS
from flow.scenarios.figure_eight import FigureEightScenario, ADDITIONAL_NET_PARAMS


def figure_eight_example(render=None):
Expand Down Expand Up @@ -42,8 +42,8 @@ def figure_eight_example(render=None):
net_params = NetParams(
additional_params=ADDITIONAL_NET_PARAMS.copy())

scenario = Figure8Scenario(
name="figure8",
scenario = FigureEightScenario(
name="FigureEight",
vehicles=vehicles,
net_params=net_params)

Expand Down
16 changes: 8 additions & 8 deletions examples/aimsun/grid.py
@@ -1,15 +1,15 @@
"""Grid example."""
"""Traffic Light Grid example."""
from flow.core.experiment import Experiment
from flow.core.params import AimsunParams, EnvParams, InitialConfig, NetParams
from flow.core.params import VehicleParams
from flow.core.params import TrafficLightParams
from flow.envs.loop.loop_accel import AccelEnv, ADDITIONAL_ENV_PARAMS
from flow.scenarios.grid import SimpleGridScenario
from flow.envs.ring.accel import AccelEnv, ADDITIONAL_ENV_PARAMS
from flow.scenarios.traffic_light_grid import TrafficLightGridScenario


def grid_example(render=None):
def traffic_light_grid_example(render=None):
"""
Perform a simulation of vehicles on a grid.
Perform a simulation of vehicles on a traffic light grid.
Parameters
----------
Expand All @@ -20,7 +20,7 @@ def grid_example(render=None):
-------
exp: flow.core.experiment.Experiment
A non-rl experiment demonstrating the performance of human-driven
vehicles and balanced traffic lights on a grid.
vehicles and balanced traffic lights on a traffic light grid.
"""
inner_length = 300
long_length = 500
Expand Down Expand Up @@ -101,7 +101,7 @@ def grid_example(render=None):

initial_config = InitialConfig(spacing='custom')

scenario = SimpleGridScenario(
scenario = TrafficLightGridScenario(
name="grid-intersection",
vehicles=vehicles,
net_params=net_params,
Expand All @@ -115,7 +115,7 @@ def grid_example(render=None):

if __name__ == "__main__":
# import the experiment variable
exp = grid_example()
exp = traffic_light_grid_example()

# run for a set number of rollouts / time steps
exp.run(1, 1500)
4 changes: 2 additions & 2 deletions examples/aimsun/merge.py
Expand Up @@ -9,7 +9,7 @@
from flow.core.experiment import Experiment
from flow.scenarios.merge import MergeScenario, ADDITIONAL_NET_PARAMS
from flow.controllers import IDMController
from flow.envs.merge import WaveAttenuationMergePOEnv, ADDITIONAL_ENV_PARAMS
from flow.envs.merge import MergePOEnv, ADDITIONAL_ENV_PARAMS

# inflow rate at the highway
HIGHWAY_RATE = 2000
Expand Down Expand Up @@ -83,7 +83,7 @@ def merge_example(render=None):
net_params=net_params,
initial_config=initial_config)

env = WaveAttenuationMergePOEnv(
env = MergePOEnv(
env_params, sim_params, scenario, simulator='aimsun')

return Experiment(env)
Expand Down
2 changes: 1 addition & 1 deletion examples/aimsun/small_template.py
Expand Up @@ -4,7 +4,7 @@
from flow.core.params import AimsunParams, EnvParams, NetParams
from flow.core.params import VehicleParams
from flow.envs import TestEnv
from flow.scenarios.loop import Scenario
from flow.scenarios.ring import Scenario
from flow.core.params import InFlows
import flow.config as config
import os
Expand Down
4 changes: 2 additions & 2 deletions examples/aimsun/sugiyama.py
Expand Up @@ -8,7 +8,7 @@
from flow.core.params import AimsunParams, EnvParams, InitialConfig, NetParams
from flow.core.params import VehicleParams
from flow.envs import TestEnv
from flow.scenarios.loop import LoopScenario, ADDITIONAL_NET_PARAMS
from flow.scenarios.ring import RingScenario, ADDITIONAL_NET_PARAMS


def sugiyama_example(render=None):
Expand Down Expand Up @@ -43,7 +43,7 @@ def sugiyama_example(render=None):

initial_config = InitialConfig(bunching=20)

scenario = LoopScenario(
scenario = RingScenario(
name="sugiyama",
vehicles=vehicles,
net_params=net_params,
Expand Down

0 comments on commit 6ff442c

Please sign in to comment.