Skip to content

Latest commit

 

History

History
63 lines (50 loc) · 2.28 KB

scenarios.md

File metadata and controls

63 lines (50 loc) · 2.28 KB

pyBNA Scenarios

pyBNA includes the ability to conduct scenario planning. Scenarios are a way to test the connectivity impacts of a project or group of projects. Running a scenario requires that you have already completed a BNA run on the base scenario. For most situations, you can think of this as the existing conditions.

Scenarios work by flipping affected road segments to low stress, as if a low-stress bike facility has been built. Both segment and intersection stress is reduced so the inherent assumption is that crossings are made low-stress as well. There is no need to identify the type of facility being built, only to identify the location where a low-stress route is wanted.

Scenario Data Prep

Running a scenario requires some data prep work to define the scenario for pyBNA. All data work is done on the roads layer. Projects are defined by assigning a common value to all road segments included in a project. For example, I could create a project by adding a new column to the roads layer named project, selecting all the segments in my project, and assigning a value of my first project. I could create a different project by selecting the roads in another project and assigning a value of my second project.

Running a Scenario

Remember that a scenario can only be run after the base BNA run has been completed. The scenario is run using the same config file as was used for the base scenario and running the calculate_scenario_connectivity method. Using the example in the Scenario Data Prep section, this looks like:

from pybna import pyBNA
bna = pyBNA(config="/path/to/base/config.yaml")
bna.calculate_scenario_connectivity(
    scenario_column=project,
    scenario_ids=["my first project"]
)

or you could run calculations for all scenarios by omitting the scenario_ids argument like:

bna.calculate_scenario_connectivity(
    scenario_column=project
)

Viewing Scenario Results

Results for a given scenario can be generated by passing a scenario_id argument. The following would create an output table of BNA scores for each block under the my first project scenario:

bna.score(
    output_table="my_first_project_results",
    scenario_id="my first project"
)

The output can be compared to the base BNA scenario to see how the project impacts BNA scores.