diff --git a/flow/config.py b/flow/config.py index 7130f6d8a..94c99f473 100644 --- a/flow/config.py +++ b/flow/config.py @@ -21,6 +21,7 @@ # path to the Aimsun_Next main directory (required for Aimsun simulations) AIMSUN_NEXT_PATH = os.environ.get("AIMSUN_NEXT_PATH", None) + # path to the aimsun_flow environment's main directory (required for Aimsun # simulations) AIMSUN_SITEPACKAGES = os.environ.get("AIMSUN_SITEPACKAGES", None) diff --git a/tutorials/tutorial11_inflows.ipynb b/tutorials/tutorial11_inflows.ipynb index 1a9fc18d2..3b841123d 100644 --- a/tutorials/tutorial11_inflows.ipynb +++ b/tutorials/tutorial11_inflows.ipynb @@ -123,11 +123,11 @@ "\n", "* `veh_type`: the type of the vehicles the inflow will create (this must match one of the types set in the `VehicleParams` object),\n", "* `edge`: the name of the edge (in the network) where the inflow will insert vehicles,\n", - "* `vehs_per_hour`: the number of vehicles entering from the edge per hour at most (it may not be achievable due to congestion and safe driving behavior).\n", + "* `vehs_per_hour`: the maximum number of vehicles entering from the edge per hour (this number may not be achievable due to congestion and safe driving behavior).\n", "\n", "More options are shown in [**section 3**](#3.-Customizing-inflows).\n", "\n", - "We begin by creating an inflow of vehicles at a rate of 2000 vehicules per hour on the main highway:" + "We begin by creating an inflow of vehicles at a rate of 2000 vehicles per hour on the main highway:" ] }, { @@ -145,7 +145,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Next, we create a second inflow of vehicles on the on-merge lane at a lower rate of 100 vehicules par hour." + "Next, we create a second inflow of vehicles on the inflow_merge lane at a lower rate of 100 vehicles per hour." ] }, { @@ -173,20 +173,6 @@ "## 2. Running simulations with inflows" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the next section, we will add our inflows to our network and run a simulation to see them in action." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 2. Running simulations with inflows" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -325,7 +311,7 @@ "\n", "- `period`: this is the time in seconds between two vehicles are inserted. For example, setting this to $5$ would result in vehicles entering the network every $5$ seconds (which is effectively the same as setting `vehs_per_hour` to $720$).\n", "\n", - "_Note that all these rates are **maximum** rates, meaning that if adding vehicles at the current rate would result in vehicles between too close to each other or colliding, then the rate will automatically be reduced._\n", + "_Note that all these rates are **maximum** rates, meaning that if adding vehicles at the current rate would result in vehicles being too close to each other or colliding, then the rate will automatically be reduced._\n", "\n", "Exactly **one** of these 3 parameters should be set, no more nor less. You can choose how you would rather have your vehicles enter the network. With `vehs_per_hour` and `period` (which are proportional to each other, use whichever is more convenient to define), vehicles will enter the network equally spaced, while the vehicles will be more randomly separated if you use `probability`.\n", "\n", @@ -348,7 +334,8 @@ "- `depart_speed`: this parameter lets you specify the speed at which the vehicles will enter the network. It should be a positive `float`, in meters per second. If this speed is unsafe, the departure of the vehicles is delayed. Just like for `depart_lane`, there are other options for this parameter, which are the following strings:\n", "\n", " - `\"random\"`: vehicles enter the edge with a random speed between 0 and the speed limit on the edge. The entering speed may be adapted to ensure that a safe distance to the leading vehicle is kept\n", - " - `\"speedLimit\"`: vehicles enter the edge with the maximum speed that is allowed on this edge. If that speed is unsafe, the departure is delayed.\n", + " - `\"max\"`: vehicle speeds at insertion will be adjusted to the maximum safe speed that allows insertion at the specified time to succeed\n", + "\n", " \n", "By default, `depart_speed` is set to 0.\n", "\n", @@ -418,7 +405,8 @@ "from flow.controllers import IDMController\n", "from flow.networks import MergeNetwork\n", "from flow.networks.merge import ADDITIONAL_NET_PARAMS\n", - "from flow.envs.loop.loop_accel import AccelEnv, ADDITIONAL_ENV_PARAMS\n", + "from flow.envs.ring.accel import AccelEnv, ADDITIONAL_ENV_PARAMS\n", + "\n", "\n", "\n", "# create a vehicle type\n", @@ -437,7 +425,7 @@ " edge=\"inflow_highway\",\n", " vehs_per_hour=10000,\n", " depart_lane=\"random\",\n", - " depart_speed=\"speedLimit\",\n", + " depart_speed=\"random\",\n", " color=\"white\")\n", "\n", "# inflow for (2)\n", @@ -453,7 +441,7 @@ " edge=\"inflow_merge\",\n", " probability=0.1,\n", " depart_lane=1, # left lane\n", - " depart_speed=\"random\",\n", + " depart_speed=\"max\",\n", " begin=60, # 1 minute\n", " number=30,\n", " color=\"red\")\n", @@ -490,18 +478,11 @@ "\n", "_ = exp.run(1, 10000)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python [default]", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -515,7 +496,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.2" + "version": "3.6.8" } }, "nbformat": 4,