Skip to content

Commit

Permalink
Network update (#953)
Browse files Browse the repository at this point in the history
Add new I210 models and envs.
  • Loading branch information
eugenevinitsky authored May 28, 2020
1 parent 243c895 commit f7a278c
Show file tree
Hide file tree
Showing 23 changed files with 7,550 additions and 284 deletions.
16 changes: 16 additions & 0 deletions docs/source/flow_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ If you are a Mac user and the above command gives you the error
``FXApp:openDisplay: unable to open display :0.0``, make sure to open the
application XQuartz.

*Troubleshooting*:
If you are a Mac user and the above command gives you the error
``Segmentation fault: 11``, make sure to reinstall ``fox`` using brew.
::

# Uninstall Catalina bottle of fox:
$ brew uninstall --ignore-dependencies fox

# Edit brew Formula of fox:
$ brew edit fox

# Comment out or delete the following line: sha256 "c6697be294c9a0458580564d59f8db32791beb5e67a05a6246e0b969ffc068bc" => :catalina
# Install Mojave bottle of fox:
$ brew install fox


Testing your SUMO and Flow installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
12 changes: 8 additions & 4 deletions examples/exp_configs/non_rl/highway_single.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example of an open network with human-driven vehicles and a wave."""

import numpy as np

from flow.controllers import IDMController
Expand All @@ -10,8 +11,8 @@
from flow.core.params import VehicleParams
from flow.core.params import SumoParams
from flow.core.params import SumoLaneChangeParams
from flow.core.rewards import miles_per_gallon, miles_per_megajoule
from flow.core.params import SumoCarFollowingParams
from flow.core.rewards import miles_per_megajoule
from flow.networks import HighwayNetwork
from flow.envs import TestEnv
from flow.networks.highway import ADDITIONAL_NET_PARAMS
Expand All @@ -23,7 +24,7 @@
# the inflow rate of vehicles
TRAFFIC_FLOW = 2215
# the simulation time horizon (in steps)
HORIZON = 1500
HORIZON = 1000
# whether to include noise in the car-following models
INCLUDE_NOISE = True

Expand Down Expand Up @@ -64,13 +65,13 @@
),
)

inflows = InFlows()

if PENETRATION_RATE > 0.0:
vehicles.add(
"av",
color='red',
num_vehicles=0,
acceleration_controller=(FollowerStopper, {"v_des": 6.0}),
acceleration_controller=(FollowerStopper, {"v_des": 5.0, "control_length": [500, 2300]}),
)

inflows = InFlows()
Expand Down Expand Up @@ -145,5 +146,8 @@
env.k.vehicle.get_outflow_rate(120)),
"miles_per_megajoule": lambda env: np.nan_to_num(
miles_per_megajoule(env, env.k.vehicle.get_ids(), gain=1.0)
),
"miles_per_gallon": lambda env: np.nan_to_num(
miles_per_gallon(env, env.k.vehicle.get_ids(), gain=1.0)
)
}
Loading

0 comments on commit f7a278c

Please sign in to comment.